package gapi
import "github.com/purpleidea/mgmt/lang/gapi"
Package gapi is the Graph API implementation for the mcl language frontend.
Index ¶
- Constants
- type GAPI
- func (obj *GAPI) Cli(info *gapi.Info) (*gapi.Deploy, error)
- func (obj *GAPI) Close() error
- func (obj *GAPI) Graph() (*pgraph.Graph, error)
- func (obj *GAPI) Info() *gapi.InfoResult
- func (obj *GAPI) Init(data *gapi.Data) error
- func (obj *GAPI) LangClose() error
- func (obj *GAPI) LangInit(ctx context.Context) error
- func (obj *GAPI) Next() chan gapi.Next
Constants ¶
const ( // Name is the name of this frontend. Name = "lang" )
Types ¶
type GAPI ¶
type GAPI struct { InputURI string // input URI of code file system to run // Data is some additional data for the lang struct. Data *lang.Data // contains filtered or unexported fields }
GAPI implements the main lang GAPI interface.
func (*GAPI) Cli ¶
Cli takes an *Info struct, and returns our deploy if activated, and if there are any validation problems, you should return an error. If there is no deploy, then you should return a nil deploy and a nil error. This is passed in a functional file system interface. For standalone usage, this will be a temporary memory-backed filesystem so that the same deploy API is used, and for normal clustered usage, this will be the normal implementation which is usually an etcd backed fs. At this point we should be copying the necessary local file system data into our fs for future use when the GAPI is running. IOW, running this Cli function, when activated, produces a deploy object which is run by our main loop. The difference between running from `deploy` or from `run` (both of which can activate this GAPI) is that `deploy` copies to an etcdFs, and `run` copies to a memFs. All GAPI's run off of the fs that is passed in.
func (*GAPI) Close ¶
Close shuts down the lang GAPI.
func (*GAPI) Graph ¶
Graph returns a current Graph.
func (*GAPI) Info ¶
func (obj *GAPI) Info() *gapi.InfoResult
Info returns some data about the GAPI implementation.
func (*GAPI) Init ¶
Init initializes the lang GAPI struct.
func (*GAPI) LangClose ¶
LangClose is a wrapper around the lang Close method.
func (*GAPI) LangInit ¶
LangInit is a wrapper around the lang Init method.
func (*GAPI) Next ¶
Next returns nil errors every time there could be a new graph.
Source Files ¶
- Version
- v0.0.0-20250322185616-c50a578426f1 (latest)
- Published
- Mar 22, 2025
- Platform
- linux/amd64
- Imports
- 25 packages
- Last checked
- 4 days ago –
Tools for package owners.