Documentation
¶
Index ¶
- Constants
- Variables
- func CertName(s string, idx int) string
- func GetHost() string
- func GetHttpPort() int
- func GetWorkingDir() string
- func IsCertKeyName(f string, s string) bool
- func KeyName(s string) string
- func PrintCertKey(list []*CertKey, yaml bool)
- func PrintDnsServer(list []*DnsServer, yaml bool)
- func PrintOneCertKey(ck *CertKey, yaml bool)
- func PrintOneDnsServer(dns *DnsServer, yaml bool)
- func PrintOneSecurityGroup(secg *SecurityGroup, yaml bool)
- func PrintOneServerGroup(sg *ServerGroup, yaml bool)
- func PrintOneSocks5Server(socks5 *Socks5Server, yaml bool)
- func PrintOneTcpLb(tl *TcpLb, yaml bool)
- func PrintOneUpstream(ups *Upstream, yaml bool)
- func PrintSecurityGroup(list []*SecurityGroup, yaml bool)
- func PrintServerGroup(list []*ServerGroup, yaml bool)
- func PrintSocks5Server(list []*Socks5Server, yaml bool)
- func PrintTcpLb(list []*TcpLb, yaml bool)
- func PrintUpstream(list []*Upstream, yaml bool)
- func PrintYaml(list interface{})
- func RunTodoList(todo []*Todo, logger *logr.Logger) error
- func RunTodoListAndPrint(todo []*Todo) error
- func UtilGetAndPrintList(typ string, yaml bool) error
- func UtilGetAndPrintOne(typ string, name string, yaml bool) error
- func UtilWatchAndPrint(typ string) error
- func WatchHealthCheck(chnl chan *HealthCheckEventChannelMessage, stop chan bool) error
- type Base
- type CertKey
- type CertKeySpec
- type CertKeyStatus
- type Config
- type ConfigSortingArrayForApplying
- type ConfigSortingArrayForDeleting
- type DnsServer
- type DnsServerSpec
- type HealthCheckEvent
- type HealthCheckEventChannelMessage
- type HealthCheckEventOnWire
- type Metadata
- type Op
- type PemCertKey
- type SecurityGroup
- type SecurityGroupRule
- type SecurityGroupSpec
- type ServerGroup
- type ServerGroupInHC
- type ServerGroupInUpstream
- type ServerGroupSelfSpec
- type ServerGroupSpec
- type ServerGroupStatus
- type ServerInServerGroup
- type ServerStatus
- type Socks5Server
- type Socks5ServerSpec
- type StaticServer
- type TcpLb
- type TcpLbSpec
- type Todo
- type Upstream
- type UpstreamSpec
Constants ¶
View Source
const ApiVersion = CurrentVersion
View Source
const CurrentVersion = "app.vproxy.io/v1alpha1"
Variables ¶
View Source
var AvailableKind = []string{
"TcpLb", "tcp-lb", "tl",
"Socks5Server", "socks5-server", "socks5",
"DnsServer", "dns-server", "dns",
"Upstream", "upstream", "ups",
"ServerGroup", "server-group", "sg",
"SecurityGroup", "security-group", "secg",
"CertKey", "cert-key", "ck",
}
View Source
var KindMap = map[string]string{
"server-group": "ServerGroup",
"sg": "ServerGroup",
"security-group": "SecurityGroup",
"secg": "SecurityGroup",
"cert-key": "CertKey",
"ck": "CertKey",
"upstream": "Upstream",
"ups": "Upstream",
"tcp-lb": "TcpLb",
"tl": "TcpLb",
"socks5-server": "Socks5Server",
"socks5": "Socks5Server",
"dns-server": "DnsServer",
"dns": "DnsServer",
}
View Source
var TypeOrderForApplying = []string{
"ServerGroup",
"SecurityGroup",
"CertKey",
"Upstream",
"TcpLb",
"Socks5Server",
"DnsServer",
}
View Source
var Versions = []string{ CurrentVersion, }
Functions ¶
func GetHttpPort ¶
func GetHttpPort() int
func GetWorkingDir ¶
func GetWorkingDir() string
func IsCertKeyName ¶
func PrintCertKey ¶
func PrintDnsServer ¶
func PrintOneCertKey ¶
func PrintOneDnsServer ¶
func PrintOneSecurityGroup ¶
func PrintOneSecurityGroup(secg *SecurityGroup, yaml bool)
func PrintOneServerGroup ¶
func PrintOneServerGroup(sg *ServerGroup, yaml bool)
func PrintOneSocks5Server ¶
func PrintOneSocks5Server(socks5 *Socks5Server, yaml bool)
func PrintOneTcpLb ¶
func PrintOneUpstream ¶
func PrintSecurityGroup ¶
func PrintSecurityGroup(list []*SecurityGroup, yaml bool)
func PrintServerGroup ¶
func PrintServerGroup(list []*ServerGroup, yaml bool)
func PrintSocks5Server ¶
func PrintSocks5Server(list []*Socks5Server, yaml bool)
func PrintTcpLb ¶
func PrintUpstream ¶
func RunTodoListAndPrint ¶
func UtilGetAndPrintList ¶
func UtilWatchAndPrint ¶
func WatchHealthCheck ¶
func WatchHealthCheck(chnl chan *HealthCheckEventChannelMessage, stop chan bool) error
Types ¶
type Base ¶
type CertKey ¶
type CertKey struct { Base `yaml:",inline"` Spec CertKeySpec `json:"spec" yaml:"spec"` Status CertKeyStatus `json:"status" yaml:"status"` }
func GetCertKey ¶
func ListCertKey ¶
type CertKeySpec ¶
type CertKeySpec struct {
Pem PemCertKey `json:"pem" yaml:"pem"`
}
func (*CertKeySpec) DeepCopyInto ¶
func (o *CertKeySpec) DeepCopyInto(out *CertKeySpec)
type CertKeyStatus ¶
type CertKeyStatus struct { CertFiles []string `json:"certs" yaml:"certs"` KeyFile string `json:"key" yaml:"key"` KeySHA1 string `json:"keySHA1" yaml:"keySHA1"` }
func (*CertKeyStatus) DeepCopyInto ¶
func (o *CertKeyStatus) DeepCopyInto(out *CertKeyStatus)
type ConfigSortingArrayForApplying ¶
type ConfigSortingArrayForApplying []Config
func (ConfigSortingArrayForApplying) Len ¶
func (arr ConfigSortingArrayForApplying) Len() int
func (ConfigSortingArrayForApplying) Less ¶
func (arr ConfigSortingArrayForApplying) Less(i, j int) bool
func (ConfigSortingArrayForApplying) Swap ¶
func (arr ConfigSortingArrayForApplying) Swap(i, j int)
type ConfigSortingArrayForDeleting ¶
type ConfigSortingArrayForDeleting []Config
func (ConfigSortingArrayForDeleting) Len ¶
func (arr ConfigSortingArrayForDeleting) Len() int
func (ConfigSortingArrayForDeleting) Less ¶
func (arr ConfigSortingArrayForDeleting) Less(i, j int) bool
func (ConfigSortingArrayForDeleting) Swap ¶
func (arr ConfigSortingArrayForDeleting) Swap(i, j int)
type DnsServer ¶
type DnsServer struct { Base `yaml:",inline"` Spec DnsServerSpec `json:"spec" yaml:"spec"` }
func GetDnsServer ¶
func ListDnsServer ¶
type DnsServerSpec ¶
type DnsServerSpec struct { Address string `json:"address" yaml:"address"` RRSets string `json:"rrsets" yaml:"rrsets"` //+optional TTL *int `json:"ttl,omitempty" yaml:"ttl,omitempty"` //+optional SecurityGroup string `json:"securityGroup,omitempty" yaml:"securityGroup,omitempty"` }
func (*DnsServerSpec) DeepCopyInto ¶
func (o *DnsServerSpec) DeepCopyInto(out *DnsServerSpec)
type HealthCheckEvent ¶
type HealthCheckEvent struct { Base `yaml:",inline"` ServerGroup ServerGroupInHC `json:"serverGroup" yaml:"serverGroup"` Server ServerStatus `json:"server" yaml:"server"` }
type HealthCheckEventChannelMessage ¶
type HealthCheckEventChannelMessage struct { Evt HealthCheckEvent Err error }
type HealthCheckEventOnWire ¶
type HealthCheckEventOnWire struct { Server vproxy_client_model.Server `json:"server"` ServerGroup vproxy_client_model.ServerGroup `json:"serverGroup"` }
type PemCertKey ¶
type PemCertKey struct { Certs []string `json:"certs" yaml:"certs"` Key string `json:"key" yaml:"key"` }
func (*PemCertKey) DeepCopyInto ¶
func (o *PemCertKey) DeepCopyInto(out *PemCertKey)
type SecurityGroup ¶
type SecurityGroup struct { Base `yaml:",inline"` Spec SecurityGroupSpec `json:"spec" yaml:"spec"` }
func GetSecurityGroup ¶
func GetSecurityGroup(name string) (*SecurityGroup, error)
func ListSecurityGroup ¶
func ListSecurityGroup() ([]*SecurityGroup, error)
func (*SecurityGroup) GetBase ¶
func (o *SecurityGroup) GetBase() Base
func (*SecurityGroup) Validate ¶
func (o *SecurityGroup) Validate() error
type SecurityGroupRule ¶
type SecurityGroupRule struct { Name string `json:"name" yaml:"name"` ClientNetwork string `json:"clientNetwork" yaml:"clientNetwork"` Protocol string `json:"protocol" yaml:"protocol"` ServerPortMin int `json:"serverPortMin" yaml:"serverPortMin"` ServerPortMax int `json:"serverPortMax" yaml:"serverPortMax"` Rule string `json:"rule" yaml:"rule"` }
func (*SecurityGroupRule) DeepCopyInto ¶
func (o *SecurityGroupRule) DeepCopyInto(out *SecurityGroupRule)
func (*SecurityGroupRule) Validate ¶
func (o *SecurityGroupRule) Validate() error
type SecurityGroupSpec ¶
type SecurityGroupSpec struct { DefaultRule string `json:"defaultRule" yaml:"defaultRule"` Rules []SecurityGroupRule `json:"rules" yaml:"rules"` }
func (*SecurityGroupSpec) DeepCopyInto ¶
func (o *SecurityGroupSpec) DeepCopyInto(out *SecurityGroupSpec)
type ServerGroup ¶
type ServerGroup struct { Base `yaml:",inline"` Spec ServerGroupSpec `json:"spec" yaml:"spec"` Status ServerGroupStatus `json:"status" yaml:"status"` }
func GetServerGroup ¶
func GetServerGroup(name string) (*ServerGroup, error)
func ListServerGroup ¶
func ListServerGroup() ([]*ServerGroup, error)
func (*ServerGroup) GetBase ¶
func (o *ServerGroup) GetBase() Base
func (*ServerGroup) Validate ¶
func (o *ServerGroup) Validate() error
type ServerGroupInHC ¶
type ServerGroupInHC struct { Base `yaml:",inline"` Spec ServerGroupSelfSpec `json:"spec" yaml:"spec"` }
type ServerGroupInUpstream ¶
type ServerGroupInUpstream struct { Name string `json:"name" yaml:"name"` //+optional Weight *int `json:"weight,omitempty" yaml:"weight,omitempty"` //+optional Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` }
func (*ServerGroupInUpstream) DeepCopyInto ¶
func (o *ServerGroupInUpstream) DeepCopyInto(out *ServerGroupInUpstream)
func (*ServerGroupInUpstream) Validate ¶
func (o *ServerGroupInUpstream) Validate() error
type ServerGroupSelfSpec ¶
type ServerGroupSelfSpec struct { Timeout int `json:"timeout" yaml:"timeout"` Period int `json:"period" yaml:"period"` Up int `json:"up" yaml:"up"` Down int `json:"down" yaml:"down"` //+optional Protocol string `json:"protocol,omitempty" yaml:"protocol,omitempty"` //+optional Method string `json:"method,omitempty" yaml:"method,omitempty"` }
func (*ServerGroupSelfSpec) DeepCopyInto ¶
func (o *ServerGroupSelfSpec) DeepCopyInto(out *ServerGroupSelfSpec)
type ServerGroupSpec ¶
type ServerGroupSpec struct { ServerGroupSelfSpec `json:",inline" yaml:",inline"` Servers ServerInServerGroup `json:"servers" yaml:"servers"` }
func (*ServerGroupSpec) DeepCopyInto ¶
func (o *ServerGroupSpec) DeepCopyInto(out *ServerGroupSpec)
type ServerGroupStatus ¶
type ServerGroupStatus struct {
Servers []ServerStatus `json:"servers" yaml:"servers"`
}
func (*ServerGroupStatus) DeepCopyInto ¶
func (o *ServerGroupStatus) DeepCopyInto(out *ServerGroupStatus)
type ServerInServerGroup ¶
type ServerInServerGroup struct {
Static []StaticServer `json:"static" yaml:"static"`
}
func (*ServerInServerGroup) DeepCopyInto ¶
func (o *ServerInServerGroup) DeepCopyInto(out *ServerInServerGroup)
type ServerStatus ¶
type ServerStatus struct { Name string `json:"name" yaml:"name"` Address string `json:"address" yaml:"address"` Weight int `json:"weight" yaml:"weight"` CurrentIp string `json:"currentIp" yaml:"currentIp"` Status string `json:"status" yaml:"status"` Cost int `json:"cost" yaml:"cost"` DownReason string `json:"downReason" yaml:"downReason"` }
func (*ServerStatus) DeepCopyInto ¶
func (o *ServerStatus) DeepCopyInto(out *ServerStatus)
type Socks5Server ¶
type Socks5Server struct { Base `yaml:",inline"` Spec Socks5ServerSpec `json:"spec" yaml:"spec"` }
func GetSocks5Server ¶
func GetSocks5Server(name string) (*Socks5Server, error)
func ListSocks5Server ¶
func ListSocks5Server() ([]*Socks5Server, error)
func (*Socks5Server) GetBase ¶
func (o *Socks5Server) GetBase() Base
func (*Socks5Server) Validate ¶
func (o *Socks5Server) Validate() error
type Socks5ServerSpec ¶
type Socks5ServerSpec struct { Address string `json:"address" yaml:"address"` Backend string `json:"backend" yaml:"backend"` //+optional SecurityGroup string `json:"securityGroup,omitempty" yaml:"securityGroup,omitempty"` //+optional AllowNonBackend *bool `json:"allowNonBackend,omitempty" yaml:"allowNonBackend,omitempty"` }
func (*Socks5ServerSpec) DeepCopyInto ¶
func (o *Socks5ServerSpec) DeepCopyInto(out *Socks5ServerSpec)
type StaticServer ¶
type StaticServer struct { Name string `json:"name" yaml:"name"` Address string `json:"address" yaml:"address"` //+optional Weight *int `json:"weight,omitempty" yaml:"weight,omitempty"` }
func (*StaticServer) DeepCopyInto ¶
func (o *StaticServer) DeepCopyInto(out *StaticServer)
func (*StaticServer) Validate ¶
func (o *StaticServer) Validate() error
type TcpLbSpec ¶
type TcpLbSpec struct { Address string `json:"address" yaml:"address"` Backend string `json:"backend" yaml:"backend"` //+optional Protocol string `json:"protocol,omitempty" yaml:"protocol,omitempty"` //+optional ListOfCertKey []string `json:"listOfCertKey,omitempty" yaml:"listOfCertKey,omitempty"` //+optional SecurityGroup string `json:"securityGroup,omitempty" yaml:"securityGroup,omitempty"` }
func (*TcpLbSpec) DeepCopyInto ¶
type Todo ¶
type Todo struct { Op Op Ref string Index int F func(todo *Todo) error // contains filtered or unexported fields }
func ApplyByConfig ¶
func ApplyByFile ¶
func DeleteByConfig ¶
func DeleteByFile ¶
type Upstream ¶
type Upstream struct { Base `yaml:",inline"` Spec UpstreamSpec `json:"spec" yaml:"spec"` }
func GetUpstream ¶
func ListUpstream ¶
type UpstreamSpec ¶
type UpstreamSpec struct {
ServerGroups []ServerGroupInUpstream `json:"serverGroups" yaml:"serverGroups"`
}
func (*UpstreamSpec) DeepCopyInto ¶
func (o *UpstreamSpec) DeepCopyInto(out *UpstreamSpec)
Click to show internal directories.
Click to hide internal directories.