Help us shape the future of Go! Take the 2026 Go Developer Survey

admin

package
v0.510.3 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2025 License: Apache-2.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShouldUseLocalClient

func ShouldUseLocalClient(ctx context.Context, adminClient adminpbconnect.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.

Types

type Config

type Config struct {
	ArtefactChunkSize int `help:"Size of each chunk streamed to the client." default:"1048576"`
}

type EnvironmentClient added in v0.448.0

type EnvironmentClient interface {
	// List configuration.
	ConfigList(ctx context.Context, req *connect.Request[adminpb.ConfigListRequest]) (*connect.Response[adminpb.ConfigListResponse], error)

	// Get a config value.
	ConfigGet(ctx context.Context, req *connect.Request[adminpb.ConfigGetRequest]) (*connect.Response[adminpb.ConfigGetResponse], error)

	// Set a config value.
	ConfigSet(ctx context.Context, req *connect.Request[adminpb.ConfigSetRequest]) (*connect.Response[adminpb.ConfigSetResponse], error)

	// Unset a config value.
	ConfigUnset(ctx context.Context, req *connect.Request[adminpb.ConfigUnsetRequest]) (*connect.Response[adminpb.ConfigUnsetResponse], error)

	// List secrets.
	SecretsList(ctx context.Context, req *connect.Request[adminpb.SecretsListRequest]) (*connect.Response[adminpb.SecretsListResponse], error)

	// Get a secret.
	SecretGet(ctx context.Context, req *connect.Request[adminpb.SecretGetRequest]) (*connect.Response[adminpb.SecretGetResponse], error)

	// Set a secret.
	SecretSet(ctx context.Context, req *connect.Request[adminpb.SecretSetRequest]) (*connect.Response[adminpb.SecretSetResponse], error)

	// Unset a secret.
	SecretUnset(ctx context.Context, req *connect.Request[adminpb.SecretUnsetRequest]) (*connect.Response[adminpb.SecretUnsetResponse], error)

	// MapConfigsForModule combines all configuration values visible to the module.
	// Local values take precedence.
	MapConfigsForModule(ctx context.Context, req *connect.Request[adminpb.MapConfigsForModuleRequest]) (*connect.Response[adminpb.MapConfigsForModuleResponse], error)

	// MapSecretsForModule combines all secrets visible to the module.
	// Local values take precedence.
	MapSecretsForModule(ctx context.Context, req *connect.Request[adminpb.MapSecretsForModuleRequest]) (*connect.Response[adminpb.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

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 (*EnvironmentManager) ConfigGet added in v0.448.0

ConfigGet returns the configuration value for a given ref string.

func (*EnvironmentManager) ConfigList added in v0.448.0

ConfigList returns the list of configuration values, optionally filtered by module.

func (*EnvironmentManager) ConfigSet added in v0.448.0

ConfigSet sets the configuration at the given ref to the provided value.

func (*EnvironmentManager) ConfigUnset added in v0.448.0

ConfigUnset unsets the config value at the given ref.

func (*EnvironmentManager) GetSchema added in v0.448.0

func (*EnvironmentManager) MapConfigsForModule added in v0.448.0

MapConfigsForModule combines all configuration values visible to the module.

func (*EnvironmentManager) MapSecretsForModule added in v0.448.0

MapSecretsForModule combines all secrets visible to the module.

func (*EnvironmentManager) SecretGet added in v0.448.0

SecretGet returns the secret value for a given ref string.

func (*EnvironmentManager) SecretSet added in v0.448.0

SecretSet sets the secret at the given ref to the provided value.

func (*EnvironmentManager) SecretUnset added in v0.448.0

SecretUnset unsets the secret value at the given ref.

func (*EnvironmentManager) SecretsList added in v0.448.0

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

func NewOnceValue[T any]() *OnceValue[T]

func (*OnceValue[T]) Get added in v0.448.0

func (o *OnceValue[T]) Get(ctx context.Context) (T, bool)

func (*OnceValue[T]) Set added in v0.448.0

func (o *OnceValue[T]) Set(value T)

type SchemaClient added in v0.448.0

type SchemaClient interface {
	GetSchema(ctx context.Context) (*schema.Schema, error)
}

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

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) Call added in v0.448.0

func (*Service) ClusterInfo added in v0.448.0

func (*Service) ConfigGet added in v0.448.0

ConfigGet returns the configuration value for a given ref string.

func (*Service) ConfigList added in v0.448.0

ConfigList returns the list of configuration values, optionally filtered by module.

func (*Service) ConfigSet added in v0.448.0

ConfigSet sets the configuration at the given ref to the provided value.

func (*Service) ConfigUnset added in v0.448.0

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) GetSchema added in v0.448.0

func (*Service) GetSubscriptionInfo added in v0.471.0

func (*Service) GetTopicInfo added in v0.471.0

func (*Service) MapConfigsForModule added in v0.448.0

MapConfigsForModule combines all configuration values visible to the module.

func (*Service) MapSecretsForModule added in v0.448.0

MapSecretsForModule combines all secrets visible to the module.

func (*Service) Ping added in v0.448.0

func (*Service) PullSchema added in v0.448.0

func (*Service) ResetSubscription added in v0.448.0

func (*Service) RollbackChangeset added in v0.448.0

func (*Service) SecretGet added in v0.448.0

SecretGet returns the secret value for a given ref string.

func (*Service) SecretSet added in v0.448.0

SecretSet sets the secret at the given ref to the provided value.

func (*Service) SecretUnset added in v0.448.0

SecretUnset unsets the secret value at the given ref.

func (*Service) SecretsList added in v0.448.0

SecretsList returns the list of secrets, optionally filtered by module.

func (*Service) StartServices added in v0.477.0

func (s *Service) StartServices(context.Context) ([]rpc.Option, error)

func (*Service) StreamLogs added in v0.465.0

func (*Service) UploadArtefact added in v0.448.0

Jump to

Keyboard shortcuts

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