Documentation ¶
Index ¶
- Constants
- func CompositeTransactionError(e ...error) *oaerrors.CompositeError
- func CreateEditSection(object interface{}, section parser.Section, pName string, p parser.Parser) error
- func DeletePeerSection(p parser.Parser, name string) error
- func GetBindByName(name string, frontend string, p parser.Parser) (*models.Bind, int)
- func GetNameserverByName(name string, resolverSection string, p parser.Parser) (*models.Nameserver, int)
- func GetPeerEntryByName(name string, peerSection string, p parser.Parser) (*models.PeerEntry, int)
- func GetServerByName(name string, backend string, p parser.Parser) (*models.Server, int)
- func GetServerTemplateByPrefix(prefix string, backend string, p parser.Parser) (*models.ServerTemplate, int)
- func ParseACL(f types.ACL) *models.ACL
- func ParseACLs(t, pName string, p parser.Parser, aclName ...string) (models.Acls, error)
- func ParseBackendSwitchingRule(ub types.UseBackend) *models.BackendSwitchingRule
- func ParseBackendSwitchingRules(frontend string, p parser.Parser) (models.BackendSwitchingRules, error)
- func ParseBind(ondiskBind types.Bind) *models.Bind
- func ParseBinds(frontend string, p parser.Parser) (models.Binds, error)
- func ParseFilter(f types.Filter) *models.Filter
- func ParseFilters(t, pName string, p parser.Parser) (models.Filters, error)
- func ParseGlobalSection(p parser.Parser) (*models.Global, error)
- func ParseHTTPRequestRule(f types.Action) (rule *models.HTTPRequestRule, err error)
- func ParseHTTPRequestRules(t, pName string, p parser.Parser) (models.HTTPRequestRules, error)
- func ParseHTTPResponseRule(f types.Action) *models.HTTPResponseRule
- func ParseHTTPResponseRules(t, pName string, p parser.Parser) (models.HTTPResponseRules, error)
- func ParseLogTarget(l types.Log) *models.LogTarget
- func ParseLogTargets(t, pName string, p parser.Parser) (models.LogTargets, error)
- func ParseNameserver(p types.Nameserver) *models.Nameserver
- func ParseNameservers(resolverSection string, p parser.Parser) (models.Nameservers, error)
- func ParsePeerEntries(peerSection string, p parser.Parser) (models.PeerEntries, error)
- func ParsePeerEntry(p types.Peer) *models.PeerEntry
- func ParseResolverSection(p parser.Parser, resolver *models.Resolver) error
- func ParseSection(object interface{}, section parser.Section, pName string, p parser.Parser) error
- func ParseServer(ondiskServer types.Server) *models.Server
- func ParseServerSwitchingRule(us types.UseServer) *models.ServerSwitchingRule
- func ParseServerSwitchingRules(backend string, p parser.Parser) (models.ServerSwitchingRules, error)
- func ParseServerTemplate(ondiskServerTemplate types.ServerTemplate) *models.ServerTemplate
- func ParseServerTemplates(backend string, p parser.Parser) (models.ServerTemplates, error)
- func ParseServers(backend string, p parser.Parser) (models.Servers, error)
- func ParseStickRule(s types.Stick) *models.StickRule
- func ParseStickRules(backend string, p parser.Parser) (models.StickRules, error)
- func ParseTCPRequestRule(f types.TCPType) (rule *models.TCPRequestRule, err error)
- func ParseTCPRequestRules(t, pName string, p parser.Parser) (models.TCPRequestRules, error)
- func ParseTCPResponseRule(t types.TCPType) *models.TCPResponseRule
- func ParseTCPResponseRules(backend string, p parser.Parser) (models.TCPResponseRules, error)
- func SerializeACL(f models.ACL) types.ACL
- func SerializeBackendSwitchingRule(bRule models.BackendSwitchingRule) types.UseBackend
- func SerializeBind(b models.Bind) types.Bind
- func SerializeFarmToBackend(farm *models.SiteFarm) *models.Backend
- func SerializeFilter(f models.Filter) types.Filter
- func SerializeGlobalSection(p parser.Parser, data *models.Global) error
- func SerializeHTTPRequestRule(f models.HTTPRequestRule) (rule types.Action, err error)
- func SerializeHTTPResponseRule(f models.HTTPResponseRule) types.Action
- func SerializeLogTarget(l models.LogTarget) types.Log
- func SerializeNameserver(pe models.Nameserver) types.Nameserver
- func SerializePeerEntry(pe models.PeerEntry) types.Peer
- func SerializePeerSection(p parser.Parser, data *models.PeerSection) error
- func SerializeResolverSection(p parser.Parser, data *models.Resolver) error
- func SerializeServer(s models.Server) types.Server
- func SerializeServerSwitchingRule(sRule models.ServerSwitchingRule) types.UseServer
- func SerializeServerTemplate(s models.ServerTemplate) types.ServerTemplate
- func SerializeServiceToFrontend(service *models.SiteService, name string) *models.Frontend
- func SerializeStickRule(sRule models.StickRule) types.Stick
- func SerializeTCPRequestRule(f models.TCPRequestRule) (rule types.TCPType, err error)
- func SerializeTCPResponseRule(t models.TCPResponseRule) types.TCPType
- type Client
- func (c *Client) AddParser(transactionID string) error
- func (c *Client) CommitParser(transactionID string) error
- func (c *Client) CreateACL(parentType string, parentName string, data *models.ACL, transactionID string, ...) error
- func (c *Client) CreateBackend(data *models.Backend, transactionID string, version int64) error
- func (c *Client) CreateBackendSwitchingRule(frontend string, data *models.BackendSwitchingRule, transactionID string, ...) error
- func (c *Client) CreateBind(frontend string, data *models.Bind, transactionID string, version int64) error
- func (c *Client) CreateFilter(parentType string, parentName string, data *models.Filter, ...) error
- func (c *Client) CreateFrontend(data *models.Frontend, transactionID string, version int64) error
- func (c *Client) CreateHTTPRequestRule(parentType string, parentName string, data *models.HTTPRequestRule, ...) error
- func (c *Client) CreateHTTPResponseRule(parentType string, parentName string, data *models.HTTPResponseRule, ...) error
- func (c *Client) CreateLogTarget(parentType string, parentName string, data *models.LogTarget, ...) error
- func (c *Client) CreateNameserver(resolverSection string, data *models.Nameserver, transactionID string, ...) error
- func (c *Client) CreatePeerEntry(peerSection string, data *models.PeerEntry, transactionID string, ...) error
- func (c *Client) CreatePeerSection(data *models.PeerSection, transactionID string, version int64) error
- func (c *Client) CreateResolver(data *models.Resolver, transactionID string, version int64) error
- func (c *Client) CreateServer(backend string, data *models.Server, transactionID string, version int64) error
- func (c *Client) CreateServerSwitchingRule(backend string, data *models.ServerSwitchingRule, transactionID string, ...) error
- func (c *Client) CreateServerTemplate(backend string, data *models.ServerTemplate, transactionID string, ...) error
- func (c *Client) CreateSite(data *models.Site, transactionID string, version int64) error
- func (c *Client) CreateStickRule(backend string, data *models.StickRule, transactionID string, version int64) error
- func (c *Client) CreateTCPRequestRule(parentType string, parentName string, data *models.TCPRequestRule, ...) error
- func (c *Client) CreateTCPResponseRule(backend string, data *models.TCPResponseRule, transactionID string, ...) error
- func (c *Client) DeleteACL(id int64, parentType string, parentName string, transactionID string, ...) error
- func (c *Client) DeleteBackend(name string, transactionID string, version int64) error
- func (c *Client) DeleteBackendSwitchingRule(id int64, frontend string, transactionID string, version int64) error
- func (c *Client) DeleteBind(name string, frontend string, transactionID string, version int64) error
- func (c *Client) DeleteFilter(id int64, parentType string, parentName string, transactionID string, ...) error
- func (c *Client) DeleteFrontend(name string, transactionID string, version int64) error
- func (c *Client) DeleteHTTPRequestRule(id int64, parentType string, parentName string, transactionID string, ...) error
- func (c *Client) DeleteHTTPResponseRule(id int64, parentType string, parentName string, transactionID string, ...) error
- func (c *Client) DeleteLogTarget(id int64, parentType string, parentName string, transactionID string, ...) error
- func (c *Client) DeleteNameserver(name string, resolverSection string, transactionID string, version int64) error
- func (c *Client) DeleteParser(transactionID string) error
- func (c *Client) DeletePeerEntry(name string, peerSection string, transactionID string, version int64) error
- func (c *Client) DeletePeerSection(name string, transactionID string, version int64) error
- func (c *Client) DeleteResolver(name string, transactionID string, version int64) error
- func (c *Client) DeleteServer(name string, backend string, transactionID string, version int64) error
- func (c *Client) DeleteServerSwitchingRule(id int64, backend string, transactionID string, version int64) error
- func (c *Client) DeleteServerTemplate(prefix string, backend string, transactionID string, version int64) error
- func (c *Client) DeleteService(name string)
- func (c *Client) DeleteSite(name string, transactionID string, version int64) error
- func (c *Client) DeleteStickRule(id int64, backend string, transactionID string, version int64) error
- func (c *Client) DeleteTCPRequestRule(id int64, parentType string, parentName string, transactionID string, ...) error
- func (c *Client) DeleteTCPResponseRule(id int64, backend string, transactionID string, version int64) error
- func (c *Client) EditACL(id int64, parentType string, parentName string, data *models.ACL, ...) error
- func (c *Client) EditBackend(name string, data *models.Backend, transactionID string, version int64) error
- func (c *Client) EditBackendSwitchingRule(id int64, frontend string, data *models.BackendSwitchingRule, ...) error
- func (c *Client) EditBind(name string, frontend string, data *models.Bind, transactionID string, ...) error
- func (c *Client) EditFilter(id int64, parentType string, parentName string, data *models.Filter, ...) error
- func (c *Client) EditFrontend(name string, data *models.Frontend, transactionID string, version int64) error
- func (c *Client) EditHTTPRequestRule(id int64, parentType string, parentName string, data *models.HTTPRequestRule, ...) error
- func (c *Client) EditHTTPResponseRule(id int64, parentType string, parentName string, data *models.HTTPResponseRule, ...) error
- func (c *Client) EditLogTarget(id int64, parentType string, parentName string, data *models.LogTarget, ...) error
- func (c *Client) EditNameserver(name string, resolverSection string, data *models.Nameserver, ...) error
- func (c *Client) EditPeerEntry(name string, peerSection string, data *models.PeerEntry, transactionID string, ...) error
- func (c *Client) EditResolver(name string, data *models.Resolver, transactionID string, version int64) error
- func (c *Client) EditServer(name string, backend string, data *models.Server, transactionID string, ...) error
- func (c *Client) EditServerSwitchingRule(id int64, backend string, data *models.ServerSwitchingRule, ...) error
- func (c *Client) EditServerTemplate(prefix string, backend string, data *models.ServerTemplate, ...) error
- func (c *Client) EditSite(name string, data *models.Site, transactionID string, version int64) error
- func (c *Client) EditStickRule(id int64, backend string, data *models.StickRule, transactionID string, ...) error
- func (c *Client) EditTCPRequestRule(id int64, parentType string, parentName string, data *models.TCPRequestRule, ...) error
- func (c *Client) EditTCPResponseRule(id int64, backend string, data *models.TCPResponseRule, transactionID string, ...) error
- func (c *Client) GetACL(id int64, parentType, parentName string, transactionID string) (int64, *models.ACL, error)
- func (c *Client) GetACLs(parentType, parentName string, transactionID string, aclName ...string) (int64, models.Acls, error)
- func (c *Client) GetBackend(name string, transactionID string) (int64, *models.Backend, error)
- func (c *Client) GetBackendSwitchingRule(id int64, frontend string, transactionID string) (int64, *models.BackendSwitchingRule, error)
- func (c *Client) GetBackendSwitchingRules(frontend string, transactionID string) (int64, models.BackendSwitchingRules, error)
- func (c *Client) GetBackends(transactionID string) (int64, models.Backends, error)
- func (c *Client) GetBind(name string, frontend string, transactionID string) (int64, *models.Bind, error)
- func (c *Client) GetBinds(frontend string, transactionID string) (int64, models.Binds, error)
- func (c *Client) GetConfigurationVersion(transactionID string) (int64, error)
- func (c *Client) GetDefaultsConfiguration(transactionID string) (int64, *models.Defaults, error)
- func (c *Client) GetFailedParserTransactionVersion(transactionID string) (int64, error)
- func (c *Client) GetFilter(id int64, parentType, parentName string, transactionID string) (int64, *models.Filter, error)
- func (c *Client) GetFilters(parentType, parentName string, transactionID string) (int64, models.Filters, error)
- func (c *Client) GetFrontend(name string, transactionID string) (int64, *models.Frontend, error)
- func (c *Client) GetFrontends(transactionID string) (int64, models.Frontends, error)
- func (c *Client) GetGlobalConfiguration(transactionID string) (int64, *models.Global, error)
- func (c *Client) GetHTTPRequestRule(id int64, parentType, parentName string, transactionID string) (int64, *models.HTTPRequestRule, error)
- func (c *Client) GetHTTPRequestRules(parentType, parentName string, transactionID string) (int64, models.HTTPRequestRules, error)
- func (c *Client) GetHTTPResponseRule(id int64, parentType, parentName string, transactionID string) (int64, *models.HTTPResponseRule, error)
- func (c *Client) GetHTTPResponseRules(parentType, parentName string, transactionID string) (int64, models.HTTPResponseRules, error)
- func (c *Client) GetLogTarget(id int64, parentType, parentName string, transactionID string) (int64, *models.LogTarget, error)
- func (c *Client) GetLogTargets(parentType, parentName string, transactionID string) (int64, models.LogTargets, error)
- func (c *Client) GetNameserver(name string, resolverSection string, transactionID string) (int64, *models.Nameserver, error)
- func (c *Client) GetNameservers(resolverSection string, transactionID string) (int64, models.Nameservers, error)
- func (c *Client) GetParser(transactionID string) (parser.Parser, error)
- func (c *Client) GetParserTransactions() models.Transactions
- func (c *Client) GetPeerEntries(peerSection string, transactionID string) (int64, models.PeerEntries, error)
- func (c *Client) GetPeerEntry(name string, peerSection string, transactionID string) (int64, *models.PeerEntry, error)
- func (c *Client) GetPeerSection(name string, transactionID string) (int64, *models.PeerSection, error)
- func (c *Client) GetPeerSections(transactionID string) (int64, models.PeerSections, error)
- func (c *Client) GetRawConfiguration(transactionID string, version int64) (int64, string, error)
- func (c *Client) GetResolver(name string, transactionID string) (int64, *models.Resolver, error)
- func (c *Client) GetResolvers(transactionID string) (int64, models.Resolvers, error)
- func (c *Client) GetServer(name string, backend string, transactionID string) (int64, *models.Server, error)
- func (c *Client) GetServerSwitchingRule(id int64, backend string, transactionID string) (int64, *models.ServerSwitchingRule, error)
- func (c *Client) GetServerSwitchingRules(backend string, transactionID string) (int64, models.ServerSwitchingRules, error)
- func (c *Client) GetServerTemplate(prefix string, backend string, transactionID string) (int64, *models.ServerTemplate, error)
- func (c *Client) GetServerTemplates(backend string, transactionID string) (int64, models.ServerTemplates, error)
- func (c *Client) GetServers(backend string, transactionID string) (int64, models.Servers, error)
- func (c *Client) GetSite(name string, transactionID string) (int64, *models.Site, error)
- func (c *Client) GetSites(transactionID string) (int64, models.Sites, error)
- func (c *Client) GetStickRule(id int64, backend string, transactionID string) (int64, *models.StickRule, error)
- func (c *Client) GetStickRules(backend string, transactionID string) (int64, models.StickRules, error)
- func (c *Client) GetTCPRequestRule(id int64, parentType, parentName string, transactionID string) (int64, *models.TCPRequestRule, error)
- func (c *Client) GetTCPRequestRules(parentType, parentName string, transactionID string) (int64, models.TCPRequestRules, error)
- func (c *Client) GetTCPResponseRule(id int64, backend string, transactionID string) (int64, *models.TCPResponseRule, error)
- func (c *Client) GetTCPResponseRules(backend string, transactionID string) (int64, models.TCPResponseRules, error)
- func (c *Client) GetVersion(transactionID string) (int64, error)
- func (c *Client) HasParser(transactionID string) bool
- func (c *Client) IncrementTransactionVersion(transactionID string) error
- func (c *Client) IncrementVersion() error
- func (c *Client) Init(options ClientParams) error
- func (c *Client) InitTransactionParsers() error
- func (c *Client) LoadData(filename string) error
- func (c *Client) NewService(name string, scaling ScalingParams) (*Service, error)
- func (c *Client) PostRawConfiguration(config *string, version int64, skipVersionCheck bool, onlyValidate ...bool) error
- func (c *Client) PushDefaultsConfiguration(data *models.Defaults, transactionID string, version int64) error
- func (c *Client) PushGlobalConfiguration(data *models.Global, transactionID string, version int64) error
- func (c *Client) Save(transactionFile, transactionID string) error
- type ClientParams
- type ConfError
- type ScalingParams
- type SectionObject
- type SectionParser
- type Service
- func (s *Service) Delete() error
- func (s *Service) GetServers() (models.Servers, error)
- func (s *Service) Init(transactionID string) (bool, error)
- func (s *Service) SetTransactionID(transactionID string)
- func (s *Service) Update(servers []ServiceServer) (bool, error)
- func (s *Service) UpdateScalingParams(scaling ScalingParams) error
- type ServiceServer
- type Transaction
- func (t *Transaction) CheckTransactionOrVersion(transactionID string, version int64) (string, error)
- func (t *Transaction) CommitTransaction(transactionID string) (*models.Transaction, error)
- func (t *Transaction) DeleteTransaction(transactionID string) error
- func (t *Transaction) ErrAndDeleteTransaction(err error, tID string) error
- func (t *Transaction) GetTransaction(transactionID string) (*models.Transaction, error)
- func (t *Transaction) GetTransactionFile(transactionID string) (string, error)
- func (t *Transaction) GetTransactions(status string) (*models.Transactions, error)
- func (t *Transaction) HandleError(id, parentType, parentName, transactionID string, implicit bool, err error) error
- func (t *Transaction) MarkTransactionOutdated(transactionID string) (err error)
- func (t *Transaction) SaveData(prsr interface{}, tID string, commitImplicit bool) error
- func (t *Transaction) StartTransaction(version int64) (*models.Transaction, error)
- type TransactionClient
Constants ¶
const ( // DefaultConfigurationFile sane default for path to haproxy configuration file DefaultConfigurationFile string = "/etc/haproxy/haproxy.cfg" // DefaultHaproxy sane default for path to haproxy executable DefaultHaproxy string = "/usr/sbin/haproxy" // DefaultUseValidation sane default using validation in client native DefaultUseValidation bool = true // DefaultPersistentTransactions sane default using persistent transactions in client native DefaultPersistentTransactions bool = true // DefaultTransactionDir sane default for path for transactions DefaultTransactionDir string = "/etc/haproxy/transactions" // DefaultValidateConfigurationFile is used to validate HAProxy configuration file DefaultValidateConfigurationFile bool = true )
const ( // General error, unknown cause ErrGeneralError = 0 // Errors regarding configurations ErrNoParentSpecified = 10 ErrParentDoesNotExist = 11 ErrBothVersionTransaction = 12 ErrNoVersionTransaction = 13 ErrValidationError = 14 ErrVersionMismatch = 15 ErrTransactionDoesNotExist = 20 ErrTransactionAlreadyExists = 21 ErrCannotParseTransaction = 22 ErrObjectDoesNotExist = 30 ErrObjectAlreadyExists = 31 ErrObjectIndexOutOfRange = 32 ErrErrorChangingConfig = 40 ErrCannotReadConfFile = 41 ErrCannotReadVersion = 42 ErrCannotSetVersion = 43 ErrCannotFindHAProxy = 50 ErrClientDoesNotExists = 60 )
const ServiceGrowthTypeExponential = "exponential"
ServiceGrowthTypeExponential indicates exponential growth type in ScalingParams.
const ServiceGrowthTypeLinear = "linear"
ServiceGrowthTypeLinear indicates linear growth type in ScalingParams.
Variables ¶
This section is empty.
Functions ¶
func CompositeTransactionError ¶
func CompositeTransactionError(e ...error) *oaerrors.CompositeError
CompositeTransactionError helper function to aggregate multiple errors when calling multiple operations in transactions.
func CreateEditSection ¶
func CreateEditSection(object interface{}, section parser.Section, pName string, p parser.Parser) error
CreateEditSection creates or updates a section in the parser based on the provided object
func GetBindByName ¶
func GetNameserverByName ¶
func GetPeerEntryByName ¶
func GetServerByName ¶
func GetServerTemplateByPrefix ¶ added in v2.5.1
func ParseBackendSwitchingRule ¶
func ParseBackendSwitchingRule(ub types.UseBackend) *models.BackendSwitchingRule
func ParseHTTPRequestRule ¶
func ParseHTTPRequestRule(f types.Action) (rule *models.HTTPRequestRule, err error)
func ParseHTTPRequestRules ¶
func ParseHTTPResponseRule ¶
func ParseHTTPResponseRule(f types.Action) *models.HTTPResponseRule
func ParseHTTPResponseRules ¶
func ParseLogTargets ¶
func ParseNameserver ¶
func ParseNameserver(p types.Nameserver) *models.Nameserver
func ParseNameservers ¶
func ParsePeerEntries ¶
func ParseResolverSection ¶
func ParseSection ¶
ParseSection sets the fields of the section based on the provided parser
func ParseServerSwitchingRule ¶
func ParseServerSwitchingRule(us types.UseServer) *models.ServerSwitchingRule
func ParseServerTemplate ¶ added in v2.5.1
func ParseServerTemplate(ondiskServerTemplate types.ServerTemplate) *models.ServerTemplate
func ParseServerTemplates ¶ added in v2.5.1
func ParseStickRules ¶
func ParseTCPRequestRule ¶
func ParseTCPRequestRule(f types.TCPType) (rule *models.TCPRequestRule, err error)
func ParseTCPRequestRules ¶
func ParseTCPResponseRule ¶
func ParseTCPResponseRule(t types.TCPType) *models.TCPResponseRule
func ParseTCPResponseRules ¶
func SerializeBackendSwitchingRule ¶
func SerializeBackendSwitchingRule(bRule models.BackendSwitchingRule) types.UseBackend
func SerializeGlobalSection ¶
func SerializeHTTPRequestRule ¶
func SerializeHTTPRequestRule(f models.HTTPRequestRule) (rule types.Action, err error)
func SerializeHTTPResponseRule ¶
func SerializeHTTPResponseRule(f models.HTTPResponseRule) types.Action
func SerializeNameserver ¶
func SerializeNameserver(pe models.Nameserver) types.Nameserver
func SerializePeerSection ¶
func SerializePeerSection(p parser.Parser, data *models.PeerSection) error
func SerializeServerSwitchingRule ¶
func SerializeServerSwitchingRule(sRule models.ServerSwitchingRule) types.UseServer
func SerializeServerTemplate ¶ added in v2.5.1
func SerializeServerTemplate(s models.ServerTemplate) types.ServerTemplate
func SerializeServiceToFrontend ¶
func SerializeServiceToFrontend(service *models.SiteService, name string) *models.Frontend
func SerializeTCPRequestRule ¶
func SerializeTCPRequestRule(f models.TCPRequestRule) (rule types.TCPType, err error)
func SerializeTCPResponseRule ¶
func SerializeTCPResponseRule(t models.TCPResponseRule) types.TCPType
Types ¶
type Client ¶
type Client struct { Transaction Parser parser.Parser // contains filtered or unexported fields }
Client configuration client Parser is the config parser instance that loads "master" configuration file on Init and when transaction is committed it gets replaced with the parser from parsers map. parsers map contains a config parser for each transaction, which loads data from transaction files on StartTransaction, and deletes on CommitTransaction. We save data to file on every change for persistence.
func DefaultClient ¶
DefaultClient returns Client with sane defaults
func (*Client) CommitParser ¶
CommitParser commits transaction parser, deletes it from parsers map, and replaces master Parser
func (*Client) CreateACL ¶
func (c *Client) CreateACL(parentType string, parentName string, data *models.ACL, transactionID string, version int64) error
CreateACL creates a ACL line in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) CreateBackend ¶
CreateBackend creates a backend in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) CreateBackendSwitchingRule ¶
func (c *Client) CreateBackendSwitchingRule(frontend string, data *models.BackendSwitchingRule, transactionID string, version int64) error
CreateBackendSwitchingRule creates a backend switching rule in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) CreateBind ¶
func (c *Client) CreateBind(frontend string, data *models.Bind, transactionID string, version int64) error
CreateBind creates a bind in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) CreateFilter ¶
func (c *Client) CreateFilter(parentType string, parentName string, data *models.Filter, transactionID string, version int64) error
CreateFilter creates a filter in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) CreateFrontend ¶
CreateFrontend creates a frontend in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) CreateHTTPRequestRule ¶
func (c *Client) CreateHTTPRequestRule(parentType string, parentName string, data *models.HTTPRequestRule, transactionID string, version int64) error
CreateHTTPRequestRule creates a http request rule in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) CreateHTTPResponseRule ¶
func (c *Client) CreateHTTPResponseRule(parentType string, parentName string, data *models.HTTPResponseRule, transactionID string, version int64) error
CreateHTTPResponseRule creates a http response rule in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) CreateLogTarget ¶
func (c *Client) CreateLogTarget(parentType string, parentName string, data *models.LogTarget, transactionID string, version int64) error
CreateLogTarget creates a log target in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) CreateNameserver ¶
func (c *Client) CreateNameserver(resolverSection string, data *models.Nameserver, transactionID string, version int64) error
CreateNameserver creates a nameserver in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) CreatePeerEntry ¶
func (c *Client) CreatePeerEntry(peerSection string, data *models.PeerEntry, transactionID string, version int64) error
CreatePeerEntry creates a peer entry in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) CreatePeerSection ¶
func (c *Client) CreatePeerSection(data *models.PeerSection, transactionID string, version int64) error
CreatePeerSection creates a peerSection in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) CreateResolver ¶
CreateResolver creates a resolver in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) CreateServer ¶
func (c *Client) CreateServer(backend string, data *models.Server, transactionID string, version int64) error
CreateServer creates a server in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) CreateServerSwitchingRule ¶
func (c *Client) CreateServerSwitchingRule(backend string, data *models.ServerSwitchingRule, transactionID string, version int64) error
CreateServerSwitchingRule creates a server switching rule in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) CreateServerTemplate ¶ added in v2.5.1
func (c *Client) CreateServerTemplate(backend string, data *models.ServerTemplate, transactionID string, version int64) error
CreateServerTemplate creates a server template in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) CreateSite ¶
CreateSite creates a site in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) CreateStickRule ¶
func (c *Client) CreateStickRule(backend string, data *models.StickRule, transactionID string, version int64) error
CreateStickRule creates a stick rule in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) CreateTCPRequestRule ¶
func (c *Client) CreateTCPRequestRule(parentType string, parentName string, data *models.TCPRequestRule, transactionID string, version int64) error
CreateTCPRequestRule creates a tcp request rule in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) CreateTCPResponseRule ¶
func (c *Client) CreateTCPResponseRule(backend string, data *models.TCPResponseRule, transactionID string, version int64) error
CreateTCPResponseRule creates a tcp response rule in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) DeleteACL ¶
func (c *Client) DeleteACL(id int64, parentType string, parentName string, transactionID string, version int64) error
DeleteACL deletes a ACL line in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) DeleteBackend ¶
DeleteBackend deletes a backend in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) DeleteBackendSwitchingRule ¶
func (c *Client) DeleteBackendSwitchingRule(id int64, frontend string, transactionID string, version int64) error
DeleteBackendSwitchingRule deletes a backend switching rule in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) DeleteBind ¶
func (c *Client) DeleteBind(name string, frontend string, transactionID string, version int64) error
DeleteBind deletes a bind in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) DeleteFilter ¶
func (c *Client) DeleteFilter(id int64, parentType string, parentName string, transactionID string, version int64) error
DeleteFilter deletes a filter in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) DeleteFrontend ¶
DeleteFrontend deletes a frontend in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) DeleteHTTPRequestRule ¶
func (c *Client) DeleteHTTPRequestRule(id int64, parentType string, parentName string, transactionID string, version int64) error
DeleteHTTPRequestRule deletes a http request rule in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) DeleteHTTPResponseRule ¶
func (c *Client) DeleteHTTPResponseRule(id int64, parentType string, parentName string, transactionID string, version int64) error
DeleteHTTPResponseRule deletes a http response rule in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) DeleteLogTarget ¶
func (c *Client) DeleteLogTarget(id int64, parentType string, parentName string, transactionID string, version int64) error
DeleteLogTarget deletes a log target in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) DeleteNameserver ¶
func (c *Client) DeleteNameserver(name string, resolverSection string, transactionID string, version int64) error
DeleteNameserver deletes an nameserver in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) DeleteParser ¶
DeleteParser deletes parser from parsers map
func (*Client) DeletePeerEntry ¶
func (c *Client) DeletePeerEntry(name string, peerSection string, transactionID string, version int64) error
DeletePeerEntry deletes an peer entry in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) DeletePeerSection ¶
DeletePeerSection deletes a peerSection in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) DeleteResolver ¶
DeleteResolver deletes a resolver in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) DeleteServer ¶
func (c *Client) DeleteServer(name string, backend string, transactionID string, version int64) error
DeleteServer deletes a server in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) DeleteServerSwitchingRule ¶
func (c *Client) DeleteServerSwitchingRule(id int64, backend string, transactionID string, version int64) error
DeleteServerSwitchingRule deletes a server switching rule in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) DeleteServerTemplate ¶ added in v2.5.1
func (c *Client) DeleteServerTemplate(prefix string, backend string, transactionID string, version int64) error
DeleteServerTemplate deletes a server template in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) DeleteService ¶ added in v2.2.0
DeleteService removes the Service instance specified by name from the client.
func (*Client) DeleteSite ¶
DeleteSite deletes a site in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) DeleteStickRule ¶
func (c *Client) DeleteStickRule(id int64, backend string, transactionID string, version int64) error
DeleteStickRule deletes a stick rule in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) DeleteTCPRequestRule ¶
func (c *Client) DeleteTCPRequestRule(id int64, parentType string, parentName string, transactionID string, version int64) error
DeleteTCPRequestRule deletes a tcp request rule in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) DeleteTCPResponseRule ¶
func (c *Client) DeleteTCPResponseRule(id int64, backend string, transactionID string, version int64) error
DeleteTCPResponseRule deletes a tcp response rule in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) EditACL ¶
func (c *Client) EditACL(id int64, parentType string, parentName string, data *models.ACL, transactionID string, version int64) error
EditACL edits a ACL line in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success. nolint:dupl
func (*Client) EditBackend ¶
func (c *Client) EditBackend(name string, data *models.Backend, transactionID string, version int64) error
EditBackend edits a backend in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) EditBackendSwitchingRule ¶
func (c *Client) EditBackendSwitchingRule(id int64, frontend string, data *models.BackendSwitchingRule, transactionID string, version int64) error
EditBackendSwitchingRule edits a backend switching rule in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) EditBind ¶
func (c *Client) EditBind(name string, frontend string, data *models.Bind, transactionID string, version int64) error
EditBind edits a bind in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) EditFilter ¶
func (c *Client) EditFilter(id int64, parentType string, parentName string, data *models.Filter, transactionID string, version int64) error
EditFilter edits a filter in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success. nolint:dupl
func (*Client) EditFrontend ¶
func (c *Client) EditFrontend(name string, data *models.Frontend, transactionID string, version int64) error
EditFrontend edits a frontend in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) EditHTTPRequestRule ¶
func (c *Client) EditHTTPRequestRule(id int64, parentType string, parentName string, data *models.HTTPRequestRule, transactionID string, version int64) error
EditHTTPRequestRule edits a http request rule in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success. nolint:dupl
func (*Client) EditHTTPResponseRule ¶
func (c *Client) EditHTTPResponseRule(id int64, parentType string, parentName string, data *models.HTTPResponseRule, transactionID string, version int64) error
EditHTTPResponseRule edits a http response rule in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success. nolint:dupl
func (*Client) EditLogTarget ¶
func (c *Client) EditLogTarget(id int64, parentType string, parentName string, data *models.LogTarget, transactionID string, version int64) error
EditLogTarget edits a log target in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success. nolint:dupl
func (*Client) EditNameserver ¶
func (c *Client) EditNameserver(name string, resolverSection string, data *models.Nameserver, transactionID string, version int64) error
EditNameserver edits a nameserver in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) EditPeerEntry ¶
func (c *Client) EditPeerEntry(name string, peerSection string, data *models.PeerEntry, transactionID string, version int64) error
EditPeerEntry edits a peer entry in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) EditResolver ¶
func (c *Client) EditResolver(name string, data *models.Resolver, transactionID string, version int64) error
EditResolver edits a resolver in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) EditServer ¶
func (c *Client) EditServer(name string, backend string, data *models.Server, transactionID string, version int64) error
EditServer edits a server in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) EditServerSwitchingRule ¶
func (c *Client) EditServerSwitchingRule(id int64, backend string, data *models.ServerSwitchingRule, transactionID string, version int64) error
EditServerSwitchingRule edits a server switching rule in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) EditServerTemplate ¶ added in v2.5.1
func (c *Client) EditServerTemplate(prefix string, backend string, data *models.ServerTemplate, transactionID string, version int64) error
EditServerTemplate edits a server template in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) EditSite ¶
func (c *Client) EditSite(name string, data *models.Site, transactionID string, version int64) error
EditSite edits a site in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) EditStickRule ¶
func (c *Client) EditStickRule(id int64, backend string, data *models.StickRule, transactionID string, version int64) error
EditStickRule edits a stick rule in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) EditTCPRequestRule ¶
func (c *Client) EditTCPRequestRule(id int64, parentType string, parentName string, data *models.TCPRequestRule, transactionID string, version int64) error
EditTCPRequestRule edits a tcp request rule in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success. nolint:dupl
func (*Client) EditTCPResponseRule ¶
func (c *Client) EditTCPResponseRule(id int64, backend string, data *models.TCPResponseRule, transactionID string, version int64) error
EditTCPResponseRule edits a tcp response rule in configuration. One of version or transactionID is mandatory. Returns error on fail, nil on success.
func (*Client) GetACL ¶
func (c *Client) GetACL(id int64, parentType, parentName string, transactionID string) (int64, *models.ACL, error)
GetACL returns configuration version and a requested ACL line in the specified parent. Returns error on fail or if ACL line does not exist.
func (*Client) GetACLs ¶
func (c *Client) GetACLs(parentType, parentName string, transactionID string, aclName ...string) (int64, models.Acls, error)
GetACLs returns configuration version and an array of configured ACL lines in the specified parent. Returns error on fail.
func (*Client) GetBackend ¶
GetBackend returns configuration version and a requested backend. Returns error on fail or if backend does not exist.
func (*Client) GetBackendSwitchingRule ¶
func (c *Client) GetBackendSwitchingRule(id int64, frontend string, transactionID string) (int64, *models.BackendSwitchingRule, error)
GetBackendSwitchingRule returns configuration version and a requested backend switching rule in the specified frontend. Returns error on fail or if backend switching rule does not exist.
func (*Client) GetBackendSwitchingRules ¶
func (c *Client) GetBackendSwitchingRules(frontend string, transactionID string) (int64, models.BackendSwitchingRules, error)
GetBackendSwitchingRules returns configuration version and an array of configured backend switching rules in the specified frontend. Returns error on fail.
func (*Client) GetBackends ¶
GetBackends returns configuration version and an array of configured backends. Returns error on fail.
func (*Client) GetBind ¶
func (c *Client) GetBind(name string, frontend string, transactionID string) (int64, *models.Bind, error)
GetBind returns configuration version and a requested bind in the specified frontend. Returns error on fail or if bind does not exist.
func (*Client) GetBinds ¶
GetBinds returns configuration version and an array of configured binds in the specified frontend. Returns error on fail.
func (*Client) GetConfigurationVersion ¶ added in v2.2.0
GetConfigurationVersion returns configuration version
func (*Client) GetDefaultsConfiguration ¶
GetDefaultsConfiguration returns configuration version and a struct representing Defaults configuration
func (*Client) GetFailedParserTransactionVersion ¶ added in v2.2.0
func (*Client) GetFilter ¶
func (c *Client) GetFilter(id int64, parentType, parentName string, transactionID string) (int64, *models.Filter, error)
GetFilter returns configuration version and a requested filter in the specified parent. Returns error on fail or if filter does not exist.
func (*Client) GetFilters ¶
func (c *Client) GetFilters(parentType, parentName string, transactionID string) (int64, models.Filters, error)
GetFilters returns configuration version and an array of configured filters in the specified parent. Returns error on fail.
func (*Client) GetFrontend ¶
GetFrontend returns configuration version and a requested frontend. Returns error on fail or if frontend does not exist.
func (*Client) GetFrontends ¶
GetFrontends returns configuration version and an array of configured frontends. Returns error on fail.
func (*Client) GetGlobalConfiguration ¶
GetGlobalConfiguration returns configuration version and a struct representing Global configuration
func (*Client) GetHTTPRequestRule ¶
func (c *Client) GetHTTPRequestRule(id int64, parentType, parentName string, transactionID string) (int64, *models.HTTPRequestRule, error)
GetHTTPRequestRule returns configuration version and a requested http request rule in the specified parent. Returns error on fail or if http request rule does not exist.
func (*Client) GetHTTPRequestRules ¶
func (c *Client) GetHTTPRequestRules(parentType, parentName string, transactionID string) (int64, models.HTTPRequestRules, error)
GetHTTPRequestRules returns configuration version and an array of configured http request rules in the specified parent. Returns error on fail.
func (*Client) GetHTTPResponseRule ¶
func (c *Client) GetHTTPResponseRule(id int64, parentType, parentName string, transactionID string) (int64, *models.HTTPResponseRule, error)
GetHTTPResponseRule returns configuration version and a response http response rule in the specified parent. Returns error on fail or if http response rule does not exist.
func (*Client) GetHTTPResponseRules ¶
func (c *Client) GetHTTPResponseRules(parentType, parentName string, transactionID string) (int64, models.HTTPResponseRules, error)
GetHTTPResponseRules returns configuration version and an array of configured http response rules in the specified parent. Returns error on fail.
func (*Client) GetLogTarget ¶
func (c *Client) GetLogTarget(id int64, parentType, parentName string, transactionID string) (int64, *models.LogTarget, error)
GetLogTarget returns configuration version and a requested log target in the specified parent. Returns error on fail or if log target does not exist.
func (*Client) GetLogTargets ¶
func (c *Client) GetLogTargets(parentType, parentName string, transactionID string) (int64, models.LogTargets, error)
GetLogTargets returns configuration version and an array of configured log targets in the specified parent. Returns error on fail.
func (*Client) GetNameserver ¶
func (c *Client) GetNameserver(name string, resolverSection string, transactionID string) (int64, *models.Nameserver, error)
GetNameserver returns configuration version and a requested nameserver in the specified resolvers section. Returns error on fail or if nameserver does not exist.
func (*Client) GetNameservers ¶
func (c *Client) GetNameservers(resolverSection string, transactionID string) (int64, models.Nameservers, error)
GetNameservers returns configuration version and an array of configured namservers in the specified resolvers section. Returns error on fail.
func (*Client) GetParser ¶
GetParser returns a parser for given transactionID, if transactionID is "", it returns "master" parser
func (*Client) GetParserTransactions ¶ added in v2.2.0
func (c *Client) GetParserTransactions() models.Transactions
GetParserTransactions returns parser transactions
func (*Client) GetPeerEntries ¶
func (c *Client) GetPeerEntries(peerSection string, transactionID string) (int64, models.PeerEntries, error)
GetPeerEntries returns configuration version and an array of configured binds in the specified peers section. Returns error on fail.
func (*Client) GetPeerEntry ¶
func (c *Client) GetPeerEntry(name string, peerSection string, transactionID string) (int64, *models.PeerEntry, error)
GetPeerEntry returns configuration version and a requested peer entry in the specified peer section. Returns error on fail or if bind does not exist.
func (*Client) GetPeerSection ¶
func (c *Client) GetPeerSection(name string, transactionID string) (int64, *models.PeerSection, error)
GetPeerSection returns configuration version and a requested peer section. Returns error on fail or if peer section does not exist.
func (*Client) GetPeerSections ¶
GetPeerSections returns configuration version and an array of configured peer sections. Returns error on fail.
func (*Client) GetRawConfiguration ¶
GetRawConfiguration returns configuration version and a string containing raw config file
func (*Client) GetResolver ¶
GetResolver returns configuration version and a requested resolver. Returns error on fail or if resolver does not exist.
func (*Client) GetResolvers ¶
GetResolvers returns configuration version and an array of configured resolvers. Returns error on fail.
func (*Client) GetServer ¶
func (c *Client) GetServer(name string, backend string, transactionID string) (int64, *models.Server, error)
GetServer returns configuration version and a requested server in the specified backend. Returns error on fail or if server does not exist.
func (*Client) GetServerSwitchingRule ¶
func (c *Client) GetServerSwitchingRule(id int64, backend string, transactionID string) (int64, *models.ServerSwitchingRule, error)
GetServerSwitchingRule returns configuration version and a requested server switching rule in the specified backend. Returns error on fail or if server switching rule does not exist.
func (*Client) GetServerSwitchingRules ¶
func (c *Client) GetServerSwitchingRules(backend string, transactionID string) (int64, models.ServerSwitchingRules, error)
GetServerSwitchingRules returns configuration version and an array of configured server switching rules in the specified backend. Returns error on fail.
func (*Client) GetServerTemplate ¶ added in v2.5.1
func (c *Client) GetServerTemplate(prefix string, backend string, transactionID string) (int64, *models.ServerTemplate, error)
GetServerTemplate returns configuration version and a requested server template in the specified backend. Returns error on fail or if server template does not exist.
func (*Client) GetServerTemplates ¶ added in v2.5.1
func (c *Client) GetServerTemplates(backend string, transactionID string) (int64, models.ServerTemplates, error)
GetServerTemplatess returns configuration version and an array of configured server templates in the specified backend. Returns error on fail.
func (*Client) GetServers ¶
GetServers returns configuration version and an array of configured servers in the specified backend. Returns error on fail.
func (*Client) GetSite ¶
GetSite returns configuration version and a requested site. Returns error on fail or if backend does not exist.
func (*Client) GetSites ¶
GetSites returns configuration version and an array of configured sites. Returns error on fail.
func (*Client) GetStickRule ¶
func (c *Client) GetStickRule(id int64, backend string, transactionID string) (int64, *models.StickRule, error)
GetStickRule returns configuration version and a requested stick rule in the specified backend. Returns error on fail or if stick rule does not exist.
func (*Client) GetStickRules ¶
func (c *Client) GetStickRules(backend string, transactionID string) (int64, models.StickRules, error)
GetStickRules returns configuration version and an array of configured stick rules in the specified backend. Returns error on fail.
func (*Client) GetTCPRequestRule ¶
func (c *Client) GetTCPRequestRule(id int64, parentType, parentName string, transactionID string) (int64, *models.TCPRequestRule, error)
GetTCPRequestRule returns configuration version and a requested tcp request rule in the specified parent. Returns error on fail or if http request rule does not exist.
func (*Client) GetTCPRequestRules ¶
func (c *Client) GetTCPRequestRules(parentType, parentName string, transactionID string) (int64, models.TCPRequestRules, error)
GetTCPRequestRules returns configuration version and an array of configured TCP request rules in the specified parent. Returns error on fail.
func (*Client) GetTCPResponseRule ¶
func (c *Client) GetTCPResponseRule(id int64, backend string, transactionID string) (int64, *models.TCPResponseRule, error)
GetTCPResponseRule returns configuration version and a requested tcp response rule in the specified backend. Returns error on fail or if tcp response rule does not exist.
func (*Client) GetTCPResponseRules ¶
func (c *Client) GetTCPResponseRules(backend string, transactionID string) (int64, models.TCPResponseRules, error)
GetTCPResponseRules returns configuration version and an array of configured tcp response rules in the specified backend. Returns error on fail.
func (*Client) GetVersion ¶
GetVersion returns configuration file version
func (*Client) IncrementTransactionVersion ¶ added in v2.3.0
func (*Client) IncrementVersion ¶ added in v2.2.0
func (*Client) InitTransactionParsers ¶
InitTransactionParsers checks transactions and initializes parsers map with transactions in_progress
func (*Client) NewService ¶ added in v2.2.0
func (c *Client) NewService(name string, scaling ScalingParams) (*Service, error)
NewService creates and returns a new Service instance. name indicates the name of the service and only one Service instance with the given name can be created.
func (*Client) PostRawConfiguration ¶
func (c *Client) PostRawConfiguration(config *string, version int64, skipVersionCheck bool, onlyValidate ...bool) error
PostRawConfiguration pushes given string to the config file if the version matches
func (*Client) PushDefaultsConfiguration ¶
func (c *Client) PushDefaultsConfiguration(data *models.Defaults, transactionID string, version int64) error
PushDefaultsConfiguration pushes a Defaults config struct to global config file
type ClientParams ¶
type ClientParams struct { ConfigurationFile string Haproxy string TransactionDir string BackupsNumber int UseValidation bool PersistentTransactions bool ValidateConfigurationFile bool MasterWorker bool SkipFailedTransactions bool UseMd5Hash bool // ValidateCmd allows specifying a custom script to validate the transaction file. // The injected environment variable DATAPLANEAPI_TRANSACTION_FILE must be used to get the location of the file. ValidateCmd string ValidateConfigFilesBefore []string ValidateConfigFilesAfter []string }
ClientParams is just a placeholder for all client options
type ConfError ¶
type ConfError struct {
// contains filtered or unexported fields
}
ConfError general configuration client error
func NewConfError ¶
NewConfError constructor for ConfError
type ScalingParams ¶ added in v2.2.0
ScalingParams defines parameter for dynamic server scaling of the Service backend.
type SectionObject ¶ added in v2.2.0
type SectionObject struct { Object interface{} Section parser.Section Name string Parser parser.Parser }
SectionObject represents a configuration section
func (*SectionObject) CreateEditSection ¶ added in v2.2.0
func (s *SectionObject) CreateEditSection() error
CreateEditSection creates or updates a section in the parser based on the provided object
type SectionParser ¶ added in v2.2.0
type SectionParser struct { Object interface{} Section parser.Section Name string Parser parser.Parser }
SectionParser is used set fields of a section based on the provided parser
func (*SectionParser) Parse ¶ added in v2.2.0
func (s *SectionParser) Parse() error
Parse parses the sections fields and sets their values with the data from the parser
type Service ¶ added in v2.2.0
type Service struct {
// contains filtered or unexported fields
}
Service represents the maping from a discovery service into a configuration backend.
func (*Service) Delete ¶ added in v2.2.0
Delete removes the service from the client with all the associated configuration resources.
func (*Service) GetServers ¶ added in v2.2.0
GetServers returns the list of servers as they are currently configured in the services backend
func (*Service) Init ¶ added in v2.2.0
Init initiates the client by reading the configuration associated with it or created the initial configuration if it does not exist.
func (*Service) SetTransactionID ¶ added in v2.2.0
SetTransactionID updates the transaction ID to be used for modifications on the configuration associated with the service.
func (*Service) Update ¶ added in v2.2.0
func (s *Service) Update(servers []ServiceServer) (bool, error)
Update updates the backend associated with the server based on the list of servers provided
func (*Service) UpdateScalingParams ¶ added in v2.2.0
func (s *Service) UpdateScalingParams(scaling ScalingParams) error
UpdateScalingParams updates parameters used for dynamic server scaling of the Service backend
type ServiceServer ¶ added in v2.2.0
ServiceServer contains information for one server in the service.
type Transaction ¶ added in v2.2.0
type Transaction struct { ClientParams TransactionClient TransactionClient // contains filtered or unexported fields }
func (*Transaction) CheckTransactionOrVersion ¶ added in v2.2.0
func (t *Transaction) CheckTransactionOrVersion(transactionID string, version int64) (string, error)
func (*Transaction) CommitTransaction ¶ added in v2.2.0
func (t *Transaction) CommitTransaction(transactionID string) (*models.Transaction, error)
CommitTransaction commits a transaction by id.
func (*Transaction) DeleteTransaction ¶ added in v2.2.0
func (t *Transaction) DeleteTransaction(transactionID string) error
DeleteTransaction deletes a transaction by id.
func (*Transaction) ErrAndDeleteTransaction ¶ added in v2.2.0
func (t *Transaction) ErrAndDeleteTransaction(err error, tID string) error
func (*Transaction) GetTransaction ¶ added in v2.2.0
func (t *Transaction) GetTransaction(transactionID string) (*models.Transaction, error)
GetTransaction returns transaction information by id
func (*Transaction) GetTransactionFile ¶ added in v2.2.0
func (t *Transaction) GetTransactionFile(transactionID string) (string, error)
func (*Transaction) GetTransactions ¶ added in v2.2.0
func (t *Transaction) GetTransactions(status string) (*models.Transactions, error)
GetTransactions returns an array of transactions
func (*Transaction) HandleError ¶ added in v2.2.0
func (t *Transaction) HandleError(id, parentType, parentName, transactionID string, implicit bool, err error) error
func (*Transaction) MarkTransactionOutdated ¶ added in v2.3.0
func (t *Transaction) MarkTransactionOutdated(transactionID string) (err error)
MarkTransactionOutdated is marking the transaction by ID as outdated due to a newer commit, moving it to the `outdated` folder, as well cleaning from the current parsers.
func (*Transaction) SaveData ¶ added in v2.2.0
func (t *Transaction) SaveData(prsr interface{}, tID string, commitImplicit bool) error
func (*Transaction) StartTransaction ¶ added in v2.2.0
func (t *Transaction) StartTransaction(version int64) (*models.Transaction, error)
StartTransaction starts a new empty lbctl transaction
type TransactionClient ¶ added in v2.2.0
type TransactionClient interface { GetVersion(transactionID string) (int64, error) AddParser(transactionID string) error CommitParser(transactionID string) error DeleteParser(transactionID string) error IncrementTransactionVersion(transactionID string) error LoadData(filename string) error Save(transactionFile, transactionID string) error HasParser(transactionID string) bool GetParserTransactions() models.Transactions GetFailedParserTransactionVersion(transactionID string) (int64, error) CheckTransactionOrVersion(transactionID string, version int64) (string, error) }
Source Files ¶
- acl.go
- backend.go
- backend_switching_rule.go
- bind.go
- configuration.go
- defaults.go
- errors.go
- filter.go
- frontend.go
- global.go
- http_request_rule.go
- http_response_rule.go
- log_target.go
- nameserver.go
- peer_entry.go
- peer_section.go
- raw.go
- resolver.go
- server.go
- server_switching_rule.go
- server_template.go
- service.go
- site.go
- stick_rule.go
- tcp_request_rule.go
- tcp_response_rule.go
- transaction.go
- version.go