Documentation ¶
Index ¶
- Constants
- Variables
- func CompositeTransactionError(e ...error) *oaerrors.CompositeError
- func CreateEditSection(object interface{}, section parser.Section, pName string, p parser.Parser) error
- func GetBindByName(name string, parentType string, parentName string, p parser.Parser) (*models.Bind, int)
- func GetDgramBindByName(name string, logForward string, p parser.Parser) (*models.DgramBind, int)
- func GetGroupByName(name string, userlist string, p parser.Parser) (*models.Group, int)
- func GetMailerEntryByName(name, section string, p parser.Parser) (*models.MailerEntry, 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, parentType string, parentName string, p parser.Parser) (*models.Server, int)
- func GetServerTemplateByPrefix(prefix string, backend string, p parser.Parser) (*models.ServerTemplate, int)
- func GetTableByName(name string, peerSection string, p parser.Parser) (*models.Table, int)
- func GetUserByUsername(username string, userlist string, p parser.Parser) (*models.User, int)
- func ParseACL(f types.ACL) *models.ACL
- func ParseACLs(section parser.Section, name 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(parentType string, parentName 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 ParseDgramBind(ondiskDgramBind types.DgramBind) *models.DgramBind
- func ParseDgramBinds(logForward string, p parser.Parser) (models.DgramBinds, error)
- func ParseFCGIApp(p parser.Parser, name string) (*models.FCGIApp, 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 ParseHTTPAfterRule(f types.Action) (*models.HTTPAfterResponseRule, error)
- func ParseHTTPAfterRules(t, pName string, p parser.Parser) (models.HTTPAfterResponseRules, error)
- func ParseHTTPCheck(f types.Action) (check *models.HTTPCheck, err error)
- func ParseHTTPChecks(t, pName string, p parser.Parser) (models.HTTPChecks, error)
- func ParseHTTPErrorRule(f types.Action) *models.HTTPErrorRule
- func ParseHTTPErrorRules(t, pName string, p parser.Parser) (models.HTTPErrorRules, error)
- func ParseHTTPErrorsSection(p parser.Parser, name string) (*models.HTTPErrorsSection, 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 ParseLogForward(p parser.Parser, lf *models.LogForward) error
- func ParseLogTarget(l types.Log) *models.LogTarget
- func ParseLogTargets(t, pName string, p parser.Parser) (models.LogTargets, error)
- func ParseMailerEntries(mailersSection string, p parser.Parser) (models.MailerEntries, error)
- func ParseMailerEntry(m types.Mailer) *models.MailerEntry
- func ParseMailersSection(p parser.Parser, ms *models.MailersSection) 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 ParseProgram(p parser.Parser, name string) (*models.Program, error)
- func ParseResolverSection(p parser.Parser, resolver *models.Resolver) error
- func ParseRingSection(p parser.Parser, ring *models.Ring) 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(parentType string, parentName 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, error)
- func ParseTCPResponseRules(backend string, p parser.Parser) (models.TCPResponseRules, error)
- func ParseTable(t types.Table) *models.Table
- func ParseTables(peerSection string, p parser.Parser) (models.Tables, 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 SerializeDgramBind(b models.DgramBind) types.DgramBind
- func SerializeFCGIAppSection(p parser.Parser, data *models.FCGIApp) (err error)
- 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 SerializeHTTPAfterRule(f models.HTTPAfterResponseRule) (rule types.Action, err error)
- func SerializeHTTPCheck(f models.HTTPCheck) (action types.Action, err error)
- func SerializeHTTPErrorRule(f models.HTTPErrorRule) (rule types.Action, err error)
- func SerializeHTTPErrorsSection(p parser.Parser, data *models.HTTPErrorsSection) error
- func SerializeHTTPRequestRule(f models.HTTPRequestRule) (rule types.Action, err error)
- func SerializeHTTPResponseRule(f models.HTTPResponseRule) (rule types.Action, err error)
- func SerializeLogForwardSection(p parser.Parser, data *models.LogForward) error
- func SerializeLogTarget(l models.LogTarget) types.Log
- func SerializeMailerEntry(me models.MailerEntry) types.Mailer
- func SerializeMailersSection(p parser.Parser, data *models.MailersSection) error
- func SerializeNameserver(pe models.Nameserver) types.Nameserver
- func SerializePeerEntry(pe models.PeerEntry) types.Peer
- func SerializeProgramSection(p parser.Parser, data *models.Program) error
- func SerializeResolverSection(p parser.Parser, data *models.Resolver) error
- func SerializeRingSection(p parser.Parser, data *models.Ring) 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, error)
- func SerializeTable(t models.Table) types.Table
- 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 DgramBind
- type FCGIApp
- type Filter
- type Frontend
- type Global
- type Group
- type HTTPAfterResponseRule
- type HTTPCheck
- type HTTPErrorRule
- type HTTPErrorsSection
- type HTTPRequestRule
- type HTTPResponseRule
- type LogForward
- type LogTarget
- type MailerEntry
- type MailersSection
- type Nameserver
- type Parser
- type PeerEntry
- type PeerSection
- type Program
- type Raw
- type Resolver
- type Ring
- 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, from 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 Table
- 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 ServiceGrowthTypeExponential = "exponential"
ServiceGrowthTypeExponential indicates exponential growth type in ScalingParams.
const ServiceGrowthTypeLinear = "linear"
ServiceGrowthTypeLinear indicates linear growth type in ScalingParams.
Variables ¶
var ( // General error, unknown cause ErrGeneralError = errors.New("unknown error") // Errors regarding configurations ErrNoParentSpecified = errors.New("unspecified parent") ErrParentDoesNotExist = errors.New("missing parent") ErrBothVersionTransaction = errors.New("both version and transaction specified, specify only one") ErrNoVersionTransaction = errors.New("version or transaction not specified") ErrValidationError = errors.New("validation error") ErrVersionMismatch = errors.New("version mismatch") ErrTransactionDoesNotExist = errors.New("transaction does not exist") ErrTransactionAlreadyExists = errors.New("transaction already exist") ErrCannotParseTransaction = errors.New("failed to parse transaction") ErrObjectDoesNotExist = errors.New("missing object") ErrObjectAlreadyExists = errors.New("object already exists") ErrObjectIndexOutOfRange = errors.New("index out of range") ErrErrorChangingConfig = errors.New("invalid change") ErrCannotReadConfFile = errors.New("failed to read configuration") ErrCannotReadVersion = errors.New("cannot read version") ErrCannotSetVersion = errors.New("cannot set version") ErrCannotFindHAProxy = errors.New("failed to find HAProxy") ErrClientDoesNotExists = errors.New("client does not exist") )
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 GetDgramBindByName ¶
func GetGroupByName ¶
func GetMailerEntryByName ¶
func GetNameserverByName ¶
func GetPeerEntryByName ¶
func GetServerByName ¶
func GetTableByName ¶
func GetUserByUsername ¶
func ParseBackendSwitchingRule ¶
func ParseBackendSwitchingRule(ub types.UseBackend) *models.BackendSwitchingRule
func ParseBinds ¶
func ParseDeclareCapture ¶
func ParseDeclareCapture(f types.DeclareCapture) *models.Capture
func ParseDeclareCaptures ¶
func ParseDgramBinds ¶
func ParseHTTPAfterRule ¶
func ParseHTTPAfterRule(f types.Action) (*models.HTTPAfterResponseRule, error)
func ParseHTTPAfterRules ¶
func ParseHTTPChecks ¶
func ParseHTTPErrorRule ¶
func ParseHTTPErrorRule(f types.Action) *models.HTTPErrorRule
func ParseHTTPErrorRules ¶
func ParseHTTPErrorsSection ¶
ParseHTTPErrorsSection parses a single http-errors section with a given name.
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 ParseLogForward ¶
func ParseLogForward(p parser.Parser, lf *models.LogForward) error
func ParseLogTargets ¶
func ParseMailerEntries ¶
func ParseMailerEntry ¶
func ParseMailerEntry(m types.Mailer) *models.MailerEntry
func ParseMailersSection ¶
func ParseMailersSection(p parser.Parser, ms *models.MailersSection) error
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 ParseServers ¶
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, error)
func ParseTCPResponseRules ¶
func SerializeBackendSwitchingRule ¶
func SerializeBackendSwitchingRule(bRule models.BackendSwitchingRule) types.UseBackend
func SerializeDeclareCapture ¶
func SerializeDeclareCapture(f models.Capture) types.DeclareCapture
func SerializeFCGIAppSection ¶
func SerializeGlobalSection ¶
func SerializeHTTPAfterRule ¶
func SerializeHTTPAfterRule(f models.HTTPAfterResponseRule) (rule types.Action, err error)
func SerializeHTTPCheck ¶
func SerializeHTTPErrorRule ¶
func SerializeHTTPErrorRule(f models.HTTPErrorRule) (rule types.Action, err error)
func SerializeHTTPErrorsSection ¶
func SerializeHTTPErrorsSection(p parser.Parser, data *models.HTTPErrorsSection) error
SerializeProgramSection saves a single http-errors section's data in the configuration.
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 SerializeLogForwardSection ¶
func SerializeLogForwardSection(p parser.Parser, data *models.LogForward) error
func SerializeMailerEntry ¶
func SerializeMailerEntry(me models.MailerEntry) types.Mailer
func SerializeMailersSection ¶
func SerializeMailersSection(p parser.Parser, data *models.MailersSection) error
func SerializeNameserver ¶
func SerializeNameserver(pe models.Nameserver) types.Nameserver
func SerializeProgramSection ¶
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, error)
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(parentType string, parentName string, transactionID string) (int64, models.Binds, error) GetBind(name string, parentType string, parentName string, transactionID string) (int64, *models.Bind, error) DeleteBind(name string, parentType string, parentName string, transactionID string, version int64) error CreateBind(parentType string, parentName string, data *models.Bind, transactionID string, version int64) error EditBind(name string, parentType string, parentName 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 // 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 BackupsNumber int UseValidation bool PersistentTransactions bool ValidateConfigurationFile bool MasterWorker bool SkipFailedTransactions bool UseMd5Hash bool }
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 DgramBind FCGIApp Filter Frontend Global HTTPCheck HTTPRequestRule HTTPResponseRule HTTPAfterResponseRule HTTPErrorRule HTTPErrorsSection LogTarget LogForward MailerEntry MailersSection Nameserver PeerEntry PeerSection Program Raw Resolver Ring Server ServerTemplate Site StickRule ServiceI Table TCPCheck TCPRequestRule TCPResponseRule Transactions TransactionHandling Version Userlist User Group }
func New ¶
func New(ctx context.Context, opt ...options.ConfigurationOption) (Configuration, error)
type Defaults ¶
type Defaults interface { GetDefaultsConfiguration(transactionID string) (int64, *models.Defaults, error) PushDefaultsConfiguration(data *models.Defaults, transactionID string, version int64) error GetDefaultsSections(transactionID string) (int64, models.DefaultsSections, error) GetDefaultsSection(name string, transactionID string) (int64, *models.Defaults, error) DeleteDefaultsSection(name string, transactionID string, version int64) error EditDefaultsSection(name string, data *models.Defaults, transactionID string, version int64) error CreateDefaultsSection(data *models.Defaults, transactionID string, version int64) error }
type DgramBind ¶
type DgramBind interface { GetDgramBinds(logForward string, transactionID string) (int64, models.DgramBinds, error) GetDgramBind(name string, logForward string, transactionID string) (int64, *models.DgramBind, error) DeleteDgramBind(name string, logForward string, transactionID string, version int64) error CreateDgramBind(logForward string, data *models.DgramBind, transactionID string, version int64) error EditDgramBind(name string, logForward string, data *models.DgramBind, transactionID string, version int64) error }
type FCGIApp ¶
type FCGIApp interface { GetFCGIApplications(transactionID string) (int64, models.FCGIApps, error) GetFCGIApplication(name string, transactionID string) (int64, *models.FCGIApp, error) DeleteFCGIApplication(name string, transactionID string, version int64) error EditFCGIApplication(name string, data *models.FCGIApp, transactionID string, version int64) error CreateFCGIApplication(data *models.FCGIApp, transactionID string, version int64) 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 ¶
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 HTTPAfterResponseRule ¶
type HTTPAfterResponseRule interface { GetHTTPAfterResponseRules(parentType, parentName string, transactionID string) (int64, models.HTTPAfterResponseRules, error) GetHTTPAfterResponseRule(id int64, parentType, parentName string, transactionID string) (int64, *models.HTTPAfterResponseRule, error) DeleteHTTPAfterResponseRule(id int64, parentType string, parentName string, transactionID string, version int64) error CreateHTTPAfterResponseRule(parentType string, parentName string, data *models.HTTPAfterResponseRule, transactionID string, version int64) error EditHTTPAfterResponseRule(id int64, parentType string, parentName string, data *models.HTTPAfterResponseRule, 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 HTTPErrorRule ¶
type HTTPErrorRule interface { GetHTTPErrorRules(parentType, parentName string, transactionID string) (int64, models.HTTPErrorRules, error) GetHTTPErrorRule(id int64, parentType, parentName string, transactionID string) (int64, *models.HTTPErrorRule, error) DeleteHTTPErrorRule(id int64, parentType string, parentName string, transactionID string, version int64) error CreateHTTPErrorRule(parentType string, parentName string, data *models.HTTPErrorRule, transactionID string, version int64) error EditHTTPErrorRule(id int64, parentType string, parentName string, data *models.HTTPErrorRule, transactionID string, version int64) error }
type HTTPErrorsSection ¶
type HTTPErrorsSection interface { GetHTTPErrorsSections(transactionID string) (int64, models.HTTPErrorsSections, error) GetHTTPErrorsSection(name string, transactionID string) (int64, *models.HTTPErrorsSection, error) DeleteHTTPErrorsSection(name string, transactionID string, version int64) error CreateHTTPErrorsSection(data *models.HTTPErrorsSection, transactionID string, version int64) error EditHTTPErrorsSection(name string, data *models.HTTPErrorsSection, 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 LogForward ¶
type LogForward interface { GetLogForwards(transactionID string) (int64, models.LogForwards, error) GetLogForward(name string, transactionID string) (int64, *models.LogForward, error) DeleteLogForward(name string, transactionID string, version int64) error CreateLogForward(data *models.LogForward, transactionID string, version int64) error EditLogForward(name string, data *models.LogForward, 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 MailerEntry ¶
type MailerEntry interface { GetMailerEntries(mailersSection string, transactionID string) (int64, models.MailerEntries, error) GetMailerEntry(name string, mailersSection string, transactionID string) (int64, *models.MailerEntry, error) DeleteMailerEntry(name string, mailersSection string, transactionID string, version int64) error CreateMailerEntry(mailersSection string, data *models.MailerEntry, transactionID string, version int64) error EditMailerEntry(name string, mailersSection string, data *models.MailerEntry, transactionID string, version int64) error }
type MailersSection ¶
type MailersSection interface { GetMailersSections(transactionID string) (int64, models.MailersSections, error) GetMailersSection(name, transactionID string) (int64, *models.MailersSection, error) DeleteMailersSection(name, transactionID string, version int64) error CreateMailersSection(data *models.MailersSection, transactionID string, version int64) error EditMailersSection(name string, data *models.MailersSection, 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 EditPeerSection(data *models.PeerSection, transactionID string, version int64) error }
type Program ¶
type Program interface { GetPrograms(transactionID string) (int64, models.Programs, error) GetProgram(name string, transactionID string) (int64, *models.Program, error) DeleteProgram(name string, transactionID string, version int64) error CreateProgram(data *models.Program, transactionID string, version int64) error EditProgram(name string, data *models.Program, transactionID string, version int64) error }
type Raw ¶
type Raw interface { GetRawConfigurationWithClusterData(transactionID string, version int64) (int64, int64, string, string, error) GetRawConfiguration(transactionID string, version int64) (int64, string, error) PostRawConfiguration(config *string, version int64, skipVersionCheck bool, onlyValidate ...bool) 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 Ring ¶
type Ring interface { GetRings(transactionID string) (int64, models.Rings, error) GetRing(name string, transactionID string) (int64, *models.Ring, error) DeleteRing(name string, transactionID string, version int64) error CreateRing(data *models.Ring, transactionID string, version int64) error EditRing(name string, data *models.Ring, 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{} Parser parser.Parser Section parser.Section Name string // contains filtered or unexported fields }
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{} Parser parser.Parser Section parser.Section Name string }
SectionParser is used set fields of a section based on the provided parser
func NewParseSection ¶
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(parentType string, parentName string, transactionID string) (int64, models.Servers, error) GetServer(name string, parentType string, parentName string, transactionID string) (int64, *models.Server, error) DeleteServer(name string, parentType string, parentName string, transactionID string, version int64) error CreateServer(parentType string, parentName string, data *models.Server, transactionID string, version int64) error EditServer(name string, parentType string, parentName 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 mapping 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 Table ¶
type Table interface { GetTables(peerSection string, transactionID string) (int64, models.Tables, error) GetTable(name string, peerSection string, transactionID string) (int64, *models.Table, error) DeleteTable(name string, peerSection string, transactionID string, version int64) error CreateTable(peerSection string, data *models.Table, transactionID string, version int64) error EditTable(name string, peerSection string, data *models.Table, transactionID string, version int64) error }
type Transaction ¶
type Transaction struct { TransactionClient TransactionClient options.ConfigurationOptions // 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) SetValidateConfigFiles(before, after []string) }
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) SetValidateConfigFiles(before, after []string) }
type User ¶
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 ¶
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
- dgram_bind.go
- errors.go
- fcgi_app.go
- filter.go
- frontend.go
- global.go
- group.go
- helpers.go
- http_after_response_rule.go
- http_check.go
- http_error_rule.go
- http_errors_section.go
- http_request_rule.go
- http_response_rule.go
- interface.go
- log_forward.go
- log_target.go
- mailer_entry.go
- mailers_section.go
- misc.go
- nameserver.go
- parser.go
- peer_entry.go
- peer_section.go
- program.go
- raw.go
- resolver.go
- ring.go
- server.go
- server_switching_rule.go
- server_template.go
- service.go
- site.go
- stick_rule.go
- table.go
- tcp_check.go
- tcp_request_rule.go
- tcp_response_rule.go
- transaction-handling.go
- transaction.go
- user.go
- userlist.go
- version.go