Documentation
¶
Overview ¶
Package bootstrap implements the functions, types, and interfaces for the module.
Index ¶
- Constants
- Variables
- func LoadSourceConfig(bootstrap *Bootstrap) (*configv1.SourceConfig, error)
- type Bootstrap
- func (b *Bootstrap) ID() string
- func (b *Bootstrap) Metadata() map[string]string
- func (b *Bootstrap) ServiceID() string
- func (b *Bootstrap) ServiceName() string
- func (b *Bootstrap) SetFlags(name, version string)
- func (b *Bootstrap) StartTime() time.Time
- func (b *Bootstrap) Version() string
- func (b *Bootstrap) WorkPath() string
- type Config
- type Decoder
- type Flags
- type KeyValue
- type Merge
- type Observer
- type Option
- type Reader
- type Resolver
- type Source
- type Value
- type Watcher
Constants ¶
const ( DefaultConfigPath = "configs/config.toml" DefaultEnv = "dev" DefaultWorkDir = "." )
Constants for default paths and environment
Variables ¶
var ( // ErrNotFound defined error from kratos config package ErrNotFound = kratosconfig.ErrNotFound )
Functions ¶
func LoadSourceConfig ¶
func LoadSourceConfig(bootstrap *Bootstrap) (*configv1.SourceConfig, error)
LoadSourceConfig loads the config file from the given path
Types ¶
type Bootstrap ¶
Bootstrap struct to hold bootstrap information
func DefaultBootstrap ¶
func DefaultBootstrap() *Bootstrap
DefaultBootstrap returns a default bootstrap
func (*Bootstrap) ServiceName ¶ added in v0.0.5
ServiceName returns the service name
type Config ¶ added in v0.0.7
type Config = kratosconfig.Config
Define types from kratos config package
type Decoder ¶ added in v0.0.7
type Decoder = kratosconfig.Decoder
Define types from kratos config package
type Flags ¶
type Flags struct {
ID string
Version string
ServiceName string
StartTime time.Time
Metadata map[string]string
}
Flags is a struct that holds the flags for the service
func DefaultFlags ¶
func DefaultFlags() Flags
DefaultFlags returns the default flags for the service
type KeyValue ¶ added in v0.0.7
type KeyValue = kratosconfig.KeyValue
Define types from kratos config package
type Merge ¶ added in v0.0.7
type Merge = kratosconfig.Merge
Define types from kratos config package
type Observer ¶ added in v0.0.7
type Observer = kratosconfig.Observer
Define types from kratos config package
type Option ¶ added in v0.0.7
type Option = kratosconfig.Option
Define types from kratos config package
func WithMergeFunc ¶ added in v0.0.7
WithMergeFunc sets the merge function
func WithResolveActualTypes ¶ added in v0.0.7
WithResolveActualTypes enables resolving actual types
func WithResolver ¶ added in v0.0.7
WithResolver sets the resolver
type Reader ¶ added in v0.0.7
type Reader = kratosconfig.Reader
Define types from kratos config package
type Resolver ¶ added in v0.0.7
type Resolver = kratosconfig.Resolver
Define types from kratos config package
type Source ¶ added in v0.0.7
type Source = kratosconfig.Source
Define types from kratos config package
type Value ¶ added in v0.0.7
type Value = kratosconfig.Value
Define types from kratos config package
type Watcher ¶ added in v0.0.7
type Watcher = kratosconfig.Watcher
Define types from kratos config package