kernel

package
v0.0.0-...-d28bcca Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddLoader

func AddLoader(loader func(cmder ConfigureCmder, args *ConfigureArgs))

func GetConfigureIns

func GetConfigureIns() *configureCmderImpl

func GetDockerLoaders

func GetDockerLoaders() []func(serviceRegister DockerServiceRegister, info *DockerInfo)

func GetDockerService

func GetDockerService() *dockerServiceRegisterImpl

func GetLoaders

func GetLoaders() []func(cmder ConfigureCmder, args *ConfigureArgs)

func InvokerConfigureService

func InvokerConfigureService(file string, prefix string, excludes []string, endpoints string, timeout int64) *configureCmderImpl

func InvokerDockerService

func InvokerDockerService(dockerHosts []string, service string, lists bool, query string, endpoints string, timeout int64) *dockerServiceRegisterImpl

func NewCdnDomain

func NewCdnDomain() *cdnDomain

func RegisterLoader

func RegisterLoader(loader func(serviceRegister DockerServiceRegister, info *DockerInfo))

Types

type Args

type Args struct {
	K string
	V interface{}
}

Args args

type ConfigureArgs

type ConfigureArgs struct {
	File     string   // 配置文件
	Prefix   string   // 配置前缀
	Excludes []string // 排除
	EtcdCnf  Etcd     // etcd 配置
}

ConfigureArgs 配置逻辑参数

func (*ConfigureArgs) Boot

func (this *ConfigureArgs) Boot()

type ConfigureCmder

type ConfigureCmder interface {
	Init() ConfigureCmder
	Boot()
	Exec() error
	Loader(loaders ...func(cmder ConfigureCmder, args *ConfigureArgs))
}

type DbMgr

type DbMgr struct {
	// contains filtered or unexported fields
}

func GetDbMgr

func GetDbMgr() *DbMgr

func (*DbMgr) GetDb

func (dbMgr *DbMgr) GetDb(name ...string) *mgo.Session

type DockerInfo

type DockerInfo struct {
	Hosts     *HostInfo
	CmderArgs map[string]interface{}
	// contains filtered or unexported fields
}

DockerInfo docker 注册信息

func NewDockerInfo

func NewDockerInfo() *DockerInfo

func (*DockerInfo) Init

func (this *DockerInfo) Init(handlers ...func(data *EntryArr, info *HostInfo))

type DockerServiceRegister

type DockerServiceRegister interface {
	Get(name string) string
	Host(name string) string
	DelService(serName string)
	Register(host string, args ...Args)
	CreateService(host string, serName string)
	Query(args Args) (map[string]string, error)
	Loader(loaders ...func(serviceRegister DockerServiceRegister, info *DockerInfo))
	Exec() error
}

DockerServiceRegister docker 服务自动发信

type Entry

type Entry struct {
	Key   string
	Value string
}

Entry 配置键

type EntryArr

type EntryArr []*Entry

func (EntryArr) Get

func (this EntryArr) Get(key string, defaults string) string

func (EntryArr) GetInt

func (this EntryArr) GetInt(key string, defaults int) int

type Etcd

type Etcd struct {
	clientv3.Config
}

Etcd etcd 配置

func (Etcd) Row

func (this Etcd) Row() clientv3.Config

type HostInfo

type HostInfo struct {
	HostName string
	Ipv4     string
	Ipv6     string
	Port     int
	Status   State
}

HostInfo host 信息

func NewHostInfo

func NewHostInfo() *HostInfo

func (*HostInfo) GetIp

func (this *HostInfo) GetIp() string

func (*HostInfo) GetPort

func (this *HostInfo) GetPort() string

type State

type State int

State 状态值

const (
	Off            State = -1 // 不可用
	Unknown        State = 0  // 未知
	On             State = 1  // 可用
	FlagDockerHost       = "docker_host"
	FlagService          = "service"
)

Jump to

Keyboard shortcuts

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