bootstrap

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package bootstrap implements the functions, types, and interfaces for the module.

Index

Constants

View Source
const (
	DefaultConfigPath = "configs/config.toml"
	DefaultEnv        = "dev"
	DefaultWorkDir    = "."
)

Constants for default paths and environment

Variables

This section is empty.

Functions

func LoadRemoteConfig added in v0.0.10

func LoadRemoteConfig(bootstrap *Bootstrap, v any) error

LoadRemoteConfig loads the config file from the given path

func LoadSourceConfig

func LoadSourceConfig(bootstrap *Bootstrap) (*configv1.SourceConfig, error)

LoadSourceConfig loads the config file from the given path

Types

type Bootstrap

type Bootstrap struct {
	Flags      Flags
	WorkDir    string
	ConfigPath string
	Env        string
	Daemon     bool
}

Bootstrap struct to hold bootstrap information

func DefaultBootstrap

func DefaultBootstrap() *Bootstrap

DefaultBootstrap returns a default bootstrap

func New added in v0.0.5

func New(dir, path string) *Bootstrap

New returns a new bootstrap

func (*Bootstrap) ID added in v0.0.5

func (b *Bootstrap) ID() string

ID returns the ID

func (*Bootstrap) Metadata added in v0.0.5

func (b *Bootstrap) Metadata() map[string]string

Metadata returns the metadata

func (*Bootstrap) ServiceID added in v0.0.5

func (b *Bootstrap) ServiceID() string

ServiceID returns the service ID

func (*Bootstrap) ServiceName added in v0.0.5

func (b *Bootstrap) ServiceName() string

ServiceName returns the service name

func (*Bootstrap) SetFlags added in v0.0.5

func (b *Bootstrap) SetFlags(name, version string)

SetFlags sets the flags for the bootstrap

func (*Bootstrap) StartTime added in v0.0.5

func (b *Bootstrap) StartTime() time.Time

StartTime returns the start time

func (*Bootstrap) Version added in v0.0.5

func (b *Bootstrap) Version() string

Version returns the version

func (*Bootstrap) WorkPath added in v0.0.5

func (b *Bootstrap) WorkPath() string

WorkPath returns the work path

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

func NewFlags

func NewFlags(name string, version string) Flags

NewFlags returns a new set of flags for the service

func (Flags) ServiceID

func (f Flags) ServiceID() string

ServiceID returns the ID of the service

Jump to

Keyboard shortcuts

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