state

package
v0.412.1 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	Endpoint string
	Key      model.ControllerKey
}

type ControllerEvent

type ControllerEvent interface {
	Handle(view State) (State, error)
}

type ControllerState

type ControllerState eventstream.EventStream[State, ControllerEvent]

func NewInMemoryState

func NewInMemoryState() ControllerState

type Deployment

type Deployment struct {
	Key         model.DeploymentKey
	Module      string
	Schema      *schema.Module
	MinReplicas int
	CreatedAt   time.Time
	ActivatedAt optional.Option[time.Time]
	Artefacts   map[string]*DeploymentArtefact
	Language    string
}

type DeploymentActivatedEvent

type DeploymentActivatedEvent struct {
	Key         model.DeploymentKey
	ActivatedAt time.Time
	MinReplicas int
}

func (*DeploymentActivatedEvent) Handle

func (r *DeploymentActivatedEvent) Handle(t State) (State, error)

type DeploymentArtefact

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

type DeploymentArtefactCreatedEvent

type DeploymentArtefactCreatedEvent struct {
	Digest sha256.SHA256
}

func (*DeploymentArtefactCreatedEvent) Handle

func (d *DeploymentArtefactCreatedEvent) Handle(view State) (State, error)

type DeploymentCreatedEvent

type DeploymentCreatedEvent struct {
	Key       model.DeploymentKey
	CreatedAt time.Time
	Module    string
	Schema    *schema.Module
	Artefacts []*DeploymentArtefact
	Language  string
}

func (*DeploymentCreatedEvent) Handle

func (r *DeploymentCreatedEvent) Handle(t State) (State, error)

type DeploymentDeactivatedEvent

type DeploymentDeactivatedEvent struct {
	Key           model.DeploymentKey
	ModuleRemoved bool
}

func (*DeploymentDeactivatedEvent) Handle

func (r *DeploymentDeactivatedEvent) Handle(t State) (State, error)

type DeploymentReplicasUpdatedEvent

type DeploymentReplicasUpdatedEvent struct {
	Key      model.DeploymentKey
	Replicas int
}

func (*DeploymentReplicasUpdatedEvent) Handle

type DeploymentSchemaUpdatedEvent

type DeploymentSchemaUpdatedEvent struct {
	Key    model.DeploymentKey
	Schema *schema.Module
}

func (*DeploymentSchemaUpdatedEvent) Handle

type Runner

type Runner struct {
	Key        model.RunnerKey
	Create     time.Time
	LastSeen   time.Time
	Endpoint   string
	Module     string
	Deployment model.DeploymentKey
}

type RunnerDeletedEvent

type RunnerDeletedEvent struct {
	Key model.RunnerKey
}

func (*RunnerDeletedEvent) Handle

func (r *RunnerDeletedEvent) Handle(t State) (State, error)

type RunnerRegisteredEvent

type RunnerRegisteredEvent struct {
	Key        model.RunnerKey
	Time       time.Time
	Endpoint   string
	Module     string
	Deployment model.DeploymentKey
}

func (*RunnerRegisteredEvent) Handle

func (r *RunnerRegisteredEvent) Handle(t State) (State, error)

func (*RunnerRegisteredEvent) VerboseMessage

func (r *RunnerRegisteredEvent) VerboseMessage()

type State

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

func (*State) GetActiveDeploymentSchemas

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

func (*State) GetActiveDeployments

func (r *State) GetActiveDeployments() map[string]*Deployment

func (*State) GetDeployment

func (r *State) GetDeployment(deployment model.DeploymentKey) (*Deployment, error)

func (*State) GetDeployments

func (r *State) GetDeployments() map[string]*Deployment

func (*State) Runner

func (r *State) Runner(s string) optional.Option[Runner]

func (*State) Runners

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

func (*State) RunnersForDeployment

func (r *State) RunnersForDeployment(deployment string) []Runner

Jump to

Keyboard shortcuts

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