state

package
v0.9.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(ha HAProxy, old, new State) error

Types

type Backend

type Backend struct {
	Backend          models.Backend
	LogTarget        *models.LogTarget
	Servers          []models.Server
	HTTPRequestRules []models.HTTPRequestRule
}

type Backends

type Backends []Backend

Backends implements methods to sort, will sort by Name

func (Backends) Len

func (a Backends) Len() int

func (Backends) Less

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

func (Backends) Swap

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

type CertificateStore

type CertificateStore interface {
	CertsPath(tls consul.TLS) (string, string, error)
}

type Frontend

type Frontend struct {
	Frontend  models.Frontend
	Bind      models.Bind
	LogTarget *models.LogTarget
	Filter    *FrontendFilter
}

type FrontendFilter

type FrontendFilter struct {
	Filter models.Filter
	Rule   models.TCPRequestRule
}

type Frontends

type Frontends []Frontend

Frontends implement methods to sort, will sort by Name

func (Frontends) Len

func (a Frontends) Len() int

func (Frontends) Less

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

func (Frontends) Swap

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

type HAProxy

type HAProxy interface {
	CreateFrontend(fe models.Frontend) error
	DeleteFrontend(name string) error
	CreateBind(feName string, bind models.Bind) error
	DeleteBackend(name string) error
	CreateBackend(be models.Backend) error
	CreateServer(beName string, srv models.Server) error
	ReplaceServer(beName string, srv models.Server) error
	DeleteServer(beName string, name string) error
	CreateFilter(parentType, parentName string, filter models.Filter) error
	CreateTCPRequestRule(parentType, parentName string, rule models.TCPRequestRule) error
	CreateLogTargets(parentType, parentName string, rule models.LogTarget) error
	CreateHTTPRequestRule(parentType, parentName string, rule models.HTTPRequestRule) error
}

type HAProxyRead

type HAProxyRead interface {
	Frontends() ([]models.Frontend, error)
	Binds(feName string) ([]models.Bind, error)
	LogTargets(parentType, parentName string) ([]models.LogTarget, error)
	Filters(parentType, parentName string) ([]models.Filter, error)
	TCPRequestRules(parentType, parentName string) ([]models.TCPRequestRule, error)
	HTTPRequestRules(parentType, parentName string) ([]models.HTTPRequestRule, error)
	Backends() ([]models.Backend, error)
	Servers(beName string) ([]models.Server, error)
}

type Options

type Options struct {
	EnableIntentions bool
	LogRequests      bool
	LogSocket        string
	SPOEConfigPath   string
	SPOESocket       string
}

type State

type State struct {
	Frontends []Frontend
	Backends  []Backend
}

func FromHAProxy

func FromHAProxy(ha HAProxyRead) (State, error)

func Generate

func Generate(opts Options, certStore CertificateStore, oldState State, cfg consul.Config) (State, error)

func (State) Equal

func (s State) Equal(o State) bool

Jump to

Keyboard shortcuts

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