Documentation
¶
Overview ¶
Package internal manages the persistent profile configuration of the FTL CLI.
Layout will be something like:
.ftl-project/ project.json profiles/ <profile>/ profile.json [secrets.json] [config.json]
See the design document for more information.
Index ¶
- func Init(project Project) error
- type Profile
- type ProfileType
- type Project
- func (p Project) ActiveProfile() (string, error)
- func (p Project) ListProfiles() ([]Profile, error)
- func (p Project) LoadProfile(name string) (Profile, error)
- func (p Project) LocalConfigPath(profile string) string
- func (p Project) LocalSecretsPath(profile string) string
- func (p Project) Save() error
- func (p Project) SaveProfile(profile Profile) error
- func (p Project) SetActiveProfile(profile string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Profile ¶
type Profile struct { Name string `json:"name"` Endpoint string `json:"endpoint"` Type ProfileType `json:"type"` SecretsProvider configuration.ProviderKey `json:"secrets-provider"` ConfigProvider configuration.ProviderKey `json:"config-provider"` }
type ProfileType ¶
type ProfileType string
const ( ProfileTypeLocal ProfileType = "local" ProfileTypeRemote ProfileType = "remote" )
type Project ¶
type Project struct { Realm string `json:"realm"` FTLMinVersion string `json:"ftl-min-version,omitempty"` ModuleRoots []string `json:"module-roots,omitempty"` Git bool `json:"git,omitempty"` Hermit bool `json:"hermit,omitempty"` DefaultProfile string `json:"default-profile,omitempty"` Root string `json:"-"` }
func (Project) ActiveProfile ¶
ActiveProfile returns the name of the active profile.
If no profile is active, it returns the default.
func (Project) ListProfiles ¶
ListProfiles returns the names of all profiles in the project.
func (Project) LocalConfigPath ¶
LocalConfigPath returns the path to the config file for the given local profile.
func (Project) LocalSecretsPath ¶
LocalSecretsPath returns the path to the secrets file for the given local profile.
func (Project) SaveProfile ¶
SaveProfile saves a profile to the project.
func (Project) SetActiveProfile ¶
Click to show internal directories.
Click to hide internal directories.