sysconf

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NodeTypeMaster  = "master"
	NodeTypeLB      = "lb"
	NodeTypeApp     = "app"
	NodeTypePublic  = "public"
	NodeTypePrivate = "private"
)
View Source
const (
	RootUser = "root"
)

Variables

This section is empty.

Functions

func CleanDiceTag

func CleanDiceTag(s, t string) string

func IsDNSName

func IsDNSName(s string) bool

func IsDiceTags

func IsDiceTags(s string) bool

func IsPort

func IsPort(i int) bool

Types

type Cluster

type Cluster struct {
	Name            string   `json:"name"`
	Type            string   `json:"type"` // dcos, k8s
	Nameservers     []string `json:"nameservers"`
	ContainerSubnet string   `json:"containerSubnet"`
	VirtualSubnet   string   `json:"virtualSubnet"`
	MasterVIP       string   `json:"masterVIP,omitempty"`
	Offline         bool     `json:"offline"`
}

Cluster 集群配置

func (Cluster) Host

func (c Cluster) Host(serviceName string) string

Addr 返回服务的内部访问地址

type Docker

type Docker struct {
	DataRoot  string `json:"dataRoot"`
	ExecRoot  string `json:"execRoot"`
	BIP       string `json:"bip"`
	FixedCIDR string `json:"fixedCIDR"`
}

Docker Docker 配置

type FPS

type FPS struct {
	Host  string `json:"host"`
	Port  int    `json:"port"`
	Proxy bool   `json:"proxy"`
}

FPS 文件代理服务器配置

func (FPS) Addr

func (x FPS) Addr() string

Addr 返回 FPS 完整地址

type Gluster

type Gluster struct {
	Version string   `json:"version"`
	Hosts   []string `json:"hosts"`
	Server  bool     `json:"server"`
	Replica int      `json:"replica"`
	Brick   string   `json:"brick"`
}

Gluster GlusterFS 配置

type MySQL

type MySQL struct {
	Host      string `json:"host,omitempty"`
	Port      int    `json:"port,omitempty"`
	Username  string `json:"username,omitempty"`
	Password  string `json:"password,omitempty"`
	DiceDB    string `json:"diceDB,omitempty"`
	PandoraDB string `json:"pandoraDB,omitempty"`
	SonarDB   string `json:"sonarDB,omitempty"`
}

MySQL 平台数据库配置

type Node

type Node struct {
	IP   string `json:"ip"`
	Type string `json:"type"` // master, lb, app
	Tag  string `json:"tag"`
}

Node 节点配置

type Nodes

type Nodes []Node

Nodes 节点列表

func (Nodes) Filter

func (a Nodes) Filter(t string) (b Nodes)

Filter 返回指定类型的所有节点

func (Nodes) Len

func (a Nodes) Len() int

func (Nodes) Less

func (a Nodes) Less(i, j int) bool

func (Nodes) Master

func (a Nodes) Master() Node

Master 返回第一个 master 节点

func (Nodes) Swap

func (a Nodes) Swap(i, j int)

type OpenVPN

type OpenVPN struct {
	PeerSubnet string   `json:"peerSubnet,omitempty"`
	Subnets    []string `json:"subnets,omitempty"`
	ConfigOPVN string   `json:"configOPVN,omitempty"`
}

OpenVPN 平台 VPN 配置

type Platform

type Platform struct {
	Environment    string            `json:"environment,omitempty"`
	WildcardDomain string            `json:"wildcardDomain"`
	AssignDomains  map[string]string `json:"assignDomains"`
	AssignNodes    map[string]string `json:"assignNodes,omitempty"`
	MySQL          MySQL             `json:"mysql,omitempty"`
	AcceptMaster   bool              `json:"acceptMaster,omitempty"`
	AcceptLB       bool              `json:"acceptLB,omitempty"`
	DataDiskDevice string            `json:"dataDiskDevice,omitempty"`
	DataRoot       string            `json:"dataRoot,omitempty"`
	Scheme         string            `json:"scheme"`
	Port           int               `json:"port"`
	RegistryHost   string            `json:"registryHost,omitempty"`
	OpenVPN        OpenVPN           `json:"openvpn,omitempty"`
}

Platform 平台配置

func (*Platform) Domain

func (p *Platform) Domain(serviceName string) string

Domain 返回服务的第一个域名

func (*Platform) Domains

func (p *Platform) Domains(serviceName string) string

Domains 返回服务的全部域名

func (*Platform) PublicURL

func (p *Platform) PublicURL(serviceName string) string

PublicURL 返回服务的外部访问链接

type SSH

type SSH struct {
	Port       int    `json:"port"`
	User       string `json:"user"`
	Password   string `json:"password,omitempty"`
	Account    string `json:"account"`
	PrivateKey string `json:"privateKey,omitempty"`
	PublicKey  string `json:"publicKey,omitempty"`
}

SSH 远程登录配置

type Storage

type Storage struct {
	MountPoint     string  `json:"mountPoint"`
	NAS            string  `json:"nas"`
	Gluster        Gluster `json:"gluster"`
	GittarDataPath string  `json:"gittarDataPath"`
}

Storage 共享存储配置

func (Storage) RemoteTarget

func (s Storage) RemoteTarget() string

type Sysconf

type Sysconf struct {
	Cluster      Cluster           `json:"cluster"`
	SSH          SSH               `json:"ssh"`
	FPS          FPS               `json:"fps"`
	Storage      Storage           `json:"storage"`
	Docker       Docker            `json:"docker"`
	Nodes        Nodes             `json:"nodes"`
	NewNodes     Nodes             `json:"-"` // TODO
	Platform     Platform          `json:"platform"`
	MainPlatform *Platform         `json:"mainPlatform,omitempty"`
	Envs         map[string]string `json:"envs,omitempty"`
	OrgID        int               `json:"orgID,omitempty"`
}

Sysconf dice installer 配置

func (Sysconf) DependsOn

func (sc Sysconf) DependsOn(k string) map[string]string

func (Sysconf) HostSubnets

func (sc Sysconf) HostSubnets() []string

func (*Sysconf) SetDefault

func (sc *Sysconf) SetDefault()

func (Sysconf) Validate

func (sc Sysconf) Validate() string

Validate 检查配置

Jump to

Keyboard shortcuts

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