Documentation
¶
Index ¶
- type BuildResult
- type BuilderFactory
- type EngineClient
- func (c *EngineClient) BuildFunction(ctx context.Context, namespace, name, path, tag string, ...) (*types.BuildResult, error)
- func (c *EngineClient) CallFunction(ctx context.Context, namespace, name, entrypoint string, payload []byte, ...) ([]byte, error)
- func (c *EngineClient) GetFunctionLogs(ctx context.Context, namespace, name string, since time.Duration, tail int) ([]string, error)
- func (c *EngineClient) ListFunctions(ctx context.Context) ([]types.LoadedFunction, error)
- func (c *EngineClient) LoadFunction(ctx context.Context, namespace, name, tag string, config map[string]string) error
- func (c *EngineClient) OneOffCall(ctx context.Context, namespace, name, reference, entrypoint string, ...) ([]byte, error)
- func (c *EngineClient) Ping(ctx context.Context) error
- func (c *EngineClient) Status(ctx context.Context) error
- func (c *EngineClient) StopFunction(ctx context.Context, namespace, name string) error
- func (c *EngineClient) StopFunctions(ctx context.Context, functions []models.FunctionReference) error
- func (c *EngineClient) UnloadFunction(ctx context.Context, namespace, name string) error
- func (c *EngineClient) UnloadFunctions(ctx context.Context, functions []models.FunctionReference) error
- type FunctionDetails
- type FunctionService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildResult ¶
type BuildResult struct {
Name string // Function name
Path string // Path to the built WASM file
Digest string // Content hash of the built WASM file
}
BuildResult contains information about a successful function build.
type BuilderFactory ¶
BuilderFactory creates language-specific builders.
func NewBuilderFactory ¶
func NewBuilderFactory() BuilderFactory
NewBuilderFactory creates a new builder factory.
type EngineClient ¶
type EngineClient struct {
// contains filtered or unexported fields
}
EngineClient implements the client.EngineClient interface
func NewEngineClient ¶
func NewEngineClient(socketPath string) (*EngineClient, error)
func NewEngineClientWithDefaults ¶
func NewEngineClientWithDefaults() *EngineClient
func (*EngineClient) BuildFunction ¶ added in v0.1.1
func (c *EngineClient) BuildFunction(ctx context.Context, namespace, name, path, tag string, manifest manifest.FunctionManifest) (*types.BuildResult, error)
BuildFunction builds a function
func (*EngineClient) CallFunction ¶ added in v0.1.1
func (c *EngineClient) CallFunction(ctx context.Context, namespace, name, entrypoint string, payload []byte, config map[string]string) ([]byte, error)
CallFunction calls a function
func (*EngineClient) GetFunctionLogs ¶
func (c *EngineClient) GetFunctionLogs(ctx context.Context, namespace, name string, since time.Duration, tail int) ([]string, error)
GetFunctionLogs gets logs for a function
func (*EngineClient) ListFunctions ¶
func (c *EngineClient) ListFunctions(ctx context.Context) ([]types.LoadedFunction, error)
ListFunctions lists all loaded functions
func (*EngineClient) LoadFunction ¶
func (c *EngineClient) LoadFunction(ctx context.Context, namespace, name, tag string, config map[string]string) error
LoadFunction loads a function into the engine
func (*EngineClient) OneOffCall ¶ added in v0.1.1
func (c *EngineClient) OneOffCall(ctx context.Context, namespace, name, reference, entrypoint string, payload []byte, config map[string]string) ([]byte, error)
OneOffCall loads a function temporarily and calls it
func (*EngineClient) Ping ¶
func (c *EngineClient) Ping(ctx context.Context) error
Ping is an alias for Status
func (*EngineClient) Status ¶ added in v0.1.1
func (c *EngineClient) Status(ctx context.Context) error
Status checks if the engine is running
func (*EngineClient) StopFunction ¶
func (c *EngineClient) StopFunction(ctx context.Context, namespace, name string) error
StopFunction stops a function in the engine
func (*EngineClient) StopFunctions ¶ added in v0.1.1
func (c *EngineClient) StopFunctions(ctx context.Context, functions []models.FunctionReference) error
StopFunctions stops multiple functions at once
func (*EngineClient) UnloadFunction ¶
func (c *EngineClient) UnloadFunction(ctx context.Context, namespace, name string) error
UnloadFunction unloads a function from the engine
func (*EngineClient) UnloadFunctions ¶
func (c *EngineClient) UnloadFunctions(ctx context.Context, functions []models.FunctionReference) error
UnloadFunctions unloads multiple functions at once
type FunctionDetails ¶
type FunctionDetails struct {
Namespace string `json:"namespace"`
Name string `json:"name"`
Digest string `json:"digest"`
Tags []string `json:"tags,omitempty"`
}
FunctionDetails provides information about a function for internal use.
type FunctionService ¶
type FunctionService interface {
// InitFunction initializes a new function with the given name and language
InitFunction(name string, language string) error
// BuildFunction builds a function and returns the build result
BuildFunction(path string, functionConfig manifest.FunctionManifest) (result *BuildResult, err error)
// CalculateHash computes a hash for a function based on its source code and config
CalculateHash(path string, config manifest.FunctionManifest) (*BuildResult, error)
// LoadFunction loads a function into the engine
LoadFunction(ctx context.Context, namespace, name, tag string) error
// ListFunctions lists all loaded functions in the engine
ListFunctions(ctx context.Context) ([]types.FunctionInfo, error)
}
FunctionService defines the interface for function-related operations.
func NewFunctionService ¶
func NewFunctionService() FunctionService