services

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2025 License: MIT Imports: 23 Imported by: 0

Documentation

Index

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

type BuilderFactory interface {
	GetBuilder(language string) (builders.Builder, error)
}

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

Jump to

Keyboard shortcuts

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