Documentation
¶
Index ¶
- Variables
- func EnvsOrDefault(devHost *schema.DevHost, workspace *schema.Workspace) []*schema.Workspace_EnvironmentSpec
- func GetMultiple[V proto.Message](config Configuration) ([]V, error)
- func IsValidConfigType(msg *anypb.Any) bool
- func LookupConfigMessage(name protoreflect.FullName) protoreflect.MessageType
- func RegisterConfigurationProvider[V proto.Message](handle func(V) ([]proto.Message, error), aliases ...string)
- func Seal()
- func SetupFlags(flags *pflag.FlagSet)
- type ConfigType
- type Configuration
- type ConfigurationSlice
- type Context
- type RootContext
- type Workspace
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultWorkspaceEnvironments = []*schema.Workspace_EnvironmentSpec{ { Name: "dev", Runtime: "kubernetes", Purpose: schema.Environment_DEVELOPMENT, }, { Name: "staging", Runtime: "kubernetes", Purpose: schema.Environment_PRODUCTION, }, { Name: "prod", Runtime: "kubernetes", Purpose: schema.Environment_PRODUCTION, }, } )
Functions ¶
func EnvsOrDefault ¶
func GetMultiple ¶
func GetMultiple[V proto.Message](config Configuration) ([]V, error)
func IsValidConfigType ¶
func LookupConfigMessage ¶
func LookupConfigMessage(name protoreflect.FullName) protoreflect.MessageType
func SetupFlags ¶ added in v0.0.405
Types ¶
type ConfigType ¶
func DefineConfigType ¶
func DefineConfigType[V proto.Message](aliases ...string) ConfigType[V]
func (ConfigType[V]) CheckGet ¶
func (ct ConfigType[V]) CheckGet(cfg Configuration) (V, bool)
func (ConfigType[V]) CheckGetForPlatform ¶
func (ct ConfigType[V]) CheckGetForPlatform(cfg Configuration, target specs.Platform) (V, bool)
type Configuration ¶
type Configuration interface {
Derive(string, func(ConfigurationSlice) ConfigurationSlice) Configuration
// When the configuration is loaded pinned to an environment, returns the
// environment name. Else, the return value is undefined. This value MUST
// NOT be used as an authoritative cache key.
EnvKey() string
Workspace() Workspace
// contains filtered or unexported methods
}
func MakeConfigurationCompat ¶
func MakeConfigurationCompat(errorloc fnerrors.Location, ws Workspace, devHost *schema.DevHost, env *schema.Environment) (Configuration, error)
func MakeConfigurationWith ¶
func MakeConfigurationWith(description string, ws Workspace, merged ConfigurationSlice) Configuration
type ConfigurationSlice ¶
type ConfigurationSlice struct {
Configuration []*anypb.Any
PlatformConfiguration []*schema.DevHost_ConfigurePlatform
}
type Context ¶
type Context interface {
fnerrors.Location
Workspace() Workspace
Configuration() Configuration
Environment() *schema.Environment
}
func LoadContext ¶
func LoadContext(parent RootContext, name string) (Context, error)
func MakeUnverifiedContext ¶
func MakeUnverifiedContext(config Configuration, env *schema.Environment) Context
type RootContext ¶
type Workspace ¶
type Workspace interface {
fnerrors.Location
Proto() *schema.Workspace
ModuleName() string
ReadOnlyFS(rel ...string) fs.FS
LoadedFrom() *schema.Workspace_LoadedFrom
}
func MakeSyntheticWorkspace ¶ added in v0.0.84
func MakeSyntheticWorkspace(proto *schema.Workspace, lf *schema.Workspace_LoadedFrom) Workspace
Source Files
¶
Click to show internal directories.
Click to hide internal directories.