model

package
v0.5.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigFormatToml       ConfigFormat = "toml"
	ConfigFormatYaml                    = "yaml"
	ConfigFormatJson                    = "json"
	ConfigFormatXml                     = "xml"
	ConfigFormatProperties              = "properties"
	ConfigFormatIni                     = "ini"
)
View Source
const (
	ConfigLanguageGo   ConfigLanguage = "go"
	ConfigLanguageJava                = "java"
	ConfigLanguagePHP                 = "php"
	ConfigLanguageLua                 = "lua"
)
View Source
const (
	ItemStatusPub    ItemStatus = 1
	ItemStatusNew               = 2
	ItemStatusUpdate            = 3
	ItemStatusDel               = 4
)
View Source
const (
	ItemLogStatusNew      ItemLogStatus = 1
	ItemLogStatusUpdate                 = 2
	ItemLogStatusDel                    = 3
	ItemLogStatusPublish                = 4
	ItemLogStatusRollback               = 5
)
View Source
const (
	// /wsd-reg/main/providers/grpc://127.0.0.1:18090
	ProviderV1GrpcKeyName = "grpc:%s:v1:"
	ProviderV1HttpKeyName = "http:%s:v1:"

	ProviderV2GovernKeyName = "/prometheus/job/%s"
	ProviderV2GrpcKeyName   = "/wsd-reg/%s/providers/grpc://"
	ProviderV2HttpKeyName   = "/wsd-reg/%s/providers/http://"

	ConfiguratorsKeyName     = "/wsd-reg/%s/configurators/"
	ConfiguratorsGrpcKeyName = "/wsd-reg/%s/configurators/grpc:///"
	ConfiguratorsHttpKeyName = "/wsd-reg/%s/configurators/http:///"
)

Variables

This section is empty.

Functions

func Init

func Init(configPath string) error

func InitDefault

func InitDefault() error

Types

type AggregationInfo added in v0.4.3

type AggregationInfo struct {
	Ip      string `json:"ip"`
	Type    string `json:"type"` // govern,grpc,http
	Port    string `json:"port"`
	Address string `json:"address"`
	RegKey  string `json:"regKey"`
	Labels  struct {
		Enable      string `json:"enable"`
		Env         string `json:"env"`
		Group       string `json:"group"`
		Hostname    string `json:"hostname"`
		Region      string `json:"region"`
		UpTimestamp string `json:"startTs"` // 启动时间
		VcsInfo     string `json:"vcsInfo"`
		Weight      string `json:"weight"`
		Zone        string `json:"zone"`
	} `json:"labels"`
}

type AggregationRegister added in v0.4.3

type AggregationRegister struct {
	Provider      ProviderEtcdInfo      `json:"provider"`
	Configurators ConfiguratorsEtcdInfo `json:"configurators"`
	Aggregation   AggregationInfo       `json:"aggregation"`
}

type ConfigFormat

type ConfigFormat string

ConfigFormat 配置文件类型

type ConfigInfo added in v0.4.3

type ConfigInfo struct {
	RegisterKey
	// contains filtered or unexported fields
}

func (*ConfigInfo) Enable added in v0.4.3

func (k *ConfigInfo) Enable() string

func (*ConfigInfo) Group added in v0.4.3

func (k *ConfigInfo) Group() string

func (*ConfigInfo) ParseValue added in v0.4.3

func (k *ConfigInfo) ParseValue(bs []byte) (err error)

func (*ConfigInfo) Value added in v0.4.3

func (k *ConfigInfo) Value() []byte

func (*ConfigInfo) Weight added in v0.4.3

func (k *ConfigInfo) Weight() string

type ConfigLanguage

type ConfigLanguage string

ConfigLanguage 配置文件语言客户端

type ConfiguratorsEtcdInfo added in v0.4.3

type ConfiguratorsEtcdInfo struct {
	RawValue string `json:"rawValue"` // 检验数据
	RegKey   string `json:"regKey"`
	Type     string `json:"type"` // govern,grpc,http
	Ip       string `json:"ip"`
	Port     string `json:"port"`
	Address  string `json:"address"`
	Labels   struct {
		Enable   string `json:"enable"`
		Env      string `json:"env"`
		Group    string `json:"group"`
		Hostname string `json:"hostname"`
		Weight   string `json:"weight"`
	} `json:"labels"`
}

治理的configurators信息

type GoDepProject

type GoDepProject struct {
	Name     string   `toml:"name"`
	Branch   string   `toml:"branch"`
	Revision string   `toml:"revision"`
	Version  string   `toml:"version"`
	Packages []string `toml:"packages"`
}

type GomodProject

type GomodProject struct {
	Name        string
	Version     string
	ModType     string
	Time        string
	Revision    string
	OriginValue string
	UpdateTime  int64
}

type ItemLogStatus

type ItemLogStatus int

ItemLogStatus 配置项状态 1 新增 2 更新 3 删除 4 发布 5 回滚

type ItemStatus

type ItemStatus int

ItemStatus 配置项状态 1 已发布 2 新增 3 更新 4 删除

type PkgDep

type PkgDep struct {
	Projects []GoDepProject `toml:"projects"`
}

type ProviderEtcdInfo added in v0.4.3

type ProviderEtcdInfo struct {
	RawValue string `json:"rawValue"` // 检验数据
	Type     string `json:"type"`     // govern,grpc,http
	Ip       string `json:"ip"`
	Port     string `json:"port"`
	Address  string `json:"address"`
	RegKey   string `json:"regKey"`
	Enable   bool   `json:"enable"`
	Labels   struct {
		Enable      string `json:"enable"`
		Env         string `json:"env"`
		Group       string `json:"group"`
		Hostname    string `json:"hostname"`
		Region      string `json:"region"`
		UpTimestamp string `json:"startTs"` // 启动时间
		VcsInfo     string `json:"vcsInfo"`
		Weight      string `json:"weight"`
		Zone        string `json:"zone"`
	} `json:"labels"`
}

治理的provider信息

func (*ProviderEtcdInfo) ParseToProviderV1 added in v0.4.3

func (p *ProviderEtcdInfo) ParseToProviderV1(key string) (err error)

grpc:main:v1:lvchao/10.117.22.137:18090

type ProviderInfo added in v0.4.3

type ProviderInfo struct {
	RegisterKey
	Meta registerServerMeta // 注册的数据结构
}

func (*ProviderInfo) Enable added in v0.4.3

func (k *ProviderInfo) Enable() string

func (*ProviderInfo) Group added in v0.4.3

func (k *ProviderInfo) Group() string

func (*ProviderInfo) ParseValue added in v0.4.3

func (k *ProviderInfo) ParseValue(bs []byte, isJupApp bool) (err error)

func (*ProviderInfo) Region added in v0.4.3

func (k *ProviderInfo) Region() string

func (*ProviderInfo) Value added in v0.4.3

func (k *ProviderInfo) Value() []byte

func (*ProviderInfo) Weight added in v0.4.3

func (k *ProviderInfo) Weight() string

func (*ProviderInfo) Zone added in v0.4.3

func (k *ProviderInfo) Zone() string

type ProviderMetaData added in v0.4.3

type ProviderMetaData struct {
	Name       string                        `json:"name"`
	AppId      string                        `json:"appId"`
	Scheme     string                        `json:"schema"`
	Address    string                        `json:"address"`
	Weight     int                           `json:"weight"`
	Enable     bool                          `json:"enable"`
	Healthy    bool                          `json:"healthy"`
	Region     string                        `json:"region"`
	Zone       string                        `json:"zone"`
	Kind       int                           `json:"kind"`
	Deployment string                        `json:"deployment"`
	Group      string                        `json:"group"`
	Services   map[string]registerOneService `json:"services"`
	Metadata   struct {
		AppHost        string `json:"appHost"`
		AppMode        string `json:"appMode"`
		AppVersion     string `json:"appVersion"`
		BuildTime      string `json:"buildTime"`
		JupiterVersion string `json:"jupiterVersion"`
		StartTime      string `json:"startTime"`
	} `json:"metadata"`
}

type RegisterEtcdInfo added in v0.4.3

type RegisterEtcdInfo struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

查询etcd里的数据

type RegisterKey added in v0.4.3

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

注册key

func (RegisterKey) Address added in v0.4.3

func (k RegisterKey) Address() string

func (RegisterKey) AppName added in v0.4.3

func (k RegisterKey) AppName() string

func (RegisterKey) IP added in v0.4.3

func (k RegisterKey) IP() string

func (RegisterKey) Port added in v0.4.3

func (k RegisterKey) Port() string

func (RegisterKey) Scheme added in v0.4.3

func (k RegisterKey) Scheme() string

func (RegisterKey) String added in v0.4.3

func (k RegisterKey) String() string

func (RegisterKey) Type added in v0.4.3

func (k RegisterKey) Type() TypeRecord

type RegisterKeyInterface added in v0.4.3

type RegisterKeyInterface interface {
	String() string
	AppName() string
	Type() TypeRecord
	Scheme() string
	Address() string
}

注册key 包括提供者,消费者,配置等

func NewRegisterKey added in v0.4.3

func NewRegisterKey(b []byte) (k RegisterKeyInterface, err error)

type RegisterRawMessageEtcdInfo added in v0.4.3

type RegisterRawMessageEtcdInfo struct {
	Key   string          `json:"key"`
	Value json.RawMessage `json:"value"`
}

type TypeRecord added in v0.4.3

type TypeRecord string
const (
	TypeRecordProviders     TypeRecord = "providers"
	TypeRecordConfigurators TypeRecord = "configurators"
	TypeRecordConsumers     TypeRecord = "consumers"
	TypeRecordRouters       TypeRecord = "routers"
)

func (TypeRecord) String added in v0.4.3

func (t TypeRecord) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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