gapi

package
v0.0.0-...-328360e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2024 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Overview

Package gapi is the Graph API implementation for the mcl language frontend.

Index

Constants

View Source
const (
	// Name is the name of this frontend.
	Name = "lang"
)

Variables

This section is empty.

Functions

This section is empty.

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

func (obj *GAPI) Cli(info *gapi.Info) (*gapi.Deploy, error)

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

func (obj *GAPI) Close() error

Close shuts down the lang GAPI.

func (*GAPI) Graph

func (obj *GAPI) Graph() (*pgraph.Graph, error)

Graph returns a current Graph.

func (*GAPI) Init

func (obj *GAPI) Init(data *gapi.Data) error

Init initializes the lang GAPI struct.

func (*GAPI) LangClose

func (obj *GAPI) LangClose() error

LangClose is a wrapper around the lang Close method.

func (*GAPI) LangInit

func (obj *GAPI) LangInit(ctx context.Context) error

LangInit is a wrapper around the lang Init method.

func (*GAPI) Next

func (obj *GAPI) Next() chan gapi.Next

Next returns nil errors every time there could be a new graph.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL