schemaservice

package
v0.438.1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EventExtractor added in v0.433.2

EventExtractor calculates controller events from changes to the state.

func NewInMemorySchemaState added in v0.433.2

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

func Start added in v0.434.0

func Start(
	ctx context.Context,
	config Config,
) error

Start the SchemaService. Blocks until the context is cancelled.

Types

type CommonSchemaServiceConfig added in v0.438.0

type CommonSchemaServiceConfig struct {
}

type Config added in v0.434.0

type Config struct {
	CommonSchemaServiceConfig
	Bind *url.URL `help:"Socket to bind to." default:"http://127.0.0.1:8897" env:"FTL_BIND"`
}

type EventWrapper added in v0.438.0

type EventWrapper struct {
	Event schema.Event
}

func (EventWrapper) MarshalBinary added in v0.438.0

func (e EventWrapper) MarshalBinary() ([]byte, error)

func (EventWrapper) String added in v0.438.0

func (e EventWrapper) String() string

func (*EventWrapper) UnmarshalBinary added in v0.438.0

func (e *EventWrapper) UnmarshalBinary(bts []byte) error

type SchemaState added in v0.433.2

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

func NewSchemaState added in v0.434.0

func NewSchemaState(validationEnabled bool) SchemaState

func (*SchemaState) ActiveChangeset added in v0.435.0

func (r *SchemaState) ActiveChangeset() optional.Option[*schema.Changeset]

func (SchemaState) ApplyEvent added in v0.434.0

func (r SchemaState) ApplyEvent(ctx context.Context, event schema.Event) error

ApplyEvent applies an event to the schema state

func (*SchemaState) FindDeployment added in v0.435.0

func (r *SchemaState) FindDeployment(deploymentKey key.Deployment) (deployment *schema.Module, changeset optional.Option[key.Changeset], err error)

FindDeployment returns a deployment and which changeset it is in based on the deployment key.

func (*SchemaState) GetAllActiveDeployments added in v0.435.0

func (r *SchemaState) GetAllActiveDeployments() map[key.Deployment]*schema.Module

GetAllActiveDeployments returns all active deployments, including those in changesets that are prepared This includes canary deployments that are not yet committed

func (*SchemaState) GetCanonicalDeploymentSchemas added in v0.435.0

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

func (*SchemaState) GetCanonicalDeployments added in v0.435.0

func (r *SchemaState) GetCanonicalDeployments() map[key.Deployment]*schema.Module

GetCanonicalDeployments returns all active deployments (excluding those in changesets).

func (*SchemaState) GetChangeset added in v0.435.0

func (r *SchemaState) GetChangeset(changeset key.Changeset) (*schema.Changeset, error)

func (*SchemaState) GetChangesets added in v0.435.0

func (r *SchemaState) GetChangesets() map[key.Changeset]*schema.Changeset

func (*SchemaState) GetDeployment added in v0.433.2

func (r *SchemaState) GetDeployment(deployment key.Deployment, changeset optional.Option[key.Changeset]) (*schema.Module, error)

GetDeployment returns a deployment based on the deployment key and changeset.

func (*SchemaState) GetDeployments added in v0.433.2

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

func (*SchemaState) GetProvisioning added in v0.434.0

func (r *SchemaState) GetProvisioning(module string, cs key.Changeset) (*schema.Module, error)

func (*SchemaState) Marshal added in v0.435.0

func (r *SchemaState) Marshal() ([]byte, error)

func (*SchemaState) Unmarshal added in v0.435.0

func (r *SchemaState) Unmarshal(data []byte) error

type Service

type Service struct {
	State  *statemachine.SingleQueryHandle[struct{}, SchemaState, EventWrapper]
	Config Config
}

func New added in v0.434.0

func New(ctx context.Context, handle statemachine.Handle[struct{}, SchemaState, EventWrapper], config Config) *Service

func (*Service) CommitChangeset added in v0.435.0

CommitChangeset makes all deployments for the changeset part of the canonical schema.

func (*Service) CreateChangeset added in v0.435.0

CreateChangeset creates a new changeset.

func (*Service) DrainChangeset added in v0.436.0

func (*Service) FailChangeset added in v0.435.0

FailChangeset fails an active changeset.

func (*Service) FinalizeChangeset added in v0.436.0

func (*Service) GetDeployment added in v0.435.0

func (*Service) GetDeployments added in v0.434.0

func (*Service) Ping

func (*Service) PrepareChangeset added in v0.435.0

PrepareChangeset prepares an active changeset for deployment.

func (*Service) UpdateSchema added in v0.434.0

Jump to

Keyboard shortcuts

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