bootstrap

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvName = "Env"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EnvInfo

type EnvInfo struct {
	kunit.Unit
	env.Env
	env.LogConfig
	env.Config
}

环境

func Env

func Env() *EnvInfo

Env 获取实例

func (*EnvInfo) IsExist

func (e *EnvInfo) IsExist(name string) bool

func (*EnvInfo) IsToml

func (e *EnvInfo) IsToml(name string) bool

func (*EnvInfo) IsValidFile

func (e *EnvInfo) IsValidFile(name string) (string, kerr.Error)

func (*EnvInfo) ParseTOML

func (e *EnvInfo) ParseTOML(name string) (*gcfg.Config, kerr.Error)

ParseTOML 解析配置文件

func (*EnvInfo) Path

func (e *EnvInfo) Path(name string) string

func (*EnvInfo) SetVersion

func (e *EnvInfo) SetVersion(version string) *EnvInfo

func (*EnvInfo) Setup

func (e *EnvInfo) Setup(ctx kctx.Context) kerr.Error

初始化环境

type Load

type Load struct {
	kunit.Unit
}

Load 加载器

func LoadInstance

func LoadInstance() *Load

LoadInstance

func (*Load) PrintError

func (l *Load) PrintError(ctx kctx.Context, step Step, err error)

func (*Load) PrintSuccess

func (l *Load) PrintSuccess(ctx kctx.Context, step Step)

func (*Load) Run

func (l *Load) Run(ctx kctx.Context) error

func (*Load) Setup

func (l *Load) Setup(ctx kctx.Context) kerr.Error

Setup

type Step

type Step struct {
	kunit.Unit
	// contains filtered or unexported fields
}

Step 步骤

func NewStep

func NewStep(name string, s func(ctx kctx.Context) kerr.Error) Step

NewStep 创建步骤

func (Step) Run

func (s Step) Run(ctx kctx.Context) error

Run 运行步骤

Jump to

Keyboard shortcuts

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