actions

package
v0.0.0-...-f321956 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NewFetch = func(baseData BaseReconfigure) Fetchable {
	return &fetch{
		BaseReconfigure: baseData,
	}
}

NewFetch returns instance of the Fetchable object

View Source
var NewReconfigure = func(baseData BaseReconfigure, serviceData proxy.Service) Reconfigurable {
	return &Reconfigure{
		BaseReconfigure: baseData,
		Service:         serviceData,
	}
}

NewReconfigure creates new instance of the Reconfigurable interface

View Source
var NewReload = func() Reloader {
	return &reload{}
}

NewReload returns a new instance of the struct

View Source
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 Reloader

type Reloader interface {
	Execute(recreate bool) error
}

Reloader defines the interface for reloading HAProxy

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

func (*Remove) Execute

func (m *Remove) Execute(args []string) error

Execute initiates the removal of a service

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL