Documentation
¶
Index ¶
- func ShouldUseLocalClient(ctx context.Context, adminClient ftlv1connect.AdminServiceClient, ...) (bool, error)
- func Start(ctx context.Context, config Config, ...) error
- type Config
- type EnvironmentClient
- type EnvironmentManager
- func (s *EnvironmentManager) ConfigGet(ctx context.Context, req *connect.Request[ftlv1.ConfigGetRequest]) (*connect.Response[ftlv1.ConfigGetResponse], error)
- func (s *EnvironmentManager) ConfigList(ctx context.Context, req *connect.Request[ftlv1.ConfigListRequest]) (*connect.Response[ftlv1.ConfigListResponse], error)
- func (s *EnvironmentManager) ConfigSet(ctx context.Context, req *connect.Request[ftlv1.ConfigSetRequest]) (*connect.Response[ftlv1.ConfigSetResponse], error)
- func (s *EnvironmentManager) ConfigUnset(ctx context.Context, req *connect.Request[ftlv1.ConfigUnsetRequest]) (*connect.Response[ftlv1.ConfigUnsetResponse], error)
- func (s *EnvironmentManager) GetSchema(ctx context.Context, c *connect.Request[ftlv1.GetSchemaRequest]) (*connect.Response[ftlv1.GetSchemaResponse], error)
- func (s *EnvironmentManager) MapConfigsForModule(ctx context.Context, req *connect.Request[ftlv1.MapConfigsForModuleRequest]) (*connect.Response[ftlv1.MapConfigsForModuleResponse], error)
- func (s *EnvironmentManager) MapSecretsForModule(ctx context.Context, req *connect.Request[ftlv1.MapSecretsForModuleRequest]) (*connect.Response[ftlv1.MapSecretsForModuleResponse], error)
- func (s *EnvironmentManager) SecretGet(ctx context.Context, req *connect.Request[ftlv1.SecretGetRequest]) (*connect.Response[ftlv1.SecretGetResponse], error)
- func (s *EnvironmentManager) SecretSet(ctx context.Context, req *connect.Request[ftlv1.SecretSetRequest]) (*connect.Response[ftlv1.SecretSetResponse], error)
- func (s *EnvironmentManager) SecretUnset(ctx context.Context, req *connect.Request[ftlv1.SecretUnsetRequest]) (*connect.Response[ftlv1.SecretUnsetResponse], error)
- func (s *EnvironmentManager) SecretsList(ctx context.Context, req *connect.Request[ftlv1.SecretsListRequest]) (*connect.Response[ftlv1.SecretsListResponse], error)
- type OnceValue
- type SchemaClient
- type Service
- func (s *Service) ApplyChangeset(ctx context.Context, req *connect.Request[ftlv1.ApplyChangesetRequest]) (*connect.Response[ftlv1.ApplyChangesetResponse], error)
- func (s *Service) Call(ctx context.Context, req *connect.Request[ftlv1.CallRequest]) (*connect.Response[ftlv1.CallResponse], error)
- func (s *Service) ClusterInfo(ctx context.Context, req *connect.Request[ftlv1.ClusterInfoRequest]) (*connect.Response[ftlv1.ClusterInfoResponse], error)
- func (s *Service) ConfigGet(ctx context.Context, req *connect.Request[ftlv1.ConfigGetRequest]) (*connect.Response[ftlv1.ConfigGetResponse], error)
- func (s *Service) ConfigList(ctx context.Context, req *connect.Request[ftlv1.ConfigListRequest]) (*connect.Response[ftlv1.ConfigListResponse], error)
- func (s *Service) ConfigSet(ctx context.Context, req *connect.Request[ftlv1.ConfigSetRequest]) (*connect.Response[ftlv1.ConfigSetResponse], error)
- func (s *Service) ConfigUnset(ctx context.Context, req *connect.Request[ftlv1.ConfigUnsetRequest]) (*connect.Response[ftlv1.ConfigUnsetResponse], error)
- func (s *Service) FailChangeset(ctx context.Context, c *connect.Request[ftlv1.FailChangesetRequest]) (*connect.Response[ftlv1.FailChangesetResponse], error)
- func (s *Service) GetArtefactDiffs(ctx context.Context, req *connect.Request[ftlv1.GetArtefactDiffsRequest]) (*connect.Response[ftlv1.GetArtefactDiffsResponse], error)
- func (s *Service) GetDeploymentArtefacts(ctx context.Context, req *connect.Request[ftlv1.GetDeploymentArtefactsRequest], ...) error
- func (s *Service) GetSchema(ctx context.Context, c *connect.Request[ftlv1.GetSchemaRequest]) (*connect.Response[ftlv1.GetSchemaResponse], error)
- func (s *Service) MapConfigsForModule(ctx context.Context, req *connect.Request[ftlv1.MapConfigsForModuleRequest]) (*connect.Response[ftlv1.MapConfigsForModuleResponse], error)
- func (s *Service) MapSecretsForModule(ctx context.Context, req *connect.Request[ftlv1.MapSecretsForModuleRequest]) (*connect.Response[ftlv1.MapSecretsForModuleResponse], error)
- func (s *Service) Ping(ctx context.Context, req *connect.Request[ftlv1.PingRequest]) (*connect.Response[ftlv1.PingResponse], error)
- func (s *Service) PullSchema(ctx context.Context, req *connect.Request[ftlv1.PullSchemaRequest], ...) error
- func (s *Service) ResetSubscription(ctx context.Context, req *connect.Request[ftlv1.ResetSubscriptionRequest]) (*connect.Response[ftlv1.ResetSubscriptionResponse], error)
- func (s *Service) RollbackChangeset(ctx context.Context, c *connect.Request[ftlv1.RollbackChangesetRequest]) (*connect.Response[ftlv1.RollbackChangesetResponse], error)
- func (s *Service) SecretGet(ctx context.Context, req *connect.Request[ftlv1.SecretGetRequest]) (*connect.Response[ftlv1.SecretGetResponse], error)
- func (s *Service) SecretSet(ctx context.Context, req *connect.Request[ftlv1.SecretSetRequest]) (*connect.Response[ftlv1.SecretSetResponse], error)
- func (s *Service) SecretUnset(ctx context.Context, req *connect.Request[ftlv1.SecretUnsetRequest]) (*connect.Response[ftlv1.SecretUnsetResponse], error)
- func (s *Service) SecretsList(ctx context.Context, req *connect.Request[ftlv1.SecretsListRequest]) (*connect.Response[ftlv1.SecretsListResponse], error)
- func (s *Service) UploadArtefact(ctx context.Context, stream *connect.ClientStream[ftlv1.UploadArtefactRequest]) (*connect.Response[ftlv1.UploadArtefactResponse], error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ShouldUseLocalClient ¶
func ShouldUseLocalClient(ctx context.Context, adminClient ftlv1connect.AdminServiceClient, endpoint *url.URL) (bool, error)
ShouldUseLocalClient returns whether a local admin client should be used based on the admin service client and the endpoint.
If the service is not present AND endpoint is local, then a local client should be used so that the user does not need to spin up a cluster just to run the `ftl config/secret` commands.
If true is returned, use NewLocalClient() to create a local client after setting up config and secret managers for the context.
func Start ¶
func Start( ctx context.Context, config Config, cm *manager.Manager[configuration.Configuration], sm *manager.Manager[configuration.Secrets], schr ftlv1connect.SchemaServiceClient, source *schemaeventsource.EventSource, timelineClient *timelineclient.Client, storage *artefacts.OCIArtefactService, waitFor []string) error
Types ¶
type EnvironmentClient ¶ added in v0.448.0
type EnvironmentClient interface { // List configuration. ConfigList(ctx context.Context, req *connect.Request[ftlv1.ConfigListRequest]) (*connect.Response[ftlv1.ConfigListResponse], error) // Get a config value. ConfigGet(ctx context.Context, req *connect.Request[ftlv1.ConfigGetRequest]) (*connect.Response[ftlv1.ConfigGetResponse], error) // Set a config value. ConfigSet(ctx context.Context, req *connect.Request[ftlv1.ConfigSetRequest]) (*connect.Response[ftlv1.ConfigSetResponse], error) // Unset a config value. ConfigUnset(ctx context.Context, req *connect.Request[ftlv1.ConfigUnsetRequest]) (*connect.Response[ftlv1.ConfigUnsetResponse], error) // List secrets. SecretsList(ctx context.Context, req *connect.Request[ftlv1.SecretsListRequest]) (*connect.Response[ftlv1.SecretsListResponse], error) // Get a secret. SecretGet(ctx context.Context, req *connect.Request[ftlv1.SecretGetRequest]) (*connect.Response[ftlv1.SecretGetResponse], error) // Set a secret. SecretSet(ctx context.Context, req *connect.Request[ftlv1.SecretSetRequest]) (*connect.Response[ftlv1.SecretSetResponse], error) // Unset a secret. SecretUnset(ctx context.Context, req *connect.Request[ftlv1.SecretUnsetRequest]) (*connect.Response[ftlv1.SecretUnsetResponse], error) // MapConfigsForModule combines all configuration values visible to the module. // Local values take precedence. MapConfigsForModule(ctx context.Context, req *connect.Request[ftlv1.MapConfigsForModuleRequest]) (*connect.Response[ftlv1.MapConfigsForModuleResponse], error) // MapSecretsForModule combines all secrets visible to the module. // Local values take precedence. MapSecretsForModule(ctx context.Context, req *connect.Request[ftlv1.MapSecretsForModuleRequest]) (*connect.Response[ftlv1.MapSecretsForModuleResponse], error) // Get the full schema. GetSchema(ctx context.Context, req *connect.Request[ftlv1.GetSchemaRequest]) (*connect.Response[ftlv1.GetSchemaResponse], error) }
EnvironmentClient standardizes an common interface between the Service as accessed via gRPC and a purely-local variant that doesn't require a running controller to access.
func NewLocalClient ¶
func NewLocalClient(cm *manager.Manager[cf.Configuration], sm *manager.Manager[cf.Secrets]) EnvironmentClient
NewLocalClient creates a admin client that reads and writes from the provided config and secret managers
type EnvironmentManager ¶ added in v0.448.0
type EnvironmentManager struct {
// contains filtered or unexported fields
}
EnvironmentManager is a client that reads and writes secrets and config entries
func NewEnvironmentClient ¶ added in v0.448.0
func NewEnvironmentClient(cm *manager.Manager[configuration.Configuration], sm *manager.Manager[configuration.Secrets], schr SchemaClient) *EnvironmentManager
func (*EnvironmentManager) ConfigGet ¶ added in v0.448.0
func (s *EnvironmentManager) ConfigGet(ctx context.Context, req *connect.Request[ftlv1.ConfigGetRequest]) (*connect.Response[ftlv1.ConfigGetResponse], error)
ConfigGet returns the configuration value for a given ref string.
func (*EnvironmentManager) ConfigList ¶ added in v0.448.0
func (s *EnvironmentManager) ConfigList(ctx context.Context, req *connect.Request[ftlv1.ConfigListRequest]) (*connect.Response[ftlv1.ConfigListResponse], error)
ConfigList returns the list of configuration values, optionally filtered by module.
func (*EnvironmentManager) ConfigSet ¶ added in v0.448.0
func (s *EnvironmentManager) ConfigSet(ctx context.Context, req *connect.Request[ftlv1.ConfigSetRequest]) (*connect.Response[ftlv1.ConfigSetResponse], error)
ConfigSet sets the configuration at the given ref to the provided value.
func (*EnvironmentManager) ConfigUnset ¶ added in v0.448.0
func (s *EnvironmentManager) ConfigUnset(ctx context.Context, req *connect.Request[ftlv1.ConfigUnsetRequest]) (*connect.Response[ftlv1.ConfigUnsetResponse], error)
ConfigUnset unsets the config value at the given ref.
func (*EnvironmentManager) GetSchema ¶ added in v0.448.0
func (s *EnvironmentManager) GetSchema(ctx context.Context, c *connect.Request[ftlv1.GetSchemaRequest]) (*connect.Response[ftlv1.GetSchemaResponse], error)
func (*EnvironmentManager) MapConfigsForModule ¶ added in v0.448.0
func (s *EnvironmentManager) MapConfigsForModule(ctx context.Context, req *connect.Request[ftlv1.MapConfigsForModuleRequest]) (*connect.Response[ftlv1.MapConfigsForModuleResponse], error)
MapConfigsForModule combines all configuration values visible to the module.
func (*EnvironmentManager) MapSecretsForModule ¶ added in v0.448.0
func (s *EnvironmentManager) MapSecretsForModule(ctx context.Context, req *connect.Request[ftlv1.MapSecretsForModuleRequest]) (*connect.Response[ftlv1.MapSecretsForModuleResponse], error)
MapSecretsForModule combines all secrets visible to the module.
func (*EnvironmentManager) SecretGet ¶ added in v0.448.0
func (s *EnvironmentManager) SecretGet(ctx context.Context, req *connect.Request[ftlv1.SecretGetRequest]) (*connect.Response[ftlv1.SecretGetResponse], error)
SecretGet returns the secret value for a given ref string.
func (*EnvironmentManager) SecretSet ¶ added in v0.448.0
func (s *EnvironmentManager) SecretSet(ctx context.Context, req *connect.Request[ftlv1.SecretSetRequest]) (*connect.Response[ftlv1.SecretSetResponse], error)
SecretSet sets the secret at the given ref to the provided value.
func (*EnvironmentManager) SecretUnset ¶ added in v0.448.0
func (s *EnvironmentManager) SecretUnset(ctx context.Context, req *connect.Request[ftlv1.SecretUnsetRequest]) (*connect.Response[ftlv1.SecretUnsetResponse], error)
SecretUnset unsets the secret value at the given ref.
func (*EnvironmentManager) SecretsList ¶ added in v0.448.0
func (s *EnvironmentManager) SecretsList(ctx context.Context, req *connect.Request[ftlv1.SecretsListRequest]) (*connect.Response[ftlv1.SecretsListResponse], error)
SecretsList returns the list of secrets, optionally filtered by module.
type OnceValue ¶ added in v0.448.0
type OnceValue[T any] struct { // contains filtered or unexported fields }
func NewOnceValue ¶ added in v0.448.0
type SchemaClient ¶ added in v0.448.0
func NewSchemaRetriever ¶ added in v0.448.0
func NewSchemaRetriever(source *schemaeventsource.EventSource) SchemaClient
type Service ¶ added in v0.448.0
type Service struct {
// contains filtered or unexported fields
}
func NewAdminService ¶
func NewAdminService(config Config, env *EnvironmentManager, schr ftlv1connect.SchemaServiceClient, source *schemaeventsource.EventSource, storage *artefacts.OCIArtefactService, routes *routing.VerbCallRouter, waitFor []string) *Service
NewAdminService creates a new Service. bindAllocator is optional and should be set if a local client is to be used that accesses schema from disk using language plugins.
func (*Service) ApplyChangeset ¶ added in v0.448.0
func (*Service) ClusterInfo ¶ added in v0.448.0
func (*Service) ConfigGet ¶ added in v0.448.0
func (s *Service) ConfigGet(ctx context.Context, req *connect.Request[ftlv1.ConfigGetRequest]) (*connect.Response[ftlv1.ConfigGetResponse], error)
ConfigGet returns the configuration value for a given ref string.
func (*Service) ConfigList ¶ added in v0.448.0
func (s *Service) ConfigList(ctx context.Context, req *connect.Request[ftlv1.ConfigListRequest]) (*connect.Response[ftlv1.ConfigListResponse], error)
ConfigList returns the list of configuration values, optionally filtered by module.
func (*Service) ConfigSet ¶ added in v0.448.0
func (s *Service) ConfigSet(ctx context.Context, req *connect.Request[ftlv1.ConfigSetRequest]) (*connect.Response[ftlv1.ConfigSetResponse], error)
ConfigSet sets the configuration at the given ref to the provided value.
func (*Service) ConfigUnset ¶ added in v0.448.0
func (s *Service) ConfigUnset(ctx context.Context, req *connect.Request[ftlv1.ConfigUnsetRequest]) (*connect.Response[ftlv1.ConfigUnsetResponse], error)
ConfigUnset unsets the config value at the given ref.
func (*Service) FailChangeset ¶ added in v0.448.0
func (*Service) GetArtefactDiffs ¶ added in v0.448.0
func (*Service) GetDeploymentArtefacts ¶ added in v0.448.0
func (s *Service) GetDeploymentArtefacts(ctx context.Context, req *connect.Request[ftlv1.GetDeploymentArtefactsRequest], resp *connect.ServerStream[ftlv1.GetDeploymentArtefactsResponse]) error
func (*Service) MapConfigsForModule ¶ added in v0.448.0
func (s *Service) MapConfigsForModule(ctx context.Context, req *connect.Request[ftlv1.MapConfigsForModuleRequest]) (*connect.Response[ftlv1.MapConfigsForModuleResponse], error)
MapConfigsForModule combines all configuration values visible to the module.
func (*Service) MapSecretsForModule ¶ added in v0.448.0
func (s *Service) MapSecretsForModule(ctx context.Context, req *connect.Request[ftlv1.MapSecretsForModuleRequest]) (*connect.Response[ftlv1.MapSecretsForModuleResponse], error)
MapSecretsForModule combines all secrets visible to the module.
func (*Service) PullSchema ¶ added in v0.448.0
func (s *Service) PullSchema(ctx context.Context, req *connect.Request[ftlv1.PullSchemaRequest], resp *connect.ServerStream[ftlv1.PullSchemaResponse]) error
func (*Service) ResetSubscription ¶ added in v0.448.0
func (*Service) RollbackChangeset ¶ added in v0.448.0
func (*Service) SecretGet ¶ added in v0.448.0
func (s *Service) SecretGet(ctx context.Context, req *connect.Request[ftlv1.SecretGetRequest]) (*connect.Response[ftlv1.SecretGetResponse], error)
SecretGet returns the secret value for a given ref string.
func (*Service) SecretSet ¶ added in v0.448.0
func (s *Service) SecretSet(ctx context.Context, req *connect.Request[ftlv1.SecretSetRequest]) (*connect.Response[ftlv1.SecretSetResponse], error)
SecretSet sets the secret at the given ref to the provided value.
func (*Service) SecretUnset ¶ added in v0.448.0
func (s *Service) SecretUnset(ctx context.Context, req *connect.Request[ftlv1.SecretUnsetRequest]) (*connect.Response[ftlv1.SecretUnsetResponse], error)
SecretUnset unsets the secret value at the given ref.
func (*Service) SecretsList ¶ added in v0.448.0
func (s *Service) SecretsList(ctx context.Context, req *connect.Request[ftlv1.SecretsListRequest]) (*connect.Response[ftlv1.SecretsListResponse], error)
SecretsList returns the list of secrets, optionally filtered by module.
func (*Service) UploadArtefact ¶ added in v0.448.0
func (s *Service) UploadArtefact(ctx context.Context, stream *connect.ClientStream[ftlv1.UploadArtefactRequest]) (*connect.Response[ftlv1.UploadArtefactResponse], error)