cluster

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package cluster GENERATED BY gengo:enum DON'T EDIT THIS FILE

Package cluster GENERATED BY gengo:runtimedoc DON'T EDIT THIS FILE

Package cluster GENERATED BY gengo:table DON'T EDIT THIS FILE

Index

Constants

This section is empty.

Variables

View Source
var ClusterT = &tableCluster{
	ID:              github_com_octohelm_storage_pkg_sqlbuilder.CastCol[ID](github_com_octohelm_storage_pkg_sqlbuilder.TableFromModel(&Cluster{}).F("ID")),
	Name:            github_com_octohelm_storage_pkg_sqlbuilder.CastCol[string](github_com_octohelm_storage_pkg_sqlbuilder.TableFromModel(&Cluster{}).F("Name")),
	Desc:            github_com_octohelm_storage_pkg_sqlbuilder.CastCol[string](github_com_octohelm_storage_pkg_sqlbuilder.TableFromModel(&Cluster{}).F("Desc")),
	EnvType:         github_com_octohelm_storage_pkg_sqlbuilder.CastCol[EnvType](github_com_octohelm_storage_pkg_sqlbuilder.TableFromModel(&Cluster{}).F("EnvType")),
	AgentInfo:       github_com_octohelm_storage_pkg_sqlbuilder.CastCol[AgentInfo](github_com_octohelm_storage_pkg_sqlbuilder.TableFromModel(&Cluster{}).F("AgentInfo")),
	AgentSecureInfo: github_com_octohelm_storage_pkg_sqlbuilder.CastCol[AgentSecureInfo](github_com_octohelm_storage_pkg_sqlbuilder.TableFromModel(&Cluster{}).F("AgentSecureInfo")),
	NetType:         github_com_octohelm_storage_pkg_sqlbuilder.CastCol[NetType](github_com_octohelm_storage_pkg_sqlbuilder.TableFromModel(&Cluster{}).F("NetType")),
	Endpoint:        github_com_octohelm_storage_pkg_sqlbuilder.CastCol[string](github_com_octohelm_storage_pkg_sqlbuilder.TableFromModel(&Cluster{}).F("Endpoint")),
	CreatedAt:       github_com_octohelm_storage_pkg_sqlbuilder.CastCol[github_com_octohelm_storage_pkg_datatypes.Timestamp](github_com_octohelm_storage_pkg_sqlbuilder.TableFromModel(&Cluster{}).F("CreatedAt")),
	UpdatedAt:       github_com_octohelm_storage_pkg_sqlbuilder.CastCol[github_com_octohelm_storage_pkg_datatypes.Timestamp](github_com_octohelm_storage_pkg_sqlbuilder.TableFromModel(&Cluster{}).F("UpdatedAt")),
	DeletedAt:       github_com_octohelm_storage_pkg_sqlbuilder.CastCol[github_com_octohelm_storage_pkg_datatypes.Timestamp](github_com_octohelm_storage_pkg_sqlbuilder.TableFromModel(&Cluster{}).F("DeletedAt")),

	I: indexNameOfCluster{
		Primary: github_com_octohelm_storage_pkg_sqlbuilder.TableFromModel(&Cluster{}).Cols([]string{
			"ID",
			"DeletedAt",
		}...),
		IName: github_com_octohelm_storage_pkg_sqlbuilder.TableFromModel(&Cluster{}).Cols([]string{
			"Name",
		}...),
	},
	table: github_com_octohelm_storage_pkg_sqlbuilder.TableFromModel(&Cluster{}),
}
View Source
var InvalidEnvType = github_com_pkg_errors.New("invalid EnvType")
View Source
var InvalidNetType = github_com_pkg_errors.New("invalid NetType")
View Source
var InvalidStatus = github_com_pkg_errors.New("invalid Status")

Functions

This section is empty.

Types

type AgentInfo added in v0.5.4

type AgentInfo struct {
	Endpoint string            `json:"endpoint,omitempty"`
	Labels   map[string]string `json:"labels,omitempty"`
}

func (AgentInfo) DataType added in v0.5.4

func (AgentInfo) DataType(driverName string) string

func (AgentInfo) RuntimeDoc added in v0.5.4

func (v AgentInfo) RuntimeDoc(names ...string) ([]string, bool)

func (*AgentInfo) Scan added in v0.5.4

func (a *AgentInfo) Scan(src any) error

func (AgentInfo) Value added in v0.5.4

type AgentSecureInfo added in v0.5.4

type AgentSecureInfo struct {
	OtpKeyURL string `json:"otpKeyURL,omitempty"`
}

func (AgentSecureInfo) DataType added in v0.5.4

func (AgentSecureInfo) DataType(driverName string) string

func (AgentSecureInfo) RuntimeDoc added in v0.5.4

func (v AgentSecureInfo) RuntimeDoc(names ...string) ([]string, bool)

func (*AgentSecureInfo) Scan added in v0.5.4

func (a *AgentSecureInfo) Scan(src any) error

func (AgentSecureInfo) Value added in v0.5.4

type Cluster

type Cluster struct {
	// 集群 ID
	ID ID `db:"f_cluster_id" json:"clusterID"`
	// 集群名称
	Name string `db:"f_cluster_name" json:"name"`

	Info

	AgentInfo AgentInfo `db:"f_agent_info,default=''" json:"agentInfo,omitempty"`

	AgentSecureInfo AgentSecureInfo `db:"f_agent_secure_info,default=''" json:"-"`

	// 网络环境
	// validate: string(required(),oneOf(['DIRECT','AIRGAP']))
	NetType NetType `db:"f_net_type,default='1'" json:"netType"`

	// Deprecated Agent 地址
	// validate: when('netType',is('DIRECT'),then(string(required())))
	Endpoint string `db:"f_endpoint,default=''" json:"-"`

	datatypes.CreationUpdationDeletionTime
}

+gengo:table:register=T +gengo:table:group=cluster

@def primary ID DeletedAt @def unique_index i_name Name @def index i_created_at CreatedAt @def index i_updated_at UpdatedAt

func (Cluster) Primary

func (Cluster) Primary() []string

func (Cluster) RuntimeDoc

func (v Cluster) RuntimeDoc(names ...string) ([]string, bool)

func (Cluster) TableName

func (Cluster) TableName() string

type EnvType

type EnvType uint8

+gengo:enum

const (
	ENV_TYPE_UNKNOWN EnvType = iota
	ENV_TYPE__DEV            // 开发集群
	ENV_TYPE__ONLINE         // 生产集群
)

func ParseEnvTypeFromString

func ParseEnvTypeFromString(s string) (EnvType, error)

func ParseEnvTypeLabelString

func ParseEnvTypeLabelString(label string) (EnvType, error)

func (EnvType) EnumValues

func (EnvType) EnumValues() []any

func (EnvType) Label

func (v EnvType) Label() string

func (EnvType) MarshalText

func (v EnvType) MarshalText() ([]byte, error)

func (EnvType) RuntimeDoc

func (EnvType) RuntimeDoc(names ...string) ([]string, bool)

func (*EnvType) Scan

func (v *EnvType) Scan(src any) error

func (EnvType) String

func (v EnvType) String() string

func (*EnvType) UnmarshalText

func (v *EnvType) UnmarshalText(data []byte) error

func (EnvType) Value

func (v EnvType) Value() (database_sql_driver.Value, error)

type ID

type ID uint64

func (ID) MarshalText

func (id ID) MarshalText() (text []byte, err error)

func (ID) RuntimeDoc

func (ID) RuntimeDoc(names ...string) ([]string, bool)

func (ID) String

func (id ID) String() string

func (*ID) UnmarshalText

func (id *ID) UnmarshalText(text []byte) error

type Info

type Info struct {
	// 集群描述
	Desc string `db:"f_desc,default=''" json:"desc,omitempty"`
	// 集群环境类型
	EnvType EnvType `db:"f_env_type,default='1'" json:"envType"`
}

func (Info) RuntimeDoc

func (v Info) RuntimeDoc(names ...string) ([]string, bool)

type InstanceStatus

type InstanceStatus struct {
	clusterinfo.ClusterInfo
	Ping strfmt.Duration `json:"ping,omitempty"`
}

func (InstanceStatus) RuntimeDoc

func (v InstanceStatus) RuntimeDoc(names ...string) ([]string, bool)

type NetType

type NetType uint8

+gengo:enum

const (
	NET_TYPE_UNKNOWN NetType = iota
	NET_TYPE__DIRECT         // 可直连
	NET_TYPE__AIRGAP         // 离线
)

func ParseNetTypeFromString

func ParseNetTypeFromString(s string) (NetType, error)

func ParseNetTypeLabelString

func ParseNetTypeLabelString(label string) (NetType, error)

func (NetType) EnumValues

func (NetType) EnumValues() []any

func (NetType) Label

func (v NetType) Label() string

func (NetType) MarshalText

func (v NetType) MarshalText() ([]byte, error)

func (NetType) RuntimeDoc

func (NetType) RuntimeDoc(names ...string) ([]string, bool)

func (*NetType) Scan

func (v *NetType) Scan(src any) error

func (NetType) String

func (v NetType) String() string

func (*NetType) UnmarshalText

func (v *NetType) UnmarshalText(data []byte) error

func (NetType) Value

func (v NetType) Value() (database_sql_driver.Value, error)

type Status

type Status uint8

+gengo:enum

const (
	STATUS_UNKNOWN   Status = iota
	STATUS__ENABLED         // 可用
	STATUS__DISABLED        // 不可用
)

func ParseStatusFromString

func ParseStatusFromString(s string) (Status, error)

func ParseStatusLabelString

func ParseStatusLabelString(label string) (Status, error)

func (Status) EnumValues

func (Status) EnumValues() []any

func (Status) Label

func (v Status) Label() string

func (Status) MarshalText

func (v Status) MarshalText() ([]byte, error)

func (Status) RuntimeDoc

func (Status) RuntimeDoc(names ...string) ([]string, bool)

func (*Status) Scan

func (v *Status) Scan(src any) error

func (Status) String

func (v Status) String() string

func (*Status) UnmarshalText

func (v *Status) UnmarshalText(data []byte) error

func (Status) Value

func (v Status) Value() (database_sql_driver.Value, error)

Directories

Path Synopsis
Package repository GENERATED BY gengo:runtimedoc DON'T EDIT THIS FILE
Package repository GENERATED BY gengo:runtimedoc DON'T EDIT THIS FILE
Package service GENERATED BY gengo:runtimedoc DON'T EDIT THIS FILE
Package service GENERATED BY gengo:runtimedoc DON'T EDIT THIS FILE

Jump to

Keyboard shortcuts

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