Documentation
¶
Index ¶
- Constants
- type Arg
- func APIArg(ref string) Arg
- func ContextArg() Arg
- func InputArg(ref string) Arg
- func InputArgDef(id string, prototype any, opts ...InputOption) Arg
- func InputArgDefAs(id, field string, prototype any, opts ...InputOption) Arg
- func InputArgDefAuto(prototype any, opts ...InputOption) Arg
- func InputArgFrom(def InputDef) Arg
- func Literal(value string) Arg
- func RepoArg(ref string) Arg
- func SecretArg(ref string) Arg
- func StepArg(ref string) Arg
- func URLArg(ref string) Arg
- type Component
- func API(id string, constructor any, args ...Arg) Component
- func APIAs(id, field string, constructor any, args ...Arg) Component
- func Repo(id string, constructor any, args ...Arg) Component
- func RepoAs(id, field string, constructor any, args ...Arg) Component
- func Step(id string, constructor any, args ...Arg) Component
- func StepAs(id, field string, constructor any, args ...Arg) Component
- type InputDef
- type InputOption
- type Manifest
- type PostgresEnv
- type Requires
- type StructArg
- type StructFieldArg
- type TokenEnv
- type URLBaseEnv
- type URLDef
- type URLOption
Constants ¶
const ( ArgLiteral = "literal" ArgURL = "url" ArgSecret = "secret" ArgAPI = "api" ArgRepo = "repo" ArgStep = "step" ArgContext = "context" ArgInput = "input" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Arg ¶
func InputArgDef ¶
func InputArgDef(id string, prototype any, opts ...InputOption) Arg
InputArgDef configures component input binding.
func InputArgDefAs ¶
func InputArgDefAs(id, field string, prototype any, opts ...InputOption) Arg
InputArgDefAs configures component input binding.
func InputArgDefAuto ¶
func InputArgDefAuto(prototype any, opts ...InputOption) Arg
InputArgDefAuto configures component input binding.
func InputArgFrom ¶
InputArgFrom configures component input binding.
type Component ¶
type Component struct {
ID string
Field string
Type string
TypeName string
TypePrefix string
TypeImport string
Constructor string
CtorName string
CtorImport string
Args []Arg
Struct *StructArg
Requires Requires
// contains filtered or unexported fields
}
type InputDef ¶
type InputDef struct {
ID string
Field string
Type string
TypeName string
TypePrefix string
TypeImport string
Prefix string
EnvType string
EnvTypeName string
EnvTypePrefix string
EnvTypeImport string
Mapper string
MapperName string
MapperImport string
MapperWithContext bool
Loader string
LoaderName string
LoaderImport string
LoaderWithContext bool
// contains filtered or unexported fields
}
func Input ¶
func Input(id string, prototype any, opts ...InputOption) InputDef
Input configures component input binding.
func InputWithField ¶
func InputWithField(id, field string, prototype any, opts ...InputOption) InputDef
InputWithField configures component input binding.
type InputOption ¶
func WithEnvPreset ¶
func WithEnvPreset(preset any) InputOption
WithEnvPreset applies an additional option to the builder.
func WithEnvPresetMapper ¶
func WithEnvPresetMapper(preset, mapper any) InputOption
WithEnvPresetMapper applies an additional option to the builder.
func WithInputPrefix ¶
func WithInputPrefix(prefix string) InputOption
WithInputPrefix applies an additional option to the builder.
func WithLoader ¶
func WithLoader(loader any) InputOption
WithLoader applies an additional option to the builder.
type Manifest ¶
type PostgresEnv ¶
type PostgresEnv struct {
Host string `envconfig:"POSTGRES_HOST" required:"true" default:"demo.local"`
Port int `envconfig:"POSTGRES_PORT" required:"true" default:"5432"`
User string `envconfig:"POSTGRES_USER" required:"true" default:"demo"`
Password string `envconfig:"POSTGRES_PASSWORD" required:"true" default:"demo"`
DBName string `envconfig:"POSTGRES_DBNAME" required:"true" default:"demo"`
}
PostgresEnv is a built-in env preset for PostgreSQL-like configs. Prefix is provided via WithInputPrefix / WithEnvPreset* options.
type StructFieldArg ¶
type TokenEnv ¶
type TokenEnv struct {
Token string `envconfig:"TOKEN" required:"true"`
}
TokenEnv is a built-in env preset for TOKEN.
type URLBaseEnv ¶
type URLBaseEnv struct {
URL string `envconfig:"BASE_URL" required:"true"`
}
URLBaseEnv is a built-in env preset for BASE_URL.