Documentation
¶
Index ¶
- func EventExtractor(diff tuple.Pair[SchemaState, SchemaState]) iter.Seq[*ftlv1.PullSchemaResponse]
- type CommonSchemaServiceConfig
- type Config
- type EventWrapper
- type NiceSlice
- type SchemaState
- func (r *SchemaState) ActiveChangeset() optional.Option[*schema.Changeset]
- func (r *SchemaState) ApplyEvent(ctx context.Context, event schema.Event) error
- func (r *SchemaState) ApplyEvents(ctx context.Context, events ...schema.Event) error
- func (r *SchemaState) ChangesetEvents(key key.Changeset) []*schema.DeploymentRuntimeEvent
- func (r *SchemaState) DeploymentEvents(module string) []*schema.DeploymentRuntimeEvent
- func (r *SchemaState) FindDeployment(deploymentKey key.Deployment) (deployment *schema.Module, changeset optional.Option[key.Changeset], err error)
- func (r *SchemaState) GetCanonicalDeployments() map[key.Deployment]*schema.Module
- func (r *SchemaState) GetCanonicalRealms() map[string]*schema.Realm
- func (r *SchemaState) GetCanonicalSchema() *schema.Schema
- func (r *SchemaState) GetChangeset(changeset key.Changeset) optional.Option[*schema.Changeset]
- func (r *SchemaState) GetChangesets() map[key.Changeset]*schema.Changeset
- func (r *SchemaState) GetDeployments() map[key.Deployment]*schema.Module
- func (r *SchemaState) Marshal() ([]byte, error)
- func (r *SchemaState) RealmsByName() map[string]*schema.Realm
- func (r *SchemaState) Unmarshal(data []byte) error
- func (r *SchemaState) VerifyEvent(ctx context.Context, event schema.Event) error
- type Service
- func (s *Service) CommitChangeset(ctx context.Context, req *connect.Request[ftlv1.CommitChangesetRequest]) (*connect.Response[ftlv1.CommitChangesetResponse], error)
- func (s *Service) CreateChangeset(ctx context.Context, req *connect.Request[ftlv1.CreateChangesetRequest]) (*connect.Response[ftlv1.CreateChangesetResponse], error)
- func (s *Service) DrainChangeset(ctx context.Context, req *connect.Request[ftlv1.DrainChangesetRequest]) (*connect.Response[ftlv1.DrainChangesetResponse], error)
- func (s *Service) FailChangeset(ctx context.Context, req *connect.Request[ftlv1.FailChangesetRequest]) (*connect.Response[ftlv1.FailChangesetResponse], error)
- func (s *Service) FinalizeChangeset(ctx context.Context, req *connect.Request[ftlv1.FinalizeChangesetRequest]) (*connect.Response[ftlv1.FinalizeChangesetResponse], error)
- func (s *Service) GetDeployment(ctx context.Context, c *connect.Request[ftlv1.GetDeploymentRequest]) (*connect.Response[ftlv1.GetDeploymentResponse], error)
- func (s *Service) GetDeployments(ctx context.Context, req *connect.Request[ftlv1.GetDeploymentsRequest]) (*connect.Response[ftlv1.GetDeploymentsResponse], error)
- func (s *Service) GetSchema(ctx context.Context, c *connect.Request[ftlv1.GetSchemaRequest]) (*connect.Response[ftlv1.GetSchemaResponse], error)
- func (s *Service) Ping(ctx context.Context, req *connect.Request[ftlv1.PingRequest]) (*connect.Response[ftlv1.PingResponse], error)
- func (s *Service) PrepareChangeset(ctx context.Context, req *connect.Request[ftlv1.PrepareChangesetRequest]) (*connect.Response[ftlv1.PrepareChangesetResponse], error)
- func (s *Service) PullSchema(ctx context.Context, req *connect.Request[ftlv1.PullSchemaRequest], ...) error
- func (s *Service) RollbackChangeset(ctx context.Context, req *connect.Request[ftlv1.RollbackChangesetRequest]) (*connect.Response[ftlv1.RollbackChangesetResponse], error)
- func (s *Service) StartServices(context.Context) ([]rpc.Option, error)
- func (s *Service) UpdateDeploymentRuntime(ctx context.Context, ...) (*connect.Response[ftlv1.UpdateDeploymentRuntimeResponse], error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EventExtractor ¶ added in v0.433.2
func EventExtractor(diff tuple.Pair[SchemaState, SchemaState]) iter.Seq[*ftlv1.PullSchemaResponse]
EventExtractor calculates controller events from changes to the state.
Types ¶
type CommonSchemaServiceConfig ¶ added in v0.438.0
type CommonSchemaServiceConfig struct {
}
type Config ¶ added in v0.434.0
type Config struct {
CommonSchemaServiceConfig
Raft raft.RaftConfig `embed:"" prefix:"raft-"`
}
type EventWrapper ¶ added in v0.438.0
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 NiceSlice ¶ added in v0.487.0
type NiceSlice[T any] []T
type SchemaState ¶ added in v0.433.2
type SchemaState struct {
// contains filtered or unexported fields
}
func NewSchemaState ¶ added in v0.434.0
func NewSchemaState(canonicalRealm string) 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
ApplyEvent applies an event to the schema state
func (*SchemaState) ApplyEvents ¶ added in v0.487.0
ApplyEvents applies a list of events to the schema state. events might be partially applied if an error is returned.
func (*SchemaState) ChangesetEvents ¶ added in v0.487.0
func (r *SchemaState) ChangesetEvents(key key.Changeset) []*schema.DeploymentRuntimeEvent
func (*SchemaState) DeploymentEvents ¶ added in v0.487.0
func (r *SchemaState) DeploymentEvents(module string) []*schema.DeploymentRuntimeEvent
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) 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) GetCanonicalRealms ¶ added in v0.477.0
func (r *SchemaState) GetCanonicalRealms() map[string]*schema.Realm
GetCanonicalRealms returns all active realms (excluding those in changesets).
func (*SchemaState) GetCanonicalSchema ¶ added in v0.477.0
func (r *SchemaState) GetCanonicalSchema() *schema.Schema
GetCanonicalSchema returns the canonical schema for the active deployments and realms.
func (*SchemaState) GetChangeset ¶ added in v0.435.0
func (*SchemaState) GetChangesets ¶ added in v0.435.0
func (r *SchemaState) GetChangesets() map[key.Changeset]*schema.Changeset
func (*SchemaState) GetDeployments ¶ added in v0.433.2
func (r *SchemaState) GetDeployments() map[key.Deployment]*schema.Module
func (*SchemaState) Marshal ¶ added in v0.435.0
func (r *SchemaState) Marshal() ([]byte, error)
func (*SchemaState) RealmsByName ¶ added in v0.487.0
func (r *SchemaState) RealmsByName() map[string]*schema.Realm
func (*SchemaState) Unmarshal ¶ added in v0.435.0
func (r *SchemaState) Unmarshal(data []byte) error
func (*SchemaState) VerifyEvent ¶ added in v0.443.0
VerifyEvent verifies an event is valid for the given state, without applying it
type Service ¶
type Service struct {
State *statemachine.SingleQueryHandle[struct{}, SchemaState, EventWrapper]
Config Config
// contains filtered or unexported fields
}
func New ¶ added in v0.434.0
func New( ctx context.Context, config Config, timelineClient *timelineclient.Client, receiverClient optional.Option[ftlv1connect.SchemaMirrorServiceClient], realm string, devMode bool, ) *Service
Start the SchemaService. Blocks until the context is cancelled.
func NewLocalService ¶ added in v0.477.0
func (*Service) CommitChangeset ¶ added in v0.435.0
func (s *Service) CommitChangeset(ctx context.Context, req *connect.Request[ftlv1.CommitChangesetRequest]) (*connect.Response[ftlv1.CommitChangesetResponse], error)
CommitChangeset makes all deployments for the changeset part of the canonical schema.
func (*Service) CreateChangeset ¶ added in v0.435.0
func (s *Service) CreateChangeset(ctx context.Context, req *connect.Request[ftlv1.CreateChangesetRequest]) (*connect.Response[ftlv1.CreateChangesetResponse], error)
CreateChangeset creates a new changeset.
func (*Service) DrainChangeset ¶ added in v0.436.0
func (*Service) FailChangeset ¶ added in v0.435.0
func (s *Service) FailChangeset(ctx context.Context, req *connect.Request[ftlv1.FailChangesetRequest]) (*connect.Response[ftlv1.FailChangesetResponse], error)
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) PrepareChangeset ¶ added in v0.435.0
func (s *Service) PrepareChangeset(ctx context.Context, req *connect.Request[ftlv1.PrepareChangesetRequest]) (*connect.Response[ftlv1.PrepareChangesetResponse], error)
PrepareChangeset prepares an active changeset for deployment.
func (*Service) PullSchema ¶
func (s *Service) PullSchema(ctx context.Context, req *connect.Request[ftlv1.PullSchemaRequest], stream *connect.ServerStream[ftlv1.PullSchemaResponse]) error