bootstrapspec

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
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

type Arg struct {
	Kind  string
	Ref   string
	Value string
	Input *InputDef
}

func APIArg

func APIArg(ref string) Arg

APIArg creates API component description.

func ContextArg

func ContextArg() Arg

ContextArg configures context argument binding.

func InputArg

func InputArg(ref string) Arg

InputArg configures component input binding.

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

func InputArgFrom(def InputDef) Arg

InputArgFrom configures component input binding.

func Literal

func Literal(value string) Arg

Literal wraps a literal argument value.

func RepoArg

func RepoArg(ref string) Arg

RepoArg creates repository component description.

func SecretArg

func SecretArg(ref string) Arg

SecretArg configures secret argument binding.

func StepArg

func StepArg(ref string) Arg

StepArg creates step component description.

func URLArg

func URLArg(ref string) Arg

URLArg creates URL component description.

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
}

func API

func API(id string, constructor any, args ...Arg) Component

API creates API component description.

func APIAs

func APIAs(id, field string, constructor any, args ...Arg) Component

APIAs creates API component description.

func Repo

func Repo(id string, constructor any, args ...Arg) Component

Repo creates repository component description.

func RepoAs

func RepoAs(id, field string, constructor any, args ...Arg) Component

RepoAs creates repository component description.

func Step

func Step(id string, constructor any, args ...Arg) Component

Step creates step component description.

func StepAs

func StepAs(id, field string, constructor any, args ...Arg) Component

StepAs creates step component description.

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

type InputOption func(*InputDef) error

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 Manifest struct {
	APIs   []Component
	Repos  []Component
	Steps  []Component
	URLs   []URLDef
	Inputs []InputDef
}

func (Manifest) Validate

func (m Manifest) Validate() error

Validate validates input and returns an error on failure.

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 Requires

type Requires struct {
	APIs    []string
	Repos   []string
	Steps   []string
	URLs    []string
	Secrets []string
}

type StructArg

type StructArg struct {
	Type       string
	TypeName   string
	TypePrefix string
	TypeImport string
	IsPointer  bool
	Fields     []StructFieldArg
}

type StructFieldArg

type StructFieldArg struct {
	Field string
	Arg   Arg
}

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.

type URLDef

type URLDef struct {
	ID     string
	Field  string
	Prefix string
	// contains filtered or unexported fields
}

func URL

func URL(id string, opts ...URLOption) URLDef

URL creates URL component description.

func URLAs

func URLAs(id, field string, opts ...URLOption) URLDef

URLAs creates URL component description.

func URLWithField

func URLWithField(id, field string, opts ...URLOption) URLDef

URLWithField creates URL component description.

type URLOption

type URLOption func(*URLDef) error

func WithURLPrefix

func WithURLPrefix(prefix string) URLOption

WithURLPrefix applies an additional option to the builder.

Jump to

Keyboard shortcuts

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