Documentation ¶
Index ¶
- type NginxAPIController
- type NginxClient
- func (client *NginxClient) AddHTTPServer(upstream string, server string) error
- func (client *NginxClient) CheckIfUpstreamExists(upstream string) error
- func (client *NginxClient) DeleteHTTPServer(upstream string, server string) error
- func (client *NginxClient) GetHTTPServers(upstream string) ([]string, error)
- func (client *NginxClient) UpdateHTTPServers(upstream string, servers []string) ([]string, []string, error)
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.
Click to show internal directories.
Click to hide internal directories.