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 GetGroupByName(name string, userlist string, p parser.Parser) (*models.Group, 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 GetUserByUsername(username string, userlist string, p parser.Parser) (*models.User, 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 ParseCacheSection(p parser.Parser, cache *models.Cache) error
- func ParseDeclareCapture(f types.DeclareCapture) *models.Capture
- func ParseDeclareCaptures(frontend string, p parser.Parser) (models.Captures, 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 ParseGroup(u types.Group) *models.Group
- func ParseGroups(userlist string, p parser.Parser) (models.Groups, error)
- func ParseHTTPCheck(f types.Action) (check *models.HTTPCheck, err error)
- func ParseHTTPChecks(t, pName string, p parser.Parser) (models.HTTPChecks, 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 ParseTCPCheck(f types.Action) (check *models.TCPCheck, err error)
- func ParseTCPChecks(t, pName string, p parser.Parser) (models.TCPChecks, 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 ParseUser(u types.User) *models.User
- func ParseUsers(userlist string, p parser.Parser) (models.Users, error)
- func SerializeACL(f models.ACL) types.ACL
- func SerializeBackendSwitchingRule(bRule models.BackendSwitchingRule) types.UseBackend
- func SerializeBind(b models.Bind) types.Bind
- func SerializeCacheSection(p parser.Parser, data *models.Cache) error
- func SerializeDeclareCapture(f models.Capture) types.DeclareCapture
- func SerializeFarmToBackend(farm *models.SiteFarm) *models.Backend
- func SerializeFilter(f models.Filter) types.Filter
- func SerializeGlobalSection(p parser.Parser, data *models.Global) error
- func SerializeGroup(u models.Group) types.Group
- func SerializeHTTPCheck(f models.HTTPCheck) (action types.Action, err error)
- func SerializeHTTPRequestRule(f models.HTTPRequestRule) (rule types.Action, err error)
- func SerializeHTTPResponseRule(f models.HTTPResponseRule) (rule types.Action, err error)
- 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 SerializeTCPCheck(f models.TCPCheck) (action types.Action, err error)
- func SerializeTCPRequestRule(f models.TCPRequestRule) (rule types.TCPType, err error)
- func SerializeTCPResponseRule(t models.TCPResponseRule) types.TCPType
- func SerializeUser(u models.User) types.User
- type ACL
- type Backend
- type Bind
- type Cache
- type Capture
- type ClientParams
- type ConfError
- type Configuration
- type Counter
- type Defaults
- type Filter
- type Frontend
- type Global
- type Group
- type HTTPCheck
- type HTTPRequestRule
- type HTTPResponseRule
- type LogTarget
- type Nameserver
- type Parser
- type PeerEntry
- type PeerSection
- type Raw
- type Resolver
- type ScalingParams
- type SectionObject
- type SectionParser
- type Server
- type ServerTemplate
- 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 ServiceI
- type ServiceServer
- type Site
- type StickRule
- type TCPCheck
- type TCPRequestRule
- type TCPResponseRule
- 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
- type TransactionHandling
- type Transactions
- type User
- type Userlist
- type Version
Constants ¶
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 GetGroupByName ¶ added in v3.1.0
func GetNameserverByName ¶
func GetPeerEntryByName ¶
func GetServerByName ¶
func GetUserByUsername ¶ added in v3.1.0
func ParseBackendSwitchingRule ¶
func ParseBackendSwitchingRule(ub types.UseBackend) *models.BackendSwitchingRule
func ParseDeclareCapture ¶
func ParseDeclareCapture(f types.DeclareCapture) *models.Capture
func ParseDeclareCaptures ¶
func ParseGroups ¶ added in v3.1.0
func ParseHTTPChecks ¶
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 ¶
func ParseServerTemplate(ondiskServerTemplate types.ServerTemplate) *models.ServerTemplate
func ParseServerTemplates ¶
func ParseStickRules ¶
func ParseTCPChecks ¶
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 ParseUsers ¶ added in v3.1.0
func SerializeBackendSwitchingRule ¶
func SerializeBackendSwitchingRule(bRule models.BackendSwitchingRule) types.UseBackend
func SerializeDeclareCapture ¶
func SerializeDeclareCapture(f models.Capture) types.DeclareCapture
func SerializeGlobalSection ¶
func SerializeHTTPCheck ¶
func SerializeHTTPRequestRule ¶
func SerializeHTTPRequestRule(f models.HTTPRequestRule) (rule types.Action, err error)
func SerializeHTTPResponseRule ¶
func SerializeHTTPResponseRule(f models.HTTPResponseRule) (rule types.Action, err error)
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 ¶
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 ACL ¶
type ACL interface { GetACLs(parentType, parentName string, transactionID string, aclName ...string) (int64, models.Acls, error) GetACL(id int64, parentType, parentName string, transactionID string) (int64, *models.ACL, error) DeleteACL(id int64, parentType string, parentName string, transactionID string, version int64) error CreateACL(parentType string, parentName string, data *models.ACL, transactionID string, version int64) error EditACL(id int64, parentType string, parentName string, data *models.ACL, transactionID string, version int64) error }
type Backend ¶
type Backend interface { GetBackends(transactionID string) (int64, models.Backends, error) GetBackend(name string, transactionID string) (int64, *models.Backend, error) DeleteBackend(name string, transactionID string, version int64) error CreateBackend(data *models.Backend, transactionID string, version int64) error EditBackend(name string, data *models.Backend, transactionID string, version int64) error GetBackendSwitchingRules(frontend string, transactionID string) (int64, models.BackendSwitchingRules, error) GetBackendSwitchingRule(id int64, frontend string, transactionID string) (int64, *models.BackendSwitchingRule, error) DeleteBackendSwitchingRule(id int64, frontend string, transactionID string, version int64) error CreateBackendSwitchingRule(frontend string, data *models.BackendSwitchingRule, transactionID string, version int64) error EditBackendSwitchingRule(id int64, frontend string, data *models.BackendSwitchingRule, transactionID string, version int64) error }
type Bind ¶
type Bind interface { GetBinds(frontend string, transactionID string) (int64, models.Binds, error) GetBind(name string, frontend string, transactionID string) (int64, *models.Bind, error) DeleteBind(name string, frontend string, transactionID string, version int64) error CreateBind(frontend string, data *models.Bind, transactionID string, version int64) error EditBind(name string, frontend string, data *models.Bind, transactionID string, version int64) error }
type Cache ¶
type Cache interface { GetCaches(transactionID string) (int64, models.Caches, error) GetCache(name string, transactionID string) (int64, *models.Cache, error) DeleteCache(name string, transactionID string, version int64) error EditCache(name string, data *models.Cache, transactionID string, version int64) error CreateCache(data *models.Cache, transactionID string, version int64) error }
type Capture ¶
type Capture interface { GetDeclareCaptures(frontend string, transactionID string) (int64, models.Captures, error) GetDeclareCapture(index int64, frontend string, transactionID string) (int64, *models.Capture, error) DeleteDeclareCapture(index int64, frontend string, transactionID string, version int64) error CreateDeclareCapture(frontend string, data *models.Capture, transactionID string, version int64) error EditDeclareCapture(index int64, frontend string, data *models.Capture, transactionID string, version int64) error }
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 Configuration ¶
type Configuration interface { Parser ACL Backend Bind Cache Capture Defaults Frontend Filter Global HTTPCheck HTTPRequestRule HTTPResponseRule LogTarget Nameserver PeerEntry PeerSection Raw Resolver Server ServerTemplate Site StickRule ServiceI TCPCheck TCPRequestRule TCPResponseRule Transactions TransactionHandling Version Userlist User Group }
func New ¶
func New(ctx context.Context, opt ...options.ConfigurationOption) (Configuration, error)
type Filter ¶
type Filter interface { GetFilters(parentType, parentName string, transactionID string) (int64, models.Filters, error) GetFilter(id int64, parentType, parentName string, transactionID string) (int64, *models.Filter, error) DeleteFilter(id int64, parentType string, parentName string, transactionID string, version int64) error CreateFilter(parentType string, parentName string, data *models.Filter, transactionID string, version int64) error EditFilter(id int64, parentType string, parentName string, data *models.Filter, transactionID string, version int64) error }
type Frontend ¶
type Frontend interface { GetFrontends(transactionID string) (int64, models.Frontends, error) GetFrontend(name string, transactionID string) (int64, *models.Frontend, error) DeleteFrontend(name string, transactionID string, version int64) error EditFrontend(name string, data *models.Frontend, transactionID string, version int64) error CreateFrontend(data *models.Frontend, transactionID string, version int64) error }
type Group ¶ added in v3.1.0
type Group interface { GetGroups(userlist string, transactionID string) (int64, models.Groups, error) GetGroup(name string, userlist string, transactionID string) (int64, *models.Group, error) DeleteGroup(name string, userlist string, transactionID string, version int64) error CreateGroup(userlist string, data *models.Group, transactionID string, version int64) error EditGroup(name string, userlist string, data *models.Group, transactionID string, version int64) error }
type HTTPCheck ¶
type HTTPCheck interface { GetHTTPChecks(parentType, parentName string, transactionID string) (int64, models.HTTPChecks, error) GetHTTPCheck(id int64, parentType string, parentName string, transactionID string) (int64, *models.HTTPCheck, error) DeleteHTTPCheck(id int64, parentType string, parentName string, transactionID string, version int64) error CreateHTTPCheck(parentType string, parentName string, data *models.HTTPCheck, transactionID string, version int64) error EditHTTPCheck(id int64, parentType string, parentName string, data *models.HTTPCheck, transactionID string, version int64) error }
type HTTPRequestRule ¶
type HTTPRequestRule interface { GetHTTPRequestRules(parentType, parentName string, transactionID string) (int64, models.HTTPRequestRules, error) GetHTTPRequestRule(id int64, parentType, parentName string, transactionID string) (int64, *models.HTTPRequestRule, error) DeleteHTTPRequestRule(id int64, parentType string, parentName string, transactionID string, version int64) error CreateHTTPRequestRule(parentType string, parentName string, data *models.HTTPRequestRule, transactionID string, version int64) error EditHTTPRequestRule(id int64, parentType string, parentName string, data *models.HTTPRequestRule, transactionID string, version int64) error }
type HTTPResponseRule ¶
type HTTPResponseRule interface { GetHTTPResponseRules(parentType, parentName string, transactionID string) (int64, models.HTTPResponseRules, error) GetHTTPResponseRule(id int64, parentType, parentName string, transactionID string) (int64, *models.HTTPResponseRule, error) DeleteHTTPResponseRule(id int64, parentType string, parentName string, transactionID string, version int64) error CreateHTTPResponseRule(parentType string, parentName string, data *models.HTTPResponseRule, transactionID string, version int64) error EditHTTPResponseRule(id int64, parentType string, parentName string, data *models.HTTPResponseRule, transactionID string, version int64) error }
type LogTarget ¶
type LogTarget interface { GetLogTargets(parentType, parentName string, transactionID string) (int64, models.LogTargets, error) GetLogTarget(id int64, parentType, parentName string, transactionID string) (int64, *models.LogTarget, error) DeleteLogTarget(id int64, parentType string, parentName string, transactionID string, version int64) error CreateLogTarget(parentType string, parentName string, data *models.LogTarget, transactionID string, version int64) error EditLogTarget(id int64, parentType string, parentName string, data *models.LogTarget, transactionID string, version int64) error }
type Nameserver ¶
type Nameserver interface { GetNameservers(resolverSection string, transactionID string) (int64, models.Nameservers, error) GetNameserver(name string, resolverSection string, transactionID string) (int64, *models.Nameserver, error) DeleteNameserver(name string, resolverSection string, transactionID string, version int64) error CreateNameserver(resolverSection string, data *models.Nameserver, transactionID string, version int64) error EditNameserver(name string, resolverSection string, data *models.Nameserver, transactionID string, version int64) error }
type Parser ¶
type Parser interface { Parser() parser.Parser HasParser(transactionID string) bool GetParser(transactionID string) (parser.Parser, error) AddParser(transactionID string) error DeleteParser(transactionID string) error CommitParser(transactionID string) error GetVersion(transactionID string) (int64, error) IncrementVersion() error LoadData(filename string) error Save(transactionFile, transactionID string) error }
type PeerEntry ¶
type PeerEntry interface { GetPeerEntries(peerSection string, transactionID string) (int64, models.PeerEntries, error) GetPeerEntry(name string, peerSection string, transactionID string) (int64, *models.PeerEntry, error) DeletePeerEntry(name string, peerSection string, transactionID string, version int64) error CreatePeerEntry(peerSection string, data *models.PeerEntry, transactionID string, version int64) error EditPeerEntry(name string, peerSection string, data *models.PeerEntry, transactionID string, version int64) error }
type PeerSection ¶
type PeerSection interface { GetPeerSections(transactionID string) (int64, models.PeerSections, error) GetPeerSection(name string, transactionID string) (int64, *models.PeerSection, error) DeletePeerSection(name string, transactionID string, version int64) error CreatePeerSection(data *models.PeerSection, transactionID string, version int64) error }
type Resolver ¶
type Resolver interface { GetResolvers(transactionID string) (int64, models.Resolvers, error) GetResolver(name string, transactionID string) (int64, *models.Resolver, error) DeleteResolver(name string, transactionID string, version int64) error EditResolver(name string, data *models.Resolver, transactionID string, version int64) error CreateResolver(data *models.Resolver, transactionID string, version int64) error }
type ScalingParams ¶
ScalingParams defines parameter for dynamic server scaling of the Service backend.
type SectionObject ¶
type SectionObject struct { Object interface{} Section parser.Section Name string Parser parser.Parser }
SectionObject represents a configuration section
func (*SectionObject) CreateEditSection ¶
func (s *SectionObject) CreateEditSection() error
CreateEditSection creates or updates a section in the parser based on the provided object
type SectionParser ¶
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 ¶
func (s *SectionParser) Parse() error
Parse parses the sections fields and sets their values with the data from the parser
type Server ¶
type Server interface { GetServers(backend string, transactionID string) (int64, models.Servers, error) GetServer(name string, backend string, transactionID string) (int64, *models.Server, error) DeleteServer(name string, backend string, transactionID string, version int64) error CreateServer(backend string, data *models.Server, transactionID string, version int64) error EditServer(name string, backend string, data *models.Server, transactionID string, version int64) error GetServerSwitchingRules(backend string, transactionID string) (int64, models.ServerSwitchingRules, error) GetServerSwitchingRule(id int64, backend string, transactionID string) (int64, *models.ServerSwitchingRule, error) DeleteServerSwitchingRule(id int64, backend string, transactionID string, version int64) error CreateServerSwitchingRule(backend string, data *models.ServerSwitchingRule, transactionID string, version int64) error EditServerSwitchingRule(id int64, backend string, data *models.ServerSwitchingRule, transactionID string, version int64) error }
type ServerTemplate ¶
type ServerTemplate interface { GetServerTemplates(backend string, transactionID string) (int64, models.ServerTemplates, error) GetServerTemplate(prefix string, backend string, transactionID string) (int64, *models.ServerTemplate, error) DeleteServerTemplate(prefix string, backend string, transactionID string, version int64) error CreateServerTemplate(backend string, data *models.ServerTemplate, transactionID string, version int64) error EditServerTemplate(prefix string, backend string, data *models.ServerTemplate, transactionID string, version int64) error }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service represents the maping from a discovery service into a configuration backend.
func (*Service) Delete ¶
Delete removes the service from the client with all the associated configuration resources.
func (*Service) GetServers ¶
GetServers returns the list of servers as they are currently configured in the services backend
func (*Service) Init ¶
Init initiates the client by reading the configuration associated with it or created the initial configuration if it does not exist.
func (*Service) SetTransactionID ¶
SetTransactionID updates the transaction ID to be used for modifications on the configuration associated with the service.
func (*Service) Update ¶
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 ¶
func (s *Service) UpdateScalingParams(scaling ScalingParams) error
UpdateScalingParams updates parameters used for dynamic server scaling of the Service backend
type ServiceI ¶
type ServiceI interface { NewService(name string, scaling ScalingParams) (*Service, error) DeleteService(name string) }
type ServiceServer ¶
ServiceServer contains information for one server in the service.
type Site ¶
type Site interface { GetSites(transactionID string) (int64, models.Sites, error) GetSite(name string, transactionID string) (int64, *models.Site, error) CreateSite(data *models.Site, transactionID string, version int64) error EditSite(name string, data *models.Site, transactionID string, version int64) error DeleteSite(name string, transactionID string, version int64) error }
type StickRule ¶
type StickRule interface { GetStickRules(backend string, transactionID string) (int64, models.StickRules, error) GetStickRule(id int64, backend string, transactionID string) (int64, *models.StickRule, error) DeleteStickRule(id int64, backend string, transactionID string, version int64) error CreateStickRule(backend string, data *models.StickRule, transactionID string, version int64) error EditStickRule(id int64, backend string, data *models.StickRule, transactionID string, version int64) error }
type TCPCheck ¶
type TCPCheck interface { GetTCPChecks(parentType, parentName string, transactionID string) (int64, models.TCPChecks, error) GetTCPCheck(id int64, parentType string, parentName string, transactionID string) (int64, *models.TCPCheck, error) DeleteTCPCheck(id int64, parentType string, parentName string, transactionID string, version int64) error CreateTCPCheck(parentType string, parentName string, data *models.TCPCheck, transactionID string, version int64) error EditTCPCheck(id int64, parentType string, parentName string, data *models.TCPCheck, transactionID string, version int64) error }
type TCPRequestRule ¶
type TCPRequestRule interface { GetTCPRequestRules(parentType, parentName string, transactionID string) (int64, models.TCPRequestRules, error) GetTCPRequestRule(id int64, parentType, parentName string, transactionID string) (int64, *models.TCPRequestRule, error) DeleteTCPRequestRule(id int64, parentType string, parentName string, transactionID string, version int64) error CreateTCPRequestRule(parentType string, parentName string, data *models.TCPRequestRule, transactionID string, version int64) error EditTCPRequestRule(id int64, parentType string, parentName string, data *models.TCPRequestRule, transactionID string, version int64) error }
type TCPResponseRule ¶
type TCPResponseRule interface { GetTCPResponseRules(backend string, transactionID string) (int64, models.TCPResponseRules, error) GetTCPResponseRule(id int64, backend string, transactionID string) (int64, *models.TCPResponseRule, error) DeleteTCPResponseRule(id int64, backend string, transactionID string, version int64) error CreateTCPResponseRule(backend string, data *models.TCPResponseRule, transactionID string, version int64) error EditTCPResponseRule(id int64, backend string, data *models.TCPResponseRule, transactionID string, version int64) error }
type Transaction ¶
type Transaction struct { options.ConfigurationOptions TransactionClient TransactionClient // contains filtered or unexported fields }
func (*Transaction) CheckTransactionOrVersion ¶
func (t *Transaction) CheckTransactionOrVersion(transactionID string, version int64) (string, error)
func (*Transaction) CommitTransaction ¶
func (t *Transaction) CommitTransaction(transactionID string) (*models.Transaction, error)
CommitTransaction commits a transaction by id.
func (*Transaction) DeleteTransaction ¶
func (t *Transaction) DeleteTransaction(transactionID string) error
DeleteTransaction deletes a transaction by id.
func (*Transaction) ErrAndDeleteTransaction ¶
func (t *Transaction) ErrAndDeleteTransaction(err error, tID string) error
func (*Transaction) GetTransaction ¶
func (t *Transaction) GetTransaction(transactionID string) (*models.Transaction, error)
GetTransaction returns transaction information by id
func (*Transaction) GetTransactionFile ¶
func (t *Transaction) GetTransactionFile(transactionID string) (string, error)
func (*Transaction) GetTransactions ¶
func (t *Transaction) GetTransactions(status string) (*models.Transactions, error)
GetTransactions returns an array of transactions
func (*Transaction) HandleError ¶
func (t *Transaction) HandleError(id, parentType, parentName, transactionID string, implicit bool, err error) error
func (*Transaction) MarkTransactionOutdated ¶
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 ¶
func (t *Transaction) SaveData(prsr interface{}, tID string, commitImplicit bool) error
func (*Transaction) StartTransaction ¶
func (t *Transaction) StartTransaction(version int64) (*models.Transaction, error)
StartTransaction starts a new empty lbctl transaction
type TransactionClient ¶
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) }
type TransactionHandling ¶
type Transactions ¶
type Transactions interface { GetTransactions(status string) (*models.Transactions, error) GetTransaction(transactionID string) (*models.Transaction, error) StartTransaction(version int64) (*models.Transaction, error) DeleteTransaction(transactionID string) error CommitTransaction(transactionID string) (*models.Transaction, error) MarkTransactionOutdated(transactionID string) (err error) }
type User ¶ added in v3.1.0
type User interface { GetUsers(userlist string, transactionID string) (int64, models.Users, error) GetUser(username string, userlist string, transactionID string) (int64, *models.User, error) DeleteUser(username string, userlist string, transactionID string, version int64) error CreateUser(userlist string, data *models.User, transactionID string, version int64) error EditUser(username string, userlist string, data *models.User, transactionID string, version int64) error }
type Userlist ¶ added in v3.1.0
type Userlist interface { GetUserLists(transactionID string) (int64, models.Userlists, error) GetUserList(name string, transactionID string) (int64, *models.Userlist, error) DeleteUserList(name string, transactionID string, version int64) error CreateUserList(data *models.Userlist, transactionID string, version int64) error }
Source Files ¶
- acl.go
- backend.go
- backend_switching_rule.go
- bind.go
- cache.go
- capture.go
- configuration.go
- defaults.go
- errors.go
- filter.go
- frontend.go
- global.go
- group.go
- helpers.go
- http_check.go
- http_request_rule.go
- http_response_rule.go
- interface.go
- log_target.go
- misc.go
- nameserver.go
- parser.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_check.go
- tcp_request_rule.go
- tcp_response_rule.go
- transaction-handling.go
- transaction.go
- user.go
- userlist.go
- version.go