Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var NewFetch = func(baseData BaseReconfigure) Fetchable {
return &fetch{
BaseReconfigure: baseData,
}
}
NewFetch returns instance of the Fetchable object
var NewReconfigure = func(baseData BaseReconfigure, serviceData proxy.Service) Reconfigurable { return &Reconfigure{ BaseReconfigure: baseData, Service: serviceData, } }
NewReconfigure creates new instance of the Reconfigurable interface
var NewReload = func() Reloader {
return &reload{}
}
NewReload returns a new instance of the struct
var NewRemove = func(serviceName, aclName, configsPath, templatesPath string, instanceName string) Removable { return &Remove{ ServiceName: serviceName, AclName: aclName, TemplatesPath: templatesPath, ConfigsPath: configsPath, InstanceName: instanceName, } }
NewRemove returns singleton based on the Removable interface
Functions ¶
This section is empty.
Types ¶
type BaseReconfigure ¶
type BaseReconfigure struct {
ConfigsPath string `short:"c" long:"configs-path" default:"/cfg" description:"The path to the configurations directory"`
InstanceName string `` /* 136-byte string literal not displayed */
TemplatesPath string `short:"t" long:"templates-path" default:"/cfg/tmpl" description:"The path to the templates directory"`
}
BaseReconfigure contains base data required to reconfigure the proxy
type Fetchable ¶
type Fetchable interface {
// Sends request to swarm-listener to request reconfiguration of all proxy instances in Swarm.
ReloadClusterConfig(listenerAddr string) error
// Reconfigures this instance of proxy based on configuration taken from swarm-listener.
// This is synchronous.
// If listenerAddr is nil, unreachable or any other problem error is returned.
ReloadConfig(baseData BaseReconfigure, listenerAddr string) error
}
Fetchable defines interface that fetches information from other sources
type Reconfigurable ¶
type Reconfigurable interface {
Execute(reloadAfter bool) error
GetData() (BaseReconfigure, proxy.Service)
GetTemplates() (front, back string, err error)
}
Reconfigurable defines mandatory interface
type Reconfigure ¶
type Reconfigure struct {
BaseReconfigure
proxy.Service
}
Reconfigure structure holds data required to reconfigure the proxy
func (*Reconfigure) Execute ¶
func (m *Reconfigure) Execute(reloadAfter bool) error
Execute creates a new configuration and reloads the proxy
func (*Reconfigure) GetData ¶
func (m *Reconfigure) GetData() (BaseReconfigure, proxy.Service)
GetData returns structure with reconfiguration data and the service
func (*Reconfigure) GetTemplates ¶
func (m *Reconfigure) GetTemplates() (front, back string, err error)
GetTemplates returns frontend and backend templates
type Removable ¶
type Removable interface {
// contains filtered or unexported methods
}
Removable defines functions that must be implemented by any struct in charge of removing services from the proxy.
type Remove ¶
type Remove struct {
ConfigsPath string `short:"c" long:"configs-path" default:"/cfg" description:"The path to the configurations directory"`
InstanceName string `` /* 136-byte string literal not displayed */
ServiceName string `short:"s" long:"service-name" required:"true" description:"The name of the service that should be removed (e.g. my-service)."`
TemplatesPath string `short:"t" long:"templates-path" default:"/cfg/tmpl" description:"The path to the templates directory"`
AclName string
}
Remove contains the information required for removing services from the proxy