models

package
v0.0.0-...-6410feb Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CORPUS_VERSION = "v1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentParams

type AgentParams struct {
	AgentModel           *compute_models.SLoadbalancerAgent
	KeepalivedConfigTmpl *template.Template
	HaproxyConfigTmpl    *template.Template
	TelegrafConfigTmpl   *template.Template
	Data                 map[string]map[string]interface{}
}

func NewAgentParams

func NewAgentParams(agent *compute_models.SLoadbalancerAgent) (*AgentParams, error)

func (*AgentParams) Equals

func (p *AgentParams) Equals(p2 *AgentParams) bool

func (*AgentParams) GetVrrpParams

func (p *AgentParams) GetVrrpParams(k string) interface{}

func (*AgentParams) KeepalivedConfig

func (p *AgentParams) KeepalivedConfig()

func (*AgentParams) SetHaproxyParams

func (p *AgentParams) SetHaproxyParams(k string, v interface{}) map[string]interface{}

func (*AgentParams) SetTelegrafParams

func (p *AgentParams) SetTelegrafParams(k string, v interface{}) map[string]interface{}

func (*AgentParams) SetVrrpParams

func (p *AgentParams) SetVrrpParams(k string, v interface{}) map[string]interface{}

type GenGobetweenConfigOptions

type GenGobetweenConfigOptions struct {
	LoadbalancersEnabled []*Loadbalancer
	AgentParams          *AgentParams

	Config *gobetween.Config
}

type GenHaproxyConfigsResult

type GenHaproxyConfigsResult struct {
	LoadbalancersEnabled []*Loadbalancer
}

type GenKeepalivedConfigOptions

type GenKeepalivedConfigOptions struct {
	LoadbalancersEnabled []*Loadbalancer
	AgentParams          *AgentParams
}

type Loadbalancer

type Loadbalancer struct {
	*models.SLoadbalancer

	LoadbalancerNetwork *LoadbalancerNetwork `json:"-"`
	Listeners           LoadbalancerListeners
	BackendGroups       LoadbalancerBackendGroups

	ListenAddress string
}

func (*Loadbalancer) Copy

func (el *Loadbalancer) Copy() *Loadbalancer

func (*Loadbalancer) GetAddress

func (lb *Loadbalancer) GetAddress() string

type LoadbalancerAcl

type LoadbalancerAcl struct {
	*models.SLoadbalancerAcl
}

func (*LoadbalancerAcl) Copy

func (el *LoadbalancerAcl) Copy() *LoadbalancerAcl

type LoadbalancerAcls

type LoadbalancerAcls map[string]*LoadbalancerAcl

func (LoadbalancerAcls) AddModel

func (set LoadbalancerAcls) AddModel(i db.IModel)

func (LoadbalancerAcls) Copy

func (LoadbalancerAcls) ModelManager

func (set LoadbalancerAcls) ModelManager() modulebase.IBaseManager

func (LoadbalancerAcls) NewModel

func (set LoadbalancerAcls) NewModel() db.IModel

type LoadbalancerBackend

type LoadbalancerBackend struct {
	*models.SLoadbalancerBackend

	ConnectAddress string
	ConnectPort    int
	// contains filtered or unexported fields
}

func (*LoadbalancerBackend) Copy

func (*LoadbalancerBackend) GetAddressPort

func (lbbackend *LoadbalancerBackend) GetAddressPort() (addr string, port int)

type LoadbalancerBackendGroup

type LoadbalancerBackendGroup struct {
	*models.SLoadbalancerBackendGroup

	Backends LoadbalancerBackends
	// contains filtered or unexported fields
}

func (*LoadbalancerBackendGroup) Copy

type LoadbalancerBackendGroups

type LoadbalancerBackendGroups map[string]*LoadbalancerBackendGroup

func (LoadbalancerBackendGroups) AddModel

func (set LoadbalancerBackendGroups) AddModel(i db.IModel)

func (LoadbalancerBackendGroups) Copy

func (LoadbalancerBackendGroups) JoinBackends

func (ms LoadbalancerBackendGroups) JoinBackends(subEntries LoadbalancerBackends) bool

func (LoadbalancerBackendGroups) ModelManager

func (LoadbalancerBackendGroups) NewModel

func (set LoadbalancerBackendGroups) NewModel() db.IModel

type LoadbalancerBackends

type LoadbalancerBackends map[string]*LoadbalancerBackend

func (LoadbalancerBackends) AddModel

func (set LoadbalancerBackends) AddModel(i db.IModel)

func (LoadbalancerBackends) Copy

func (LoadbalancerBackends) ModelManager

func (set LoadbalancerBackends) ModelManager() modulebase.IBaseManager

func (LoadbalancerBackends) NewModel

func (set LoadbalancerBackends) NewModel() db.IModel

type LoadbalancerCertificate

type LoadbalancerCertificate struct {
	*models.SLoadbalancerCertificate
}

func (*LoadbalancerCertificate) Copy

type LoadbalancerCertificates

type LoadbalancerCertificates map[string]*LoadbalancerCertificate

func (LoadbalancerCertificates) AddModel

func (set LoadbalancerCertificates) AddModel(i db.IModel)

func (LoadbalancerCertificates) Copy

func (LoadbalancerCertificates) ModelManager

func (LoadbalancerCertificates) NewModel

func (set LoadbalancerCertificates) NewModel() db.IModel

type LoadbalancerCorpus

type LoadbalancerCorpus struct {
	CorpusVersion string
	*ModelSets
	ModelSetsMaxUpdatedAt *ModelSetsMaxUpdatedAt
}

func NewEmptyLoadbalancerCorpus

func NewEmptyLoadbalancerCorpus() *LoadbalancerCorpus

func (*LoadbalancerCorpus) GenGobetweenConfigs

func (b *LoadbalancerCorpus) GenGobetweenConfigs(dir string, opts *GenGobetweenConfigOptions) error

func (*LoadbalancerCorpus) GenHaproxyConfigs

func (b *LoadbalancerCorpus) GenHaproxyConfigs(dir string, opts *AgentParams) (*GenHaproxyConfigsResult, error)

func (*LoadbalancerCorpus) GenHaproxyToplevelConfig

func (b *LoadbalancerCorpus) GenHaproxyToplevelConfig(dir string, opts *AgentParams) error

func (*LoadbalancerCorpus) GenKeepalivedConfigs

func (b *LoadbalancerCorpus) GenKeepalivedConfigs(dir string, opts *GenKeepalivedConfigOptions) error

func (*LoadbalancerCorpus) LoadDir

func (b *LoadbalancerCorpus) LoadDir(dir string) error

func (*LoadbalancerCorpus) MaxSeenUpdatedAtParams

func (b *LoadbalancerCorpus) MaxSeenUpdatedAtParams() *jsonutils.JSONDict

func (*LoadbalancerCorpus) Reset

func (b *LoadbalancerCorpus) Reset()

func (*LoadbalancerCorpus) SaveDir

func (b *LoadbalancerCorpus) SaveDir(dir string) error

type LoadbalancerListener

type LoadbalancerListener struct {
	*models.SLoadbalancerListener
	// contains filtered or unexported fields
}

func (*LoadbalancerListener) Copy

type LoadbalancerListenerRule

type LoadbalancerListenerRule struct {
	*models.SLoadbalancerListenerRule
	// contains filtered or unexported fields
}

func (*LoadbalancerListenerRule) Copy

type LoadbalancerListenerRules

type LoadbalancerListenerRules map[string]*LoadbalancerListenerRule

func (LoadbalancerListenerRules) AddModel

func (set LoadbalancerListenerRules) AddModel(i db.IModel)

func (LoadbalancerListenerRules) Copy

func (LoadbalancerListenerRules) ModelManager

func (LoadbalancerListenerRules) NewModel

func (set LoadbalancerListenerRules) NewModel() db.IModel

func (LoadbalancerListenerRules) OrderedEnabledList

type LoadbalancerListeners

type LoadbalancerListeners map[string]*LoadbalancerListener

func (LoadbalancerListeners) AddModel

func (set LoadbalancerListeners) AddModel(i db.IModel)

func (LoadbalancerListeners) Copy

func (LoadbalancerListeners) JoinCertificates

func (ms LoadbalancerListeners) JoinCertificates(subEntries LoadbalancerCertificates) bool

func (LoadbalancerListeners) JoinListenerRules

func (ms LoadbalancerListeners) JoinListenerRules(subEntries LoadbalancerListenerRules) bool

func (LoadbalancerListeners) ModelManager

func (set LoadbalancerListeners) ModelManager() modulebase.IBaseManager

func (LoadbalancerListeners) NewModel

func (set LoadbalancerListeners) NewModel() db.IModel

type LoadbalancerNetwork

type LoadbalancerNetwork struct {
	*models.SLoadbalancerNetwork

	Loadbalancer *Loadbalancer `json:"-"`
	Network      *Network      `json:"-"`
}

func (*LoadbalancerNetwork) Copy

type LoadbalancerNetworks

type LoadbalancerNetworks map[string]*LoadbalancerNetwork // key: networkId/loadbalancerId

func (LoadbalancerNetworks) AddModel

func (set LoadbalancerNetworks) AddModel(i db.IModel)

func (LoadbalancerNetworks) Copy

func (LoadbalancerNetworks) JoinLoadbalancers

func (set LoadbalancerNetworks) JoinLoadbalancers(entries Loadbalancers) bool

func (LoadbalancerNetworks) JoinNetworks

func (set LoadbalancerNetworks) JoinNetworks(entries Networks) bool

func (LoadbalancerNetworks) ModelManager

func (set LoadbalancerNetworks) ModelManager() modulebase.IBaseManager

func (LoadbalancerNetworks) NewModel

func (set LoadbalancerNetworks) NewModel() db.IModel

type Loadbalancers

type Loadbalancers map[string]*Loadbalancer

func (Loadbalancers) AddModel

func (set Loadbalancers) AddModel(i db.IModel)

func (Loadbalancers) Copy

func (set Loadbalancers) Copy() apihelper.IModelSet

func (Loadbalancers) JoinBackendGroups

func (ms Loadbalancers) JoinBackendGroups(subEntries LoadbalancerBackendGroups) bool

func (Loadbalancers) JoinListeners

func (ms Loadbalancers) JoinListeners(subEntries LoadbalancerListeners) bool

func (Loadbalancers) ModelManager

func (set Loadbalancers) ModelManager() modulebase.IBaseManager

func (Loadbalancers) NewModel

func (set Loadbalancers) NewModel() db.IModel

type ModelSets

type ModelSets struct {
	Networks                  Networks
	LoadbalancerNetworks      LoadbalancerNetworks
	Loadbalancers             Loadbalancers
	LoadbalancerListeners     LoadbalancerListeners
	LoadbalancerListenerRules LoadbalancerListenerRules
	LoadbalancerBackendGroups LoadbalancerBackendGroups
	LoadbalancerBackends      LoadbalancerBackends
	LoadbalancerAcls          LoadbalancerAcls
	LoadbalancerCertificates  LoadbalancerCertificates
}

func NewModelSets

func NewModelSets() *ModelSets

func (*ModelSets) ApplyUpdates

func (mss *ModelSets) ApplyUpdates(mssNews apihelper.IModelSets) apihelper.ModelSetsUpdateResult

func (*ModelSets) Copy

func (mss *ModelSets) Copy() apihelper.IModelSets

func (*ModelSets) CopyJoined

func (mss *ModelSets) CopyJoined() apihelper.IModelSets

func (*ModelSets) MaxSeenUpdatedAtParams

func (mss *ModelSets) MaxSeenUpdatedAtParams() *jsonutils.JSONDict

func (*ModelSets) ModelSetList

func (mss *ModelSets) ModelSetList() []apihelper.IModelSet

func (*ModelSets) NewEmpty

func (mss *ModelSets) NewEmpty() apihelper.IModelSets

type ModelSetsMaxUpdatedAt

type ModelSetsMaxUpdatedAt struct {
	Networks                  time.Time
	LoadbalancerNetworks      time.Time
	Loadbalancers             time.Time
	LoadbalancerListeners     time.Time
	LoadbalancerListenerRules time.Time
	LoadbalancerBackendGroups time.Time
	LoadbalancerBackends      time.Time
	LoadbalancerAcls          time.Time
	LoadbalancerCertificates  time.Time
}

func NewModelSetsMaxUpdatedAt

func NewModelSetsMaxUpdatedAt() *ModelSetsMaxUpdatedAt

type Network

type Network struct {
	*models.SNetwork
}

func (*Network) Copy

func (el *Network) Copy() *Network

type Networks

type Networks map[string]*Network

func (Networks) AddModel

func (set Networks) AddModel(i db.IModel)

func (Networks) Copy

func (set Networks) Copy() apihelper.IModelSet

func (Networks) ModelManager

func (set Networks) ModelManager() modulebase.IBaseManager

func (Networks) NewModel

func (set Networks) NewModel() db.IModel

type OrderedLoadbalancerListenerRuleList

type OrderedLoadbalancerListenerRuleList []*LoadbalancerListenerRule

func (OrderedLoadbalancerListenerRuleList) Len

func (OrderedLoadbalancerListenerRuleList) Less

func (OrderedLoadbalancerListenerRuleList) Swap

Jump to

Keyboard shortcuts

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