bootstrap

package module
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2025 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Service = utils.NewServiceInfo(
		"",
		"1.0.0",
		"",
	)
)

Functions

func Bootstrap

func Bootstrap(initApp InitApp, serviceName, version *string)

Bootstrap 应用引导启动

func DoBootstrap

func DoBootstrap(serviceInfo *utils.ServiceInfo) (*conf.Bootstrap, log.Logger, kratosRegistry.Registrar)

DoBootstrap 执行引导

func GetBootstrapConfig added in v0.0.17

func GetBootstrapConfig() *conf.Bootstrap

func LoadBootstrapConfig added in v0.0.17

func LoadBootstrapConfig(configPath string) error

LoadBootstrapConfig 加载程序引导配置

func LoadRemoteConfigSourceConfigs added in v0.0.17

func LoadRemoteConfigSourceConfigs(configPath string) (error, *conf.RemoteConfig)

LoadRemoteConfigSourceConfigs 加载远程配置源的本地配置

func NewApp

func NewApp(ll log.Logger, rr kratosRegistry.Registrar, srv ...transport.Server) *kratos.App

NewApp 创建应用程序

func NewConfigProvider added in v0.0.17

func NewConfigProvider(configPath string) config.Config

NewConfigProvider 创建一个配置

func NewDiscovery added in v0.0.17

func NewDiscovery(cfg *conf.Registry) kRegistry.Discovery

NewDiscovery 创建一个发现客户端

func NewFileConfigSource added in v0.0.17

func NewFileConfigSource(filePath string) config.Source

NewFileConfigSource 创建一个本地文件配置源

func NewRegistry added in v0.0.17

func NewRegistry(cfg *conf.Registry) kRegistry.Registrar

NewRegistry 创建一个注册客户端

func NewRemoteConfigSource added in v0.0.17

func NewRemoteConfigSource(c *conf.RemoteConfig) config.Source

NewRemoteConfigSource 创建一个远程配置源

func RegisterConfig added in v0.0.17

func RegisterConfig(c interface{})

RegisterConfig 注册配置

Types

type CommandFlags added in v0.0.17

type CommandFlags struct {
	Conf       string // 引导配置文件路径,默认为:../../configs
	Env        string // 开发环境:dev、debug……
	ConfigHost string // 远程配置服务端地址
	ConfigType string // 远程配置服务端类型
	Daemon     bool   // 是否转为守护进程
}

CommandFlags 命令传参

func NewCommandFlags added in v0.0.17

func NewCommandFlags() *CommandFlags

func (*CommandFlags) Init added in v0.0.17

func (f *CommandFlags) Init()

type InitApp

type InitApp func(logger log.Logger, registrar kratosRegistry.Registrar, bootstrap *conf.Bootstrap) (*kratos.App, func(), error)

type Type added in v0.0.17

type Type string
const (
	LocalFile  Type = "file"
	Nacos      Type = "nacos"
	Consul     Type = "consul"
	Etcd       Type = "etcd"
	Apollo     Type = "apollo"
	Kubernetes Type = "kubernetes"
	Polaris    Type = "polaris"
)

Jump to

Keyboard shortcuts

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