Documentation
¶
Index ¶
- type BuildResult
- type Client
- func (c *Client) BuildPlugin(plugin *Plugin, template string, source io.Reader) (*BuildResult, error)
- func (c *Client) BuildPluginString(plugin *Plugin, template, source string) (*BuildResult, error)
- func (c *Client) BuilderFeatures() (*FeaturesResponse, error)
- func (c *Client) BuilderHealth() (bool, error)
- func (c *Client) BuilderTemplate(plugin *Plugin, template string) (*EditorStateResponse, error)
- func (c *Client) EditorToken(plugin *Plugin) (string, error)
- func (c *Client) Exec(plugin *Plugin, body io.Reader) ([]byte, string, error)
- func (c *Client) ExecRef(ref string, body io.Reader) ([]byte, string, error)
- func (c *Client) ExecRefString(ref string, body string) ([]byte, string, error)
- func (c *Client) ExecString(plugin *Plugin, body string) ([]byte, string, error)
- func (c *Client) ExecutionResult(uuid string) ([]byte, error)
- func (c *Client) ExecutionResultMetadata(uuid string) (*ExecMetadata, error)
- func (c *Client) ExecutionResultsMetadata(plugin *Plugin) ([]ExecMetadata, error)
- func (c *Client) GetDraft(plugin *Plugin) (*EditorStateResponse, error)
- func (c *Client) PromoteDraft(plugin *Plugin) (*PromoteDraftResponse, error)
- func (c *Client) UserPlugins(identifier string, namespace string) ([]*tenant.Module, error)
- type Config
- type EditorStateResponse
- type ExecError
- type ExecMetadata
- type ExecResponse
- type FeatureLanguage
- type FeaturesResponse
- type Plugin
- type PromoteDraftResponse
- type TestPayload
- type TokenResponse
- type UserPluginsResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildResult ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is used for interacting with the SE2 API
func NewLocalClient ¶
NewLocalClient quickly sets up a Client with a LocalConfig. Useful for testing.
func (*Client) BuildPlugin ¶ added in v0.2.1
func (c *Client) BuildPlugin(plugin *Plugin, template string, source io.Reader) (*BuildResult, error)
BuildPlugin triggers a remote build for the given plugin and source code. See also: Client.BuildPluginString()
Example ¶
This plugin is useful for reading from a filesystem or from an http.Response.Body
plugin := se2.NewPlugin("com.suborbital", "acmeco", "default", "hello") file, _ := os.Open("hello.rs") result, err := client.BuildPlugin(plugin, file)
func (*Client) BuildPluginString ¶ added in v0.2.1
func (c *Client) BuildPluginString(plugin *Plugin, template, source string) (*BuildResult, error)
BuildPluginString triggers a remote build for the given plugin and source code. See also: Client.BuildPlugin()
func (*Client) BuilderFeatures ¶
func (c *Client) BuilderFeatures() (*FeaturesResponse, error)
BuilderFeatures lists the features present on the builder, such as testing capabilities.
func (*Client) BuilderHealth ¶
BuilderHealth is used to check that the builder is healthy and responding to requests.
func (*Client) BuilderTemplate ¶
func (c *Client) BuilderTemplate(plugin *Plugin, template string) (*EditorStateResponse, error)
BuilderTemplate gets the plugin template for the provided plugin and template name.
func (*Client) EditorToken ¶
EditorToken gets an editor token for the provided plugin. Note: this library manages editor tokens for you, so you most likely do not need to use this function.
func (*Client) Exec ¶
Exec remotely executes the provided plugin using the body as input. See also: ExecString()
func (*Client) ExecRef ¶
ExecRef remotely executes the provided plugin using the body as input, by plugin reference. See also: ExecRefString()
func (*Client) ExecRefString ¶
ExecRefString sets up a buffer with the provided string and calls ExecRef
func (*Client) ExecString ¶
ExecString sets up a buffer with the provided string and calls Exec
func (*Client) ExecutionResult ¶ added in v0.2.1
ExecutionResult returns the result of the provided plugin execution.
func (*Client) ExecutionResultMetadata ¶ added in v0.2.1
func (c *Client) ExecutionResultMetadata(uuid string) (*ExecMetadata, error)
ExecutionResultMetadata returns metadata for the provided plugin execution.
func (*Client) ExecutionResultsMetadata ¶ added in v0.2.1
func (c *Client) ExecutionResultsMetadata(plugin *Plugin) ([]ExecMetadata, error)
ExecutionResultsMetadata returns metadata for the 5 most recent execution results for the provided plugin.
func (*Client) GetDraft ¶
func (c *Client) GetDraft(plugin *Plugin) (*EditorStateResponse, error)
GetDraft gets the most recently build source code for the provided plugin. Must have the .FQFMURI field set.
func (*Client) PromoteDraft ¶
func (c *Client) PromoteDraft(plugin *Plugin) (*PromoteDraftResponse, error)
PromoteDraft takes the most recent build of the provided plugin and deploys it so it can be run.
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config combines the common configuration options for the three Suborbital Extension Engine APIs (Administrative, Builder, and Execution)
func CustomConfig ¶
Custom Configuration
func DefaultConfig ¶
DefaultConfig takes the given host and creates a SE2 config with the K8S default ports. Everything except the scheme and hostname are considered. You need to provide your builder host domain.
func LocalConfig ¶
func LocalConfig() *Config
LocalConfig generates a Configuration for SE2 running in docker-compose
type EditorStateResponse ¶
type EditorStateResponse struct { Lang string `json:"lang"` Contents string `json:"contents"` Tests []TestPayload `json:"tests"` }
EditorStateResponse is a response to requests to get editorState
type ExecMetadata ¶
type ExecResponse ¶
type FeatureLanguage ¶
type FeaturesResponse ¶
type FeaturesResponse struct { Features []string `json:"features"` Langauges []FeatureLanguage `json:"languages"` }
type Plugin ¶ added in v0.2.1
type PromoteDraftResponse ¶
type PromoteDraftResponse struct {
Version string `json:"version"`
}
type TestPayload ¶
type TestPayload struct { Name string `json:"name"` Description string `json:"description"` Payload string `json:"payload"` }
TestPayload is a single test for a plugin
type TokenResponse ¶
type TokenResponse struct {
Token string `json:"token"`
}