node

package
v0.0.0-...-c01aa29 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// API 提供API访问的服务
	APIType = Type("api")
	// Worker 后台作业服务
	NodeType = Type("node")
	// Scheduler 调度器
	SchedulerType = Type("scheduler")
)

Variables

This section is empty.

Functions

func EtcdNodePrefix

func EtcdNodePrefix() string

func EtcdNodePrefixWithType

func EtcdNodePrefixWithType(t Type) string

func NodeObjectKey

func NodeObjectKey(key string) string

Types

type Node

type Node struct {
	Region          string            `json:"region,omitempty"`
	ResourceVersion int64             `json:"resourceVersion,omitempty"`
	InstanceName    string            `json:"instance_name,omitempty"`
	ServiceName     string            `json:"service_name,omitempty"`
	Type            Type              `json:"type,omitempty"`
	Address         string            `json:"address,omitempty"`
	Version         string            `json:"version,omitempty"`
	GitBranch       string            `json:"git_branch,omitempty"`
	GitCommit       string            `json:"git_commit,omitempty"`
	BuildEnv        string            `json:"build_env,omitempty"`
	BuildAt         string            `json:"build_at,omitempty"`
	Online          int64             `json:"online,omitempty"`
	Tag             map[string]string `json:"tag,omitempty"`

	Prefix   string        `json:"-"`
	Interval time.Duration `json:"-"`
	TTL      int64         `json:"-"`
}

Node todo

func LoadNodeFromBytes

func LoadNodeFromBytes(value []byte) (*Node, error)

ParseEtcdNode tdo

func (*Node) IsMatch

func (n *Node) IsMatch(nodeName string) bool

func (*Node) MakeObjectKey

func (n *Node) MakeObjectKey() string

MakeObjectKey 构建etcd对应的key 例如: inforboard/workflow/service/node/node-01

func (*Node) Name

func (n *Node) Name() string

func (*Node) ShortDescribe

func (n *Node) ShortDescribe() string

func (*Node) Validate

func (n *Node) Validate() error

type Register

type Register interface {
	Debug(logger.Logger)
	Registe() error
	UnRegiste() error
}

Register 服务注册接口

type Type

type Type string

func ParseInstanceKey

func ParseInstanceKey(key string) (serviceName, instanceName string, serviceType Type, err error)

ParseInstanceKey 解析key中的服务信息

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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