profiles

package
v0.375.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name     string
	Endpoint *url.URL
}

type LocalProfileConfig added in v0.373.0

type LocalProfileConfig struct {
	SecretsProvider configuration.ProviderKey
	ConfigProvider  configuration.ProviderKey
}

type Profile

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

func (*Profile) Config

func (p *Profile) Config() Config

Config is the static configuration for a Profile.

func (*Profile) ConfigurationManager

func (p *Profile) ConfigurationManager() *manager.Manager[configuration.Configuration]

ConfigurationManager returns the configuration manager for this profile.

func (*Profile) ProjectConfig

func (p *Profile) ProjectConfig() ProjectConfig

ProjectConfig is the static project-wide configuration shared by all profiles.

func (*Profile) SecretsManager

func (p *Profile) SecretsManager() *manager.Manager[configuration.Secrets]

SecretsManager returns the secrets manager for this profile.

type ProfileConfig added in v0.373.0

type ProfileConfig struct {
	Name   string
	Config either.Either[LocalProfileConfig, RemoteProfileConfig]
}

func (ProfileConfig) String added in v0.373.0

func (p ProfileConfig) String() string

type Project added in v0.373.0

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

func Init

func Init(
	project ProjectConfig,
	secretsRegistry *providers.Registry[configuration.Secrets],
	configRegistry *providers.Registry[configuration.Configuration],
) (*Project, error)

Init a new project with a default local profile.

If "project.Default" is empty a new project will be created with a default "local" profile.

func Open added in v0.373.0

func Open(
	root string,
	secretsRegistry *providers.Registry[configuration.Secrets],
	configRegistry *providers.Registry[configuration.Configuration],
) (*Project, error)

Open a project.

func (*Project) ActiveProfile added in v0.373.0

func (p *Project) ActiveProfile() (string, error)

ActiveProfile returns the name of the active profile.

If no profile is active, the default profile is returned.

func (*Project) DefaultProfile added in v0.373.0

func (p *Project) DefaultProfile() string

DefaultProfile returns the name of the default profile.

func (*Project) List added in v0.373.0

func (p *Project) List() ([]ProfileConfig, error)

List all profiles in the project.

func (*Project) Load added in v0.373.0

func (p *Project) Load(ctx context.Context, profile string) (Profile, error)

Load a profile from the project.

func (*Project) New added in v0.373.0

func (p *Project) New(profileConfig ProfileConfig) error

New creates a new profile in the project.

func (*Project) SetDefault added in v0.373.0

func (p *Project) SetDefault(profile string) error

SetDefault profile for the project.

func (*Project) Switch added in v0.373.0

func (p *Project) Switch(profile string) error

Switch active profiles.

type ProjectConfig

type ProjectConfig internal.Project

type RemoteProfileConfig added in v0.373.0

type RemoteProfileConfig struct {
	Endpoint *url.URL
}

Directories

Path Synopsis
Package internal manages the persistent profile configuration of the FTL CLI.
Package internal manages the persistent profile configuration of the FTL CLI.

Jump to

Keyboard shortcuts

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