state

package
v0.423.1 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EventExtractor added in v0.421.0

func EventExtractor(diff tuple.Pair[SchemaState, SchemaState]) iter.Seq[SchemaEvent]

EventExtractor calculates controller events from changes to the state.

func NewInMemoryRunnerState added in v0.421.0

func NewInMemoryRunnerState(ctx context.Context) eventstream.EventStream[RunnerState, RunnerEvent]

func NewInMemorySchemaState added in v0.421.0

func NewInMemorySchemaState(ctx context.Context) *statemachine.SingleQueryHandle[struct{}, SchemaState, SchemaEvent]

Types

type Deployment

type Deployment struct {
	Key    key.Deployment
	Schema *schema.Module
}

type DeploymentActivatedEvent

type DeploymentActivatedEvent struct {
	Key         key.Deployment
	ActivatedAt time.Time
	MinReplicas int
}

func (*DeploymentActivatedEvent) Handle

type DeploymentArtefact

type DeploymentArtefact struct {
	Digest     sha256.SHA256
	Path       string
	Executable bool
}

type DeploymentCreatedEvent

type DeploymentCreatedEvent struct {
	Key       key.Deployment
	CreatedAt time.Time
	Schema    *schema.Module
}

func (*DeploymentCreatedEvent) Handle

type DeploymentDeactivatedEvent

type DeploymentDeactivatedEvent struct {
	Key           key.Deployment
	ModuleRemoved bool
}

func (*DeploymentDeactivatedEvent) Handle

type DeploymentReplicasUpdatedEvent

type DeploymentReplicasUpdatedEvent struct {
	Key      key.Deployment
	Replicas int
}

func (*DeploymentReplicasUpdatedEvent) Handle

type DeploymentSchemaUpdatedEvent

type DeploymentSchemaUpdatedEvent struct {
	Key    key.Deployment
	Schema *schema.Module
}

func (*DeploymentSchemaUpdatedEvent) Handle

type Runner

type Runner struct {
	Key        key.Runner
	Create     time.Time
	LastSeen   time.Time
	Endpoint   string
	Module     string
	Deployment key.Deployment
}

type RunnerDeletedEvent

type RunnerDeletedEvent struct {
	Key key.Runner
}

func (*RunnerDeletedEvent) Handle

type RunnerEvent added in v0.421.0

type RunnerEvent interface {
	Handle(view RunnerState) (RunnerState, error)
}

type RunnerRegisteredEvent

type RunnerRegisteredEvent struct {
	Key        key.Runner
	Time       time.Time
	Endpoint   string
	Module     string
	Deployment key.Deployment
}

func (*RunnerRegisteredEvent) Handle

func (*RunnerRegisteredEvent) VerboseMessage

func (r *RunnerRegisteredEvent) VerboseMessage()

type RunnerState added in v0.421.0

type RunnerState struct {
	// contains filtered or unexported fields
}

func (*RunnerState) Runner added in v0.421.0

func (r *RunnerState) Runner(s key.Runner) optional.Option[Runner]

func (*RunnerState) Runners added in v0.421.0

func (r *RunnerState) Runners() []Runner

func (*RunnerState) RunnersForDeployment added in v0.421.0

func (r *RunnerState) RunnersForDeployment(deployment key.Deployment) []Runner

type SchemaEvent added in v0.421.0

type SchemaEvent interface {
	Handle(view SchemaState) (SchemaState, error)
}

type SchemaState added in v0.421.0

type SchemaState struct {
	// contains filtered or unexported fields
}

func (*SchemaState) GetActiveDeploymentSchemas added in v0.421.0

func (r *SchemaState) GetActiveDeploymentSchemas() []*schema.Module

func (*SchemaState) GetActiveDeployments added in v0.421.0

func (r *SchemaState) GetActiveDeployments() map[key.Deployment]*Deployment

func (*SchemaState) GetDeployment added in v0.421.0

func (r *SchemaState) GetDeployment(deployment key.Deployment) (*Deployment, error)

func (*SchemaState) GetDeployments added in v0.421.0

func (r *SchemaState) GetDeployments() map[key.Deployment]*Deployment

Jump to

Keyboard shortcuts

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