plus

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NginxAPIController

type NginxAPIController struct {
	// contains filtered or unexported fields
}

func NewNginxAPIController

func NewNginxAPIController(upstreamConfEndpoint string, statusEndpoint string, local bool) (*NginxAPIController, error)

func (*NginxAPIController) UpdateServers

func (nginx *NginxAPIController) UpdateServers(upstream string, servers []string) error

type NginxClient

type NginxClient struct {
	// contains filtered or unexported fields
}

NginxClient lets you add/remove servers to/from NGINX Plus via its upstream_conf API

func NewNginxClient

func NewNginxClient(upstreamConfEndpoint string, statusEndpoint string) (*NginxClient, error)

NewNginxClient creates an NginxClient.

func (*NginxClient) AddHTTPServer

func (client *NginxClient) AddHTTPServer(upstream string, server string) error

AddHTTPServer adds the server to the upstream.

func (*NginxClient) CheckIfUpstreamExists

func (client *NginxClient) CheckIfUpstreamExists(upstream string) error

CheckIfUpstreamExists checks if the upstream exists in NGINX. If the upstream doesn't exist, it returns an error.

func (*NginxClient) DeleteHTTPServer

func (client *NginxClient) DeleteHTTPServer(upstream string, server string) error

DeleteHTTPServer the server from the upstream.

func (*NginxClient) GetHTTPServers

func (client *NginxClient) GetHTTPServers(upstream string) ([]string, error)

GetHTTPServers returns the servers of the upsteam from NGINX.

func (*NginxClient) UpdateHTTPServers

func (client *NginxClient) UpdateHTTPServers(upstream string, servers []string) ([]string, []string, error)

UpdateHTTPServers updates the servers of the upstream. Servers that are in the slice, but don't exist in NGINX will be added to NGINX. Servers that aren't in the slice, but exist in NGINX, will be removed from NGINX.

Jump to

Keyboard shortcuts

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