Documentation
¶
Index ¶
- func CreateMap(name string, file io.Reader) (*models.Map, error)
- func IsBiggerOrEqual(minimum, current *HAProxyVersion) bool
- func ParseACLFileEntries(output string, hasID bool) (models.ACLFilesEntries, error)
- func ParseCrtListEntries(output string) (models.SslCrtListEntries, error)
- func ParseMapEntries(output string, hasID bool) models.MapEntries
- func ServerHealthValid(health string) bool
- func ServerStateValid(state string) bool
- func ServerWeightValid(weight string) bool
- type ACLs
- type Acme
- type CrtList
- type CrtListEntries
- type CrtListEntry
- type CrtLists
- type Frontend
- type HAProxyMock
- type HAProxyVersion
- type Info
- type Manage
- type Maps
- type OcspResponseFmt
- type Raw
- type Runtime
- type SSL
- type Servers
- type SingleRuntime
- func (s *SingleRuntime) AbortCAFile(caFile string) error
- func (s *SingleRuntime) AbortCertificate(storageName string) error
- func (s *SingleRuntime) AbortCrlFile(crlFile string) error
- func (s *SingleRuntime) AcmeRenew(certificate string) error
- func (s *SingleRuntime) AcmeStatus() (models.AcmeStatus, error)
- func (s *SingleRuntime) AddACLFileEntry(aclID, value string) error
- func (s *SingleRuntime) AddACLVersioned(version, aclID, value string) error
- func (s *SingleRuntime) AddCAFileEntry(caFile, payload string) error
- func (s *SingleRuntime) AddCrtListEntry(crtList string, entry models.SslCrtListEntry) error
- func (s *SingleRuntime) AddMapEntry(name, key, value string) error
- func (s *SingleRuntime) AddMapEntryVersioned(version, name, key, value string) error
- func (s *SingleRuntime) AddMapPayload(name, payload string) error
- func (s *SingleRuntime) AddMapPayloadVersioned(version, name, payload string) error
- func (s *SingleRuntime) AddServer(backend, name, attributes string) error
- func (s *SingleRuntime) ClearAllCounters() error
- func (s *SingleRuntime) ClearCounters() error
- func (s *SingleRuntime) ClearMap(name string) error
- func (s *SingleRuntime) ClearMapVersioned(name, version string) error
- func (s *SingleRuntime) CommitACL(version, aclID string) error
- func (s *SingleRuntime) CommitCAFile(caFile string) error
- func (s *SingleRuntime) CommitCertificate(storageName string) error
- func (s *SingleRuntime) CommitCrlFile(crlFile string) error
- func (s *SingleRuntime) CommitMap(version, name string) error
- func (s *SingleRuntime) DeleteACLFileEntry(aclID, value string) error
- func (s *SingleRuntime) DeleteCAFile(caFile string) error
- func (s *SingleRuntime) DeleteCertificate(storageName string) error
- func (s *SingleRuntime) DeleteCrlFile(crlFile string) error
- func (s *SingleRuntime) DeleteCrtListEntry(crtList, certFile string, lineNumber *int64) error
- func (s *SingleRuntime) DeleteMapEntry(name, id string) error
- func (s *SingleRuntime) DeleteServer(backend, name string) error
- func (s *SingleRuntime) DisableAgentCheck(backend, server string) error
- func (s *SingleRuntime) DisableServer(backend, server string) error
- func (s *SingleRuntime) EnableAgentCheck(backend, server string) error
- func (s *SingleRuntime) EnableServer(backend, server string) error
- func (s *SingleRuntime) EnableServerHealth(backend, server string) error
- func (s *SingleRuntime) Execute(command string) error
- func (s *SingleRuntime) ExecuteMaster(command string) (string, error)
- func (s *SingleRuntime) ExecuteRaw(command string) (string, error)
- func (s *SingleRuntime) ExecuteWithResponse(command string) (string, error)
- func (s *SingleRuntime) GetACL(storageName string) (*models.ACLFile, error)
- func (s *SingleRuntime) GetACLFileEntry(aclID, value string) (*models.ACLFileEntry, error)
- func (s *SingleRuntime) GetCAFile(caFile string) (*models.SslCaFile, error)
- func (s *SingleRuntime) GetCert(storageName string) (*models.SslCertificate, error)
- func (s *SingleRuntime) GetCrlFile(crlFile string) (*models.SslCrl, error)
- func (s *SingleRuntime) GetCrtList(file string) (*models.SslCrtList, error)
- func (s *SingleRuntime) GetInfo() models.ProcessInfo
- func (s *SingleRuntime) GetMap(name string) (*models.Map, error)
- func (s *SingleRuntime) GetMapEntry(name, id string) (*models.MapEntry, error)
- func (s *SingleRuntime) GetServerState(backend, server string) (*models.RuntimeServer, error)
- func (s *SingleRuntime) GetServersState(backend string) (models.RuntimeServers, error)
- func (s *SingleRuntime) GetStats() models.NativeStats
- func (s *SingleRuntime) GetTableEntries(name string, filter []string, key string) (models.StickTableEntries, error)
- func (s *SingleRuntime) Init(socketPath string, masterWorkerMode bool, opt ...options.RuntimeOptions) error
- func (s *SingleRuntime) IsValid() bool
- func (s *SingleRuntime) NewCAFile(caFile string) error
- func (s *SingleRuntime) NewCertificate(storageName string) error
- func (s *SingleRuntime) NewCrlFile(crlFile string) error
- func (s *SingleRuntime) PrepareACL(aclID string) (string, error)
- func (s *SingleRuntime) PrepareMap(name string) (string, error)
- func (s *SingleRuntime) SetCAFile(caFile, payload string) error
- func (s *SingleRuntime) SetCertificate(storageName string, payload string) error
- func (s *SingleRuntime) SetCrlFile(crlFile string, payload string) error
- func (s *SingleRuntime) SetFrontendMaxConn(frontend string, maxconn int) error
- func (s *SingleRuntime) SetMapEntry(name, id, value string) error
- func (s *SingleRuntime) SetOcspResponse(payload string) error
- func (s *SingleRuntime) SetRateLimitSSLSessionGlobal(value uint64) error
- func (s *SingleRuntime) SetServerAddr(backend, server string, ip string, port int) error
- func (s *SingleRuntime) SetServerAgentAddr(backend, server string, addr string) error
- func (s *SingleRuntime) SetServerAgentSend(backend, server string, send string) error
- func (s *SingleRuntime) SetServerCheckPort(backend, server string, port int) error
- func (s *SingleRuntime) SetServerHealth(backend, server string, health string) error
- func (s *SingleRuntime) SetServerState(backend, server string, state string) error
- func (s *SingleRuntime) SetServerWeight(backend, server string, weight string) error
- func (s *SingleRuntime) SetTableEntry(table, key string, dataType models.StickTableEntry) error
- func (s *SingleRuntime) ShowACLFileEntries(storageName string) (models.ACLFilesEntries, error)
- func (s *SingleRuntime) ShowACLS() (models.ACLFiles, error)
- func (s *SingleRuntime) ShowCAFile(caFile string, index *int64) (*models.SslCertificate, error)
- func (s *SingleRuntime) ShowCAFiles() (models.SslCaFiles, error)
- func (s *SingleRuntime) ShowCertificate(storageName string) (*models.SslCertificate, error)
- func (s *SingleRuntime) ShowCerts() (models.SslCertificates, error)
- func (s *SingleRuntime) ShowCrlFile(crlFile string, index *int64) (*models.SslCrlEntries, error)
- func (s *SingleRuntime) ShowCrlFiles() (models.SslCrls, error)
- func (s *SingleRuntime) ShowCrtListEntries(file string) (models.SslCrtListEntries, error)
- func (s *SingleRuntime) ShowCrtLists() (models.SslCrtLists, error)
- func (s *SingleRuntime) ShowMapEntries(name string) (models.MapEntries, error)
- func (s *SingleRuntime) ShowMapEntriesVersioned(name, version string) (models.MapEntries, error)
- func (s *SingleRuntime) ShowMaps() (models.Maps, error)
- func (s *SingleRuntime) ShowOcspResponse(idOrPath string, ofmt ...OcspResponseFmt) (*models.SslOcspResponse, error)
- func (s *SingleRuntime) ShowOcspResponses() ([]*models.SslCertificateID, error)
- func (s *SingleRuntime) ShowOcspUpdates() ([]*models.SslOcspUpdate, error)
- func (s *SingleRuntime) ShowSSLProviders() (*models.SslProviders, error)
- func (s *SingleRuntime) ShowTable(name string) (*models.StickTable, error)
- func (s *SingleRuntime) ShowTables() (models.StickTables, error)
- func (s *SingleRuntime) UpdateOcspResponse(certFile string) (*models.SslOcspResponse, error)
- type Tables
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateMap ¶
CreateMap creates a new map file with its entries. Returns an error if file already exists
func IsBiggerOrEqual ¶
func IsBiggerOrEqual(minimum, current *HAProxyVersion) bool
func ParseACLFileEntries ¶
func ParseACLFileEntries(output string, hasID bool) (models.ACLFilesEntries, error)
ParseACLFileEntries parses array of entries in one Acl file One line sample entry: ID Value 0x560f3f9e8600 10.178.160.0
func ParseCrtListEntries ¶
func ParseCrtListEntries(output string) (models.SslCrtListEntries, error)
ParseCrtListEntries parses array of entries in one CrtList file One line sample entry: /etc/ssl/cert-0.pem !*.crt-test.platform.domain.com !connectivitynotification.platform.domain.com !connectivitytunnel.platform.domain.com !authentication.cert.another.domain.com !*.authentication.cert.another.domain.com /etc/ssl/cert-1.pem [verify optional ca-file /etc/ssl/ca-file-1.pem] *.crt-test.platform.domain.com !connectivitynotification.platform.domain.com !connectivitytunnel.platform.domain.com !authentication.cert.another.domain.com !*.authentication.cert.another.domain.com /etc/ssl/cert-2.pem [verify required ca-file /etc/ssl/ca-file-2.pem]
func ParseMapEntries ¶
func ParseMapEntries(output string, hasID bool) models.MapEntries
ParseMapEntries parses array of entries in one map file One line sample entry: ID Key Value 0x55d155c6fbf0 static.example.com be_static
func ServerHealthValid ¶
ServerHealthValid checks if server health is valid
func ServerStateValid ¶
ServerStateValid checks if server state is valid
func ServerWeightValid ¶
ServerWeightValid checks if server state is valid
Types ¶
type ACLs ¶
type ACLs interface {
GetACLFiles() (files models.ACLFiles, err error)
GetACLFile(id string) (files *models.ACLFile, err error)
GetACLFilesEntries(id string) (files models.ACLFilesEntries, err error)
GetACLFileEntry(id, value string) (fileEntry *models.ACLFileEntry, err error)
AddACLFileEntry(id, value string) error
DeleteACLFileEntry(id, value string) error
AddACLAtomic(aclID string, entries models.ACLFilesEntries) error
}
type Acme ¶ added in v6.2.0
type Acme interface {
AcmeRenew(certificate string) error
AcmeStatus() (models.AcmeStatus, error)
}
type CrtList ¶
type CrtList = models.SslCrtList
type CrtListEntries ¶
type CrtListEntries = models.SslCrtListEntries
type CrtListEntry ¶
type CrtListEntry = models.SslCrtListEntry //nolint:gofumpt
These type aliases are provided for backward compatibility.
type CrtLists ¶
type CrtLists = models.SslCrtLists
type HAProxyMock ¶
HAProxyMock - Mock HAProxy Server for testing the socket communication
func NewHAProxyMock ¶
func NewHAProxyMock(t *testing.T) *HAProxyMock
NewHAProxyMock - create new haproxy mock
func (*HAProxyMock) SetResponses ¶
func (haproxy *HAProxyMock) SetResponses(responses *map[string]string)
SetResponses - setting the expected responses, safe for concurrent use
type HAProxyVersion ¶
func (*HAProxyVersion) ParseHAProxyVersion ¶
func (v *HAProxyVersion) ParseHAProxyVersion(version string) error
type Info ¶
type Info interface {
// GetStats returns stats from the socket
GetStats() models.NativeStats
// GetInfo returns info from the socket
GetInfo() (models.ProcessInfo, error)
// GetVersion() returns running HAProxy version
GetVersion() (HAProxyVersion, error)
}
type Maps ¶
type Maps interface {
GetMapsDir() (string, error)
// GetMapsPath returns runtime map file path or map id
GetMapsPath(name string) (string, error)
// ShowMaps returns structured unique map files
ShowMaps() (models.Maps, error)
// CreateMap creates a new map file with its entries
CreateMap(file io.Reader, header multipart.FileHeader) (*models.Map, error)
// GetMap returns one structured runtime map file
GetMap(name string) (*models.Map, error)
// ClearMap removes all map entries from the map file. If forceDelete is true, deletes file from disk
ClearMap(name string, forceDelete bool) error
// ShowMapEntries list all map entries by map file name
ShowMapEntries(name string) (models.MapEntries, error)
// AddMapPayload adds multiple entries to the map file
AddMapPayload(name, payload string) error
// AddMapEntry adds an entry into the map file
AddMapEntry(name, key, value string) error
// GetMapEntry returns one map runtime setting
GetMapEntry(name, id string) (*models.MapEntry, error)
// SetMapEntry replace the value corresponding to each id in a map
SetMapEntry(name, id, value string) error
// DeleteMapEntry deletes all the map entries from the map by its id
DeleteMapEntry(name, id string) error
ParseMapEntries(output string) models.MapEntries
// ParseMapEntriesFromFile reads entries from file
ParseMapEntriesFromFile(inputFile io.Reader, hasID bool) models.MapEntries
AddMapPayloadVersioned(name string, entries models.MapEntries) error
// PrepareMap allocates a new map version
PrepareMap(name string) (version string, err error)
// CommitMap commits all changes made to a map version
CommitMap(version, name string) error
}
type OcspResponseFmt ¶ added in v6.2.0
type OcspResponseFmt int
const ( OcspFmtText OcspResponseFmt = iota OcspFmtBase64 )
type Runtime ¶
type SSL ¶ added in v6.2.0
type SSL interface {
ShowCAFiles() (models.SslCaFiles, error)
GetCAFile(name string) (*models.SslCaFile, error)
ShowCAFile(name string, index *int64) (*models.SslCertificate, error)
NewCAFile(name string) error
SetCAFile(name, payload string) error
CommitCAFile(name string) error
AbortCAFile(name string) error
AddCAFileEntry(name, payload string) error
DeleteCAFile(name string) error
ShowCerts() (models.SslCertificates, error)
GetCert(name string) (*models.SslCertificate, error)
ShowCertificate(name string) (*models.SslCertificate, error)
NewCertEntry(name string) error
SetCertEntry(name, payload string) error
CommitCertEntry(name string) error
AbortCertEntry(name string) error
DeleteCertEntry(name string) error
ShowCrlFiles() (models.SslCrls, error)
GetCrlFile(name string) (*models.SslCrl, error)
ShowCrlFile(name string, index *int64) (*models.SslCrlEntries, error)
NewCrlFile(name string) error
SetCrlFile(name string, payload string) error
CommitCrlFile(name string) error
AbortCrlFile(name string) error
DeleteCrlFile(name string) error
ShowCrtLists() (models.SslCrtLists, error)
GetCrtList(name string) (*models.SslCrtList, error)
ShowCrtListEntries(name string) (models.SslCrtListEntries, error)
AddCrtListEntry(crtList string, entry models.SslCrtListEntry) error
DeleteCrtListEntry(crtList, filename string, lineNumber *int64) error
ShowOcspResponses() ([]*models.SslCertificateID, error)
ShowOcspResponse(idOrPath string, ofmt ...OcspResponseFmt) (*models.SslOcspResponse, error)
ShowOcspUpdates() ([]*models.SslOcspUpdate, error)
SetOcspResponse(payload string) error
UpdateOcspResponse(name string) (*models.SslOcspResponse, error)
ShowSSLProviders() (*models.SslProviders, error)
SetRateLimitSSLSessionGlobal(value uint64) error
}
type Servers ¶
type Servers interface {
// AddServer adds a new server to a backend
AddServer(backend, name, attributes string) error
// DeleteServer removes a server from a backend
DeleteServer(backend, name string) error
// SetServerAddr set ip [port] for server
SetServerAddr(backend, server string, ip string, port int) error
// SetServerState set state for server
SetServerState(backend, server string, state string) error
// SetServerWeight set weight for server
SetServerWeight(backend, server string, weight string) error
// SetServerHealth set health for server
SetServerHealth(backend, server string, health string) error
// EnableServerHealth
EnableServerHealth(backend, server string) error
// EnableAgentCheck enable agent check for server
EnableAgentCheck(backend, server string) error
// DisableAgentCheck disable agent check for server
DisableAgentCheck(backend, server string) error
// EnableServer marks server as UP
EnableServer(backend, server string) error
// DisableServer marks server as DOWN for maintenance
DisableServer(backend, server string) error
// SetServerAgentAddr set agent-addr for server
SetServerAgentAddr(backend, server string, addr string) error
// SetServerAgentSend set agent-send for server
SetServerAgentSend(backend, server string, send string) error
// GetServerState returns server runtime state
GetServersState(backend string) (models.RuntimeServers, error)
// GetServerState returns server runtime state
GetServerState(backend, server string) (*models.RuntimeServer, error)
// SetServerCheckPort set health heck port for server
SetServerCheckPort(backend, server string, port int) error
}
type SingleRuntime ¶
type SingleRuntime struct {
// contains filtered or unexported fields
}
SingleRuntime handles one runtime API
func (*SingleRuntime) AbortCAFile ¶ added in v6.2.0
func (s *SingleRuntime) AbortCAFile(caFile string) error
AbortCAFile aborts and destroys a CA file update transaction
func (*SingleRuntime) AbortCertificate ¶ added in v6.2.0
func (s *SingleRuntime) AbortCertificate(storageName string) error
func (*SingleRuntime) AbortCrlFile ¶ added in v6.2.0
func (s *SingleRuntime) AbortCrlFile(crlFile string) error
AbortCrlFile aborts and destroys a Crl file update transaction
func (*SingleRuntime) AcmeRenew ¶ added in v6.2.0
func (s *SingleRuntime) AcmeRenew(certificate string) error
func (*SingleRuntime) AcmeStatus ¶ added in v6.2.0
func (s *SingleRuntime) AcmeStatus() (models.AcmeStatus, error)
func (*SingleRuntime) AddACLFileEntry ¶
func (s *SingleRuntime) AddACLFileEntry(aclID, value string) error
AddACLFileEntry adds an entry into the Acl file
func (*SingleRuntime) AddACLVersioned ¶
func (s *SingleRuntime) AddACLVersioned(version, aclID, value string) error
func (*SingleRuntime) AddCAFileEntry ¶ added in v6.2.0
func (s *SingleRuntime) AddCAFileEntry(caFile, payload string) error
AddCAFileEntry adds an entry into the CA file
func (*SingleRuntime) AddCrtListEntry ¶
func (s *SingleRuntime) AddCrtListEntry(crtList string, entry models.SslCrtListEntry) error
AddCrtListEntry adds an entry into the CrtList file
func (*SingleRuntime) AddMapEntry ¶
func (s *SingleRuntime) AddMapEntry(name, key, value string) error
AddMapEntry adds an entry into the map file
func (*SingleRuntime) AddMapEntryVersioned ¶
func (s *SingleRuntime) AddMapEntryVersioned(version, name, key, value string) error
AddMapEntryVersioned adds an entry into the map file
func (*SingleRuntime) AddMapPayload ¶
func (s *SingleRuntime) AddMapPayload(name, payload string) error
AddMapPayload adds multiple entries to the map file payload param is a multi-line string where each line is a key/value pair
func (*SingleRuntime) AddMapPayloadVersioned ¶
func (s *SingleRuntime) AddMapPayloadVersioned(version, name, payload string) error
func (*SingleRuntime) AddServer ¶
func (s *SingleRuntime) AddServer(backend, name, attributes string) error
AddServer adds a new server to a backend
func (*SingleRuntime) ClearAllCounters ¶ added in v6.1.0
func (s *SingleRuntime) ClearAllCounters() error
ClearAllCounters sets all counters to zero using the runtime API REF: https://www.haproxy.com/documentation/haproxy-runtime-api/reference/clear-counters-all/
func (*SingleRuntime) ClearCounters ¶ added in v6.1.0
func (s *SingleRuntime) ClearCounters() error
ClearCounters sets all max counters to zero using the runtime API To reset all counters see ClearAllCounters() REF: https://www.haproxy.com/documentation/haproxy-runtime-api/reference/clear-counters/
func (*SingleRuntime) ClearMap ¶
func (s *SingleRuntime) ClearMap(name string) error
ClearMap removes all map entries from the map file.
func (*SingleRuntime) ClearMapVersioned ¶
func (s *SingleRuntime) ClearMapVersioned(name, version string) error
ClearMapVersioned removes all map entries from the map file.
func (*SingleRuntime) CommitACL ¶
func (s *SingleRuntime) CommitACL(version, aclID string) error
func (*SingleRuntime) CommitCAFile ¶ added in v6.2.0
func (s *SingleRuntime) CommitCAFile(caFile string) error
CommitCAFile commits a CA file
func (*SingleRuntime) CommitCertificate ¶ added in v6.2.0
func (s *SingleRuntime) CommitCertificate(storageName string) error
func (*SingleRuntime) CommitCrlFile ¶ added in v6.2.0
func (s *SingleRuntime) CommitCrlFile(crlFile string) error
CommitCrlFile commits a Crl file
func (*SingleRuntime) CommitMap ¶
func (s *SingleRuntime) CommitMap(version, name string) error
func (*SingleRuntime) DeleteACLFileEntry ¶
func (s *SingleRuntime) DeleteACLFileEntry(aclID, value string) error
DeleteACLFileEntry deletes all the Acl entries from the Acl by its value
func (*SingleRuntime) DeleteCAFile ¶ added in v6.2.0
func (s *SingleRuntime) DeleteCAFile(caFile string) error
DeleteCAFile deletes a CA file
func (*SingleRuntime) DeleteCertificate ¶ added in v6.2.0
func (s *SingleRuntime) DeleteCertificate(storageName string) error
func (*SingleRuntime) DeleteCrlFile ¶ added in v6.2.0
func (s *SingleRuntime) DeleteCrlFile(crlFile string) error
DeleteCrlFile deletes a Crl file
func (*SingleRuntime) DeleteCrtListEntry ¶
func (s *SingleRuntime) DeleteCrtListEntry(crtList, certFile string, lineNumber *int64) error
DeleteCrtListEntry deletes all the CrtList entries from the CrtList by its id
func (*SingleRuntime) DeleteMapEntry ¶
func (s *SingleRuntime) DeleteMapEntry(name, id string) error
DeleteMapEntry deletes all the map entries from the map by its id
func (*SingleRuntime) DeleteServer ¶
func (s *SingleRuntime) DeleteServer(backend, name string) error
DeleteServer removes a server from a backend
func (*SingleRuntime) DisableAgentCheck ¶
func (s *SingleRuntime) DisableAgentCheck(backend, server string) error
DisableAgentCheck disable agent check for server
func (*SingleRuntime) DisableServer ¶
func (s *SingleRuntime) DisableServer(backend, server string) error
DisableServer marks server as DOWN for maintenance
func (*SingleRuntime) EnableAgentCheck ¶
func (s *SingleRuntime) EnableAgentCheck(backend, server string) error
EnableAgentCheck enable agent check for server
func (*SingleRuntime) EnableServer ¶
func (s *SingleRuntime) EnableServer(backend, server string) error
EnableServer marks server as UP
func (*SingleRuntime) EnableServerHealth ¶ added in v6.0.7
func (s *SingleRuntime) EnableServerHealth(backend, server string) error
EnableServerHealth enable health check for server
func (*SingleRuntime) Execute ¶
func (s *SingleRuntime) Execute(command string) error
Execute executes command on runtime API
func (*SingleRuntime) ExecuteMaster ¶
func (s *SingleRuntime) ExecuteMaster(command string) (string, error)
func (*SingleRuntime) ExecuteRaw ¶
func (s *SingleRuntime) ExecuteRaw(command string) (string, error)
ExecuteRaw executes command on runtime API and returns raw result
func (*SingleRuntime) ExecuteWithResponse ¶
func (s *SingleRuntime) ExecuteWithResponse(command string) (string, error)
func (*SingleRuntime) GetACL ¶
func (s *SingleRuntime) GetACL(storageName string) (*models.ACLFile, error)
GetACL returns one structured runtime Acl file
func (*SingleRuntime) GetACLFileEntry ¶
func (s *SingleRuntime) GetACLFileEntry(aclID, value string) (*models.ACLFileEntry, error)
GetACLFileEntry returns one Acl runtime setting
func (*SingleRuntime) GetCAFile ¶ added in v6.2.0
func (s *SingleRuntime) GetCAFile(caFile string) (*models.SslCaFile, error)
GetCAFile returns one CA file description
func (*SingleRuntime) GetCert ¶
func (s *SingleRuntime) GetCert(storageName string) (*models.SslCertificate, error)
GetCert returns one structured runtime certs
func (*SingleRuntime) GetCrlFile ¶ added in v6.2.0
func (s *SingleRuntime) GetCrlFile(crlFile string) (*models.SslCrl, error)
GetCrlFile returns a Crl file description
func (*SingleRuntime) GetCrtList ¶
func (s *SingleRuntime) GetCrtList(file string) (*models.SslCrtList, error)
GetCrtList returns one structured runtime CrtList file
func (*SingleRuntime) GetInfo ¶
func (s *SingleRuntime) GetInfo() models.ProcessInfo
GetInfo fetches HAProxy info from runtime API
func (*SingleRuntime) GetMap ¶
func (s *SingleRuntime) GetMap(name string) (*models.Map, error)
GetMap returns one structured runtime map file
func (*SingleRuntime) GetMapEntry ¶
func (s *SingleRuntime) GetMapEntry(name, id string) (*models.MapEntry, error)
GetMapEntry returns one map runtime setting
func (*SingleRuntime) GetServerState ¶
func (s *SingleRuntime) GetServerState(backend, server string) (*models.RuntimeServer, error)
GetServersState returns server runtime state
func (*SingleRuntime) GetServersState ¶
func (s *SingleRuntime) GetServersState(backend string) (models.RuntimeServers, error)
GetServersState returns servers runtime state
func (*SingleRuntime) GetStats ¶
func (s *SingleRuntime) GetStats() models.NativeStats
GetStats fetches HAProxy stats from runtime API
func (*SingleRuntime) GetTableEntries ¶
func (s *SingleRuntime) GetTableEntries(name string, filter []string, key string) (models.StickTableEntries, error)
GetTableEntries returns Stick Tables entries
func (*SingleRuntime) Init ¶
func (s *SingleRuntime) Init(socketPath string, masterWorkerMode bool, opt ...options.RuntimeOptions) error
Init must be given path to runtime socket and a flag to indicate if it's in master-worker mode.
func (*SingleRuntime) IsValid ¶
func (s *SingleRuntime) IsValid() bool
func (*SingleRuntime) NewCAFile ¶ added in v6.2.0
func (s *SingleRuntime) NewCAFile(caFile string) error
NewCAFile creates a new empty CA file
func (*SingleRuntime) NewCertificate ¶ added in v6.2.0
func (s *SingleRuntime) NewCertificate(storageName string) error
func (*SingleRuntime) NewCrlFile ¶ added in v6.2.0
func (s *SingleRuntime) NewCrlFile(crlFile string) error
NewCrlFile creates a new empty Crl
func (*SingleRuntime) PrepareACL ¶
func (s *SingleRuntime) PrepareACL(aclID string) (string, error)
func (*SingleRuntime) PrepareMap ¶
func (s *SingleRuntime) PrepareMap(name string) (string, error)
func (*SingleRuntime) SetCAFile ¶ added in v6.2.0
func (s *SingleRuntime) SetCAFile(caFile, payload string) error
SetCAFile sets a certificate payload to a CA file
func (*SingleRuntime) SetCertificate ¶ added in v6.2.0
func (s *SingleRuntime) SetCertificate(storageName string, payload string) error
func (*SingleRuntime) SetCrlFile ¶ added in v6.2.0
func (s *SingleRuntime) SetCrlFile(crlFile string, payload string) error
SetCrlFile sets a payload to a Crl file
func (*SingleRuntime) SetFrontendMaxConn ¶
func (s *SingleRuntime) SetFrontendMaxConn(frontend string, maxconn int) error
SetFrontendMaxConn set maxconn for frontend
func (*SingleRuntime) SetMapEntry ¶
func (s *SingleRuntime) SetMapEntry(name, id, value string) error
SetMapEntry replaces the value corresponding to each id in a map
func (*SingleRuntime) SetOcspResponse ¶ added in v6.2.0
func (s *SingleRuntime) SetOcspResponse(payload string) error
SetOcspResponse update an OCSP Response for a certificate using a payload
func (*SingleRuntime) SetRateLimitSSLSessionGlobal ¶ added in v6.2.0
func (s *SingleRuntime) SetRateLimitSSLSessionGlobal(value uint64) error
SetRateLimitSSLSessionGlobal sets the SSL session global rate limit
func (*SingleRuntime) SetServerAddr ¶
func (s *SingleRuntime) SetServerAddr(backend, server string, ip string, port int) error
SetServerAddr set ip [port] for server
func (*SingleRuntime) SetServerAgentAddr ¶
func (s *SingleRuntime) SetServerAgentAddr(backend, server string, addr string) error
SetServerAgentAddr set agent-addr for server
func (*SingleRuntime) SetServerAgentSend ¶
func (s *SingleRuntime) SetServerAgentSend(backend, server string, send string) error
SetServerAgentSend set agent-send for server
func (*SingleRuntime) SetServerCheckPort ¶
func (s *SingleRuntime) SetServerCheckPort(backend, server string, port int) error
SetServerCheckPort set health heck port for server
func (*SingleRuntime) SetServerHealth ¶
func (s *SingleRuntime) SetServerHealth(backend, server string, health string) error
SetServerHealth set health for server
func (*SingleRuntime) SetServerState ¶
func (s *SingleRuntime) SetServerState(backend, server string, state string) error
SetServerState set state for server
func (*SingleRuntime) SetServerWeight ¶
func (s *SingleRuntime) SetServerWeight(backend, server string, weight string) error
SetServerWeight set weight for server
func (*SingleRuntime) SetTableEntry ¶
func (s *SingleRuntime) SetTableEntry(table, key string, dataType models.StickTableEntry) error
SetTableEntry create or update a stick-table entry in the table.
func (*SingleRuntime) ShowACLFileEntries ¶
func (s *SingleRuntime) ShowACLFileEntries(storageName string) (models.ACLFilesEntries, error)
ShowACLFileEntries returns one acl runtime entries
func (*SingleRuntime) ShowACLS ¶
func (s *SingleRuntime) ShowACLS() (models.ACLFiles, error)
ShowACLS returns Acl files description from runtime
func (*SingleRuntime) ShowCAFile ¶ added in v6.2.0
func (s *SingleRuntime) ShowCAFile(caFile string, index *int64) (*models.SslCertificate, error)
ShowCAFile returns one CA file
func (*SingleRuntime) ShowCAFiles ¶ added in v6.2.0
func (s *SingleRuntime) ShowCAFiles() (models.SslCaFiles, error)
ShowCAFiles returns CA files description from runtime
func (*SingleRuntime) ShowCertificate ¶ added in v6.2.0
func (s *SingleRuntime) ShowCertificate(storageName string) (*models.SslCertificate, error)
func (*SingleRuntime) ShowCerts ¶
func (s *SingleRuntime) ShowCerts() (models.SslCertificates, error)
ShowCerts returns cert files description from runtime
func (*SingleRuntime) ShowCrlFile ¶ added in v6.2.0
func (s *SingleRuntime) ShowCrlFile(crlFile string, index *int64) (*models.SslCrlEntries, error)
ShowCrlFile returns one or more entries in a Crl file
func (*SingleRuntime) ShowCrlFiles ¶ added in v6.2.0
func (s *SingleRuntime) ShowCrlFiles() (models.SslCrls, error)
ShowCrlFiles returns Crl files description from runtime
func (*SingleRuntime) ShowCrtListEntries ¶
func (s *SingleRuntime) ShowCrtListEntries(file string) (models.SslCrtListEntries, error)
ShowCrtListEntries returns one CrtList runtime entries
func (*SingleRuntime) ShowCrtLists ¶
func (s *SingleRuntime) ShowCrtLists() (models.SslCrtLists, error)
ShowCrtLists returns CrtList files description from runtime
func (*SingleRuntime) ShowMapEntries ¶
func (s *SingleRuntime) ShowMapEntries(name string) (models.MapEntries, error)
ShowMapEntries returns one map runtime entries
func (*SingleRuntime) ShowMapEntriesVersioned ¶
func (s *SingleRuntime) ShowMapEntriesVersioned(name, version string) (models.MapEntries, error)
ShowMapEntriesVersioned returns one map runtime entries
func (*SingleRuntime) ShowMaps ¶
func (s *SingleRuntime) ShowMaps() (models.Maps, error)
ShowMaps returns map files description from runtime
func (*SingleRuntime) ShowOcspResponse ¶ added in v6.2.0
func (s *SingleRuntime) ShowOcspResponse(idOrPath string, ofmt ...OcspResponseFmt) (*models.SslOcspResponse, error)
ShowOcspResponse returns the contents of the corresponding OCSP response. Specifying the output format is only allowed when using a certificate ID, not a path!
func (*SingleRuntime) ShowOcspResponses ¶ added in v6.2.0
func (s *SingleRuntime) ShowOcspResponses() ([]*models.SslCertificateID, error)
ShowOcspResponses returns the IDs of the ocsp responses as well as the corresponding frontend certificate's path, the issuer's name and key hash and the serial number of the certificate for which the OCSP response was built
func (*SingleRuntime) ShowOcspUpdates ¶ added in v6.2.0
func (s *SingleRuntime) ShowOcspUpdates() ([]*models.SslOcspUpdate, error)
ShowOcspUpdates displays the entries concerned by the OCSP update
func (*SingleRuntime) ShowSSLProviders ¶ added in v6.2.0
func (s *SingleRuntime) ShowSSLProviders() (*models.SslProviders, error)
ShowSSLProviders shows the names of the providers loaded by OpenSSL during init
func (*SingleRuntime) ShowTable ¶
func (s *SingleRuntime) ShowTable(name string) (*models.StickTable, error)
ShowTables returns one Stick Table descriptions from runtime
func (*SingleRuntime) ShowTables ¶
func (s *SingleRuntime) ShowTables() (models.StickTables, error)
ShowTables returns Stick Tables descriptions from runtime
func (*SingleRuntime) UpdateOcspResponse ¶ added in v6.2.0
func (s *SingleRuntime) UpdateOcspResponse(certFile string) (*models.SslOcspResponse, error)
UpdateOcspResponse creates an OCSP request for the specified certFile and send it to the OCSP Responder whose URI is specified in the AIA field of the certificate
type Tables ¶
type Tables interface {
// SetTableEntry create or update a stick-table entry in the table.
SetTableEntry(table, key string, dataType models.StickTableEntry) error
// Show tables show tables from runtime API and return it structured
ShowTables() (models.StickTables, error)
// GetTableEntries returns all entries for specified table with filters and a key
GetTableEntries(name string, filter []string, key string) (models.StickTableEntries, error)
// Show table show tables {name} from runtime API and return it structured
ShowTable(name string) (*models.StickTable, error)
}