lbagent

package
v0.3.10-0-alpha2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 40 Imported by: 1

Documentation

Index

Constants

View Source
const (
	HA_STATE_SCRIPT_NAME    = "ha_state.sh"
	HA_STATE_SCRIPT_CONTENT = `
#!/bin/bash
echo "$@" >%s
`
	HA_STATE_FILENAME = "ha_state"
)

Variables

This section is empty.

Functions

func StartService

func StartService()

Types

type ApiHelper

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

func NewApiHelper

func NewApiHelper(opts *Options) (*ApiHelper, error)

func (*ApiHelper) Run

func (h *ApiHelper) Run(ctx context.Context)

func (*ApiHelper) SetHaStateProvider

func (h *ApiHelper) SetHaStateProvider(hsp HaStateProvider)

type Bar

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

func NewBar

func NewBar() *Bar

func (*Bar) Cancel

func (b *Bar) Cancel()

func (*Bar) Cancelled

func (b *Bar) Cancelled() <-chan struct{}

func (*Bar) Done

func (b *Bar) Done()

func (*Bar) Init

func (b *Bar) Init()

type HaStateProvider

type HaStateProvider interface {
	StateChannel() <-chan string
	StateScript() string
}

type HaStateWatcher

type HaStateWatcher struct {
	HaStateScriptPath string
	HaStatePath       string
	CurrentState      string // TODO hide it

	C chan string
	// contains filtered or unexported fields
}

func NewHaStateWatcher

func NewHaStateWatcher(opts *Options) (hsw *HaStateWatcher, err error)

func (*HaStateWatcher) Run

func (hsw *HaStateWatcher) Run(ctx context.Context)

func (*HaStateWatcher) StateChannel

func (hsw *HaStateWatcher) StateChannel() <-chan string

func (*HaStateWatcher) StateScript

func (hsw *HaStateWatcher) StateScript() string

type HaproxyHelper

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

func NewHaproxyHelper

func NewHaproxyHelper(opts *Options) (*HaproxyHelper, error)

func (*HaproxyHelper) Run

func (h *HaproxyHelper) Run(ctx context.Context)

type LbagentCmd

type LbagentCmd struct {
	Type LbagentCmdType
	Data interface{}
}

type LbagentCmdType

type LbagentCmdType uintptr
const (
	LbagentCmdUseCorpus LbagentCmdType = iota
	LbagentCmdStopDaemons
)

type LbagentCmdUseCorpusData

type LbagentCmdUseCorpusData struct {
	Corpus      *agentmodels.LoadbalancerCorpus
	AgentParams *agentmodels.AgentParams
	Wg          sync.WaitGroup
}

type LbagentOptions

type LbagentOptions struct {
	ApiLbagentId                  string `require:"true"`
	ApiLbagentHbInterval          int    `default:"10"`
	ApiLbagentHbTimeoutRelaxation int    `` /* 162-byte string literal not displayed */

	ApiSyncIntervalSeconds  int `default:"10"`
	ApiRunDelayMilliseconds int `default:"10"`

	ApiListBatchSize int `default:"1024"`

	DataPreserveN int `default:"8" help:"number of recent data to preserve on disk"`

	BaseDataDir string // `required:"true"`

	KeepalivedBin string `default:"keepalived"`
	HaproxyBin    string `default:"haproxy"`
	GobetweenBin  string `default:"gobetween"`
	TelegrafBin   string `default:"telegraf"`
	// contains filtered or unexported fields
}

type Options

type Options struct {
	common_options.CommonOptions

	LbagentOptions
}

func (*Options) ValidateThenInit

func (opts *Options) ValidateThenInit() error

type OvnHost

type OvnHost struct {
	Bar *Bar
	// contains filtered or unexported fields
}

func (*OvnHost) Refresh

func (ovnHost *OvnHost) Refresh(ctx context.Context, lb *agentmodels.Loadbalancer) error

func (*OvnHost) SetAddrIdx

func (ovnHost *OvnHost) SetAddrIdx(inner, outer uint16)

func (*OvnHost) Start

func (ovnHost *OvnHost) Start(ctx context.Context)

func (*OvnHost) Stop

func (ovnHost *OvnHost) Stop()

type OvnWorker

type OvnWorker struct {
	Bar *Bar
	// contains filtered or unexported fields
}

func NewOvnWorker

func NewOvnWorker() *OvnWorker

func (*OvnWorker) Refresh

func (ovn *OvnWorker) Refresh(ctx context.Context, lbs agentmodels.Loadbalancers) error

func (*OvnWorker) Start

func (ovn *OvnWorker) Start(ctx context.Context)

func (*OvnWorker) Stop

func (ovn *OvnWorker) Stop()

Directories

Path Synopsis
*

Jump to

Keyboard shortcuts

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