Documentation
¶
Index ¶
- func EventExtractor(diff tuple.Pair[SchemaState, SchemaState]) iter.Seq[*ftlv1.PullSchemaResponse]
- func NewInMemorySchemaState(ctx context.Context) *statemachine.SingleQueryHandle[struct{}, SchemaState, EventWrapper]
- func Start(ctx context.Context, config Config) error
- type CommonSchemaServiceConfig
- type Config
- type EventWrapper
- type SchemaState
- func (r *SchemaState) ActiveChangeset() optional.Option[*schema.Changeset]
- func (r SchemaState) ApplyEvent(ctx context.Context, event schema.Event) error
- func (r *SchemaState) FindDeployment(deploymentKey key.Deployment) (deployment *schema.Module, changeset optional.Option[key.Changeset], err error)
- func (r *SchemaState) GetAllActiveDeployments() map[key.Deployment]*schema.Module
- func (r *SchemaState) GetCanonicalDeploymentSchemas() []*schema.Module
- func (r *SchemaState) GetCanonicalDeployments() map[key.Deployment]*schema.Module
- func (r *SchemaState) GetChangeset(changeset key.Changeset) (*schema.Changeset, error)
- func (r *SchemaState) GetChangesets() map[key.Changeset]*schema.Changeset
- func (r *SchemaState) GetDeployment(deployment key.Deployment, changeset optional.Option[key.Changeset]) (*schema.Module, error)
- func (r *SchemaState) GetDeployments() map[key.Deployment]*schema.Module
- func (r *SchemaState) GetProvisioning(module string, cs key.Changeset) (*schema.Module, error)
- func (r *SchemaState) Marshal() ([]byte, error)
- func (r *SchemaState) Unmarshal(data []byte) 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(context.Context, *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) UpdateDeploymentRuntime(ctx context.Context, ...) (*connect.Response[ftlv1.UpdateDeploymentRuntimeResponse], error)
- func (s *Service) UpdateSchema(ctx context.Context, req *connect.Request[ftlv1.UpdateSchemaRequest]) (*connect.Response[ftlv1.UpdateSchemaResponse], 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.
func NewInMemorySchemaState ¶ added in v0.433.2
func NewInMemorySchemaState(ctx context.Context) *statemachine.SingleQueryHandle[struct{}, SchemaState, EventWrapper]
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
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
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 (*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 (*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
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(context.Context, *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