engine

package
v0.0.0-...-687d16e Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deployment

type Deployment struct {
	ID string
	// contains filtered or unexported fields
}

func NewDeployment

func NewDeployment(
	id string,
	env module.HostEnvironment,
	wasm []byte,
	manifest manifest.Manifest,
	config DeploymentConfig,
) *Deployment

func (*Deployment) BorrowModule

func (d *Deployment) BorrowModule(ctx context.Context) (*module.Module, error)

func (*Deployment) Close

func (d *Deployment) Close(ctx context.Context)

func (*Deployment) Config

func (d *Deployment) Config() DeploymentConfig

func (*Deployment) HandleEvent

func (d *Deployment) HandleEvent(ctx context.Context, event *event.Event) error

func (*Deployment) InvalidateModule

func (d *Deployment) InvalidateModule(ctx context.Context, p *module.Module) error

func (*Deployment) Manifest

func (d *Deployment) Manifest() manifest.Manifest

func (*Deployment) ModuleConfig

func (d *Deployment) ModuleConfig() module.ModuleConfig

func (*Deployment) ReturnModule

func (d *Deployment) ReturnModule(ctx context.Context, p *module.Module) error

type DeploymentConfig

type DeploymentConfig struct {
	module.ModuleConfig
	PoolMaxTotal int
	PoolMaxIdle  int
	PoolMinIdle  int
}

type Engine

type Engine struct {
	sync.RWMutex

	Deployments map[distype.Snowflake][]*Deployment
}

func New

func New() *Engine

func (*Engine) HandleEvent

func (e *Engine) HandleEvent(ctx context.Context, event *event.Event)

func (*Engine) LoadAppDeployment

func (e *Engine) LoadAppDeployment(ctx context.Context, appID distype.Snowflake, deployment *Deployment)

func (*Engine) RemoveAppDeployment

func (e *Engine) RemoveAppDeployment(ctx context.Context, appID distype.Snowflake, deploymentID string)

func (*Engine) ReplaceAppDeployments

func (e *Engine) ReplaceAppDeployments(ctx context.Context, appID distype.Snowflake, deployments []*Deployment)

func (*Engine) TruncateAppDeployments

func (e *Engine) TruncateAppDeployments(ctx context.Context, appID distype.Snowflake, deploymentIDs []string) bool

Jump to

Keyboard shortcuts

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