loadbalancer

package
v0.0.0-...-a355528 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Adapt

func Adapt(name plugin.Name, rpcClient rpc_client.Client) loadbalancer.L4

Adapt converts a rpc client to a Plugin object

func NewClient

func NewClient(name plugin.Name, socketPath string) (loadbalancer.L4, error)

NewClient returns a plugin interface implementation connected to a plugin

Types

type BackendsRequest

type BackendsRequest struct {
	Type string
}

BackendsRequest is the rpc wrapper for Backends request

func (BackendsRequest) Plugin

func (r BackendsRequest) Plugin() (plugin.Name, error)

Plugin implements pkg/rpc/internal/Addressable

type BackendsResponse

type BackendsResponse struct {
	Type string
	IDs  []instance.ID
}

BackendsResponse is the rpc response for Backends call

type ConfigureHealthCheckRequest

type ConfigureHealthCheckRequest struct {
	Type                     string
	loadbalancer.HealthCheck `json:",inline" yaml:",inline"`
}

ConfigureHealthCheckRequest is the rpc wrapper for ConfigureHealthCheck request

func (ConfigureHealthCheckRequest) Plugin

Plugin implements pkg/rpc/internal/Addressable

type ConfigureHealthCheckResponse

type ConfigureHealthCheckResponse struct {
	Type   string
	Result string
}

ConfigureHealthCheckResponse is the rpc wrapper for ConfigureHealthCheck response

type DeregisterBackendsRequest

type DeregisterBackendsRequest struct {
	Type string
	IDs  []instance.ID
}

DeregisterBackendsRequest is the rpc wrapper for DeregisterBackend request

func (DeregisterBackendsRequest) Plugin

Plugin implements pkg/rpc/internal/Addressable

type DeregisterBackendsResponse

type DeregisterBackendsResponse struct {
	Type   string
	Result string
}

DeregisterBackendsResponse is the rpc wrapper for DeregisterBackend response

type L4

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

L4 is the exported type for json-rpc

func PluginServer

func PluginServer(l4 loadbalancer.L4) *L4

PluginServer returns a L4 load balancer that conforms to the net/rpc rpc call convention.

func PluginServerWithNames

func PluginServerWithNames(list func() (map[string]loadbalancer.L4, error)) *L4

PluginServerWithNames returns a loadbalancer map of plugins by name

func (*L4) Backends

func (l4 *L4) Backends(_ *http.Request, req *BackendsRequest, resp *BackendsResponse) error

Backends returns the list of backends

func (*L4) ConfigureHealthCheck

func (l4 *L4) ConfigureHealthCheck(_ *http.Request, req *ConfigureHealthCheckRequest, resp *ConfigureHealthCheckResponse) error

ConfigureHealthCheck configures the health checks for instance removal and reconfiguration

func (*L4) DeregisterBackends

func (l4 *L4) DeregisterBackends(_ *http.Request, req *DeregisterBackendsRequest, resp *DeregisterBackendsResponse) error

DeregisterBackends removes the specified instances from the backend pool

func (*L4) ImplementedInterface

func (l4 *L4) ImplementedInterface() spi.InterfaceSpec

ImplementedInterface returns the interface implemented by this RPC service.

func (*L4) Name

func (l4 *L4) Name(_ *http.Request, req *NameRequest, resp *NameResponse) error

Name returns the name of the load balancer

func (*L4) Publish

func (l4 *L4) Publish(_ *http.Request, req *PublishRequest, resp *PublishResponse) error

Publish publishes a route in the LB by adding a load balancing rule

func (*L4) RegisterBackends

func (l4 *L4) RegisterBackends(_ *http.Request, req *RegisterBackendsRequest, resp *RegisterBackendsResponse) error

RegisterBackends registers instances identified by the IDs to the LB's backend pool

func (*L4) Routes

func (l4 *L4) Routes(_ *http.Request, req *RoutesRequest, resp *RoutesResponse) error

Routes lists all known routes.

func (*L4) Types

func (l4 *L4) Types() []string

Types returns the types exposed by this kind of RPC service

func (*L4) Unpublish

func (l4 *L4) Unpublish(_ *http.Request, req *UnpublishRequest, resp *UnpublishResponse) error

Unpublish dissociates the load balancer from the backend service at the given port.

func (*L4) VendorInfo

func (l4 *L4) VendorInfo() *spi.VendorInfo

VendorInfo returns a metadata object about the plugin, if the plugin implements it. See plugin.Vendor

type NameRequest

type NameRequest struct {
	Type string
}

NameRequest is the rpc wrapper for the Name request

func (NameRequest) Plugin

func (r NameRequest) Plugin() (plugin.Name, error)

Plugin implements pkg/rpc/internal/Addressable

type NameResponse

type NameResponse struct {
	Type string
	Name string
}

NameResponse is the rpc wrapper for the Name response

type PublishRequest

type PublishRequest struct {
	Type  string
	Route loadbalancer.Route
}

PublishRequest is the rpc wrapper for Publish request

func (PublishRequest) Plugin

func (r PublishRequest) Plugin() (plugin.Name, error)

Plugin implements pkg/rpc/internal/Addressable

type PublishResponse

type PublishResponse struct {
	Type   string
	Result string
}

PublishResponse is the rpc wrapper for Publish response

type RegisterBackendsRequest

type RegisterBackendsRequest struct {
	Type string
	IDs  []instance.ID
}

RegisterBackendsRequest is the rpc wrapper for RegisterBackend request

func (RegisterBackendsRequest) Plugin

func (r RegisterBackendsRequest) Plugin() (plugin.Name, error)

Plugin implements pkg/rpc/internal/Addressable

type RegisterBackendsResponse

type RegisterBackendsResponse struct {
	Type   string
	Result string
}

RegisterBackendsResponse is the rpc wrapper for RegisterBackend response

type RoutesRequest

type RoutesRequest struct {
	Type string
}

RoutesRequest is the rpc wrapper for Routes request

func (RoutesRequest) Plugin

func (r RoutesRequest) Plugin() (plugin.Name, error)

Plugin implements pkg/rpc/internal/Addressable

type RoutesResponse

type RoutesResponse struct {
	Type   string
	Routes []loadbalancer.Route
}

RoutesResponse is the rpc wrapper for Routes response

type UnpublishRequest

type UnpublishRequest struct {
	Type    string
	ExtPort int
}

UnpublishRequest is the rpc wrapper for Unpublish request

func (UnpublishRequest) Plugin

func (r UnpublishRequest) Plugin() (plugin.Name, error)

Plugin implements pkg/rpc/internal/Addressable

type UnpublishResponse

type UnpublishResponse struct {
	Type   string
	Result string
}

UnpublishResponse is the rpc wrapper for Unpublish response

Jump to

Keyboard shortcuts

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