remote

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2015 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NetworkController methods
	ActivateMethod           = "Activate"
	GetNetworkMethod         = "GetNetwork"
	CreateNetworkMethod      = "CreateNetwork"
	UpdateNetworkMethod      = "UpdateNetwork"
	CheckTenantIDMethod      = "CheckTenantID"
	DeleteNetworkMethod      = "DeleteNetwork"
	GetLoadBalancerMethod    = "GetLoadBalancer"
	CreateLoadBalancerMethod = "CreateLoadBalancer"
	UpdateLoadBalancerMethod = "UpdateLoadBalancer"
	DeleteLoadBalancerMethod = "DeleteLoadBalancer"

	// Kubelet methods
	SetupPodMethod    = "SetupPod"
	TeardownPodMethod = "TeardownPod"
	PodStatudMethod   = "PodStatus"
)

Variables

View Source
var (
	// ErrNotFound plugin not found
	ErrNotFound = errors.New("Plugin not found")
	PluginsPath = "/usr/lib/kubernetes/plugins"
)

Functions

func ProbeNetworkProviders

func ProbeNetworkProviders()

Types

type ActivateResponse

type ActivateResponse struct {
	Result bool `json:"Result"`
	Response
}

type CheckTenantIDRequest

type CheckTenantIDRequest struct {
	TenantID string `json:"tenantID,omitempty"`
}

type CheckTenantIDResponse

type CheckTenantIDResponse struct {
	Result bool `json:"Result"`
	Response
}

type CreateLoadBalancerRequest

type CreateLoadBalancerRequest struct {
	LoadBalancer *networkprovider.LoadBalancer `json:"loadBalancer"`
	Affinity     api.ServiceAffinity           `json:"affinity"`
}

type CreateLoadBalancerResponse

type CreateLoadBalancerResponse struct {
	Result *CreateLoadBalancerResult `json:"Result"`
	Response
}

type CreateLoadBalancerResult

type CreateLoadBalancerResult struct {
	VIP string `json:"VIP"`
}

type CreateNetworkRequest

type CreateNetworkRequest struct {
	Network *networkprovider.Network `json:"Network,omitempty"`
}

type CreateNetworkResponse

type CreateNetworkResponse struct {
	Response
}

type DeleteLoadBalancerRequest

type DeleteLoadBalancerRequest struct {
	Name string `json:"name"`
}

type DeleteLoadBalancerResponse

type DeleteLoadBalancerResponse struct {
	Response
}

type DeleteNetworkRequest

type DeleteNetworkRequest struct {
	Name string `json:"name"`
}

type DeleteNetworkResponse

type DeleteNetworkResponse struct {
	Response
}

type GetLoadBalancerRequest

type GetLoadBalancerRequest struct {
	Name string `json:"name"`
}

type GetLoadBalancerResponse

type GetLoadBalancerResponse struct {
	Response
	Result *networkprovider.LoadBalancer `json:"Result"`
}

type GetNetworkRequest

type GetNetworkRequest struct {
	Name string `json:"name,omitempty"`
	ID   string `json:"id,omitempty"`
}

type GetNetworkResponse

type GetNetworkResponse struct {
	Response
	Result *networkprovider.Network `json:"Result"`
}

type LocalRegistry

type LocalRegistry struct{}

LocalRegistry defines a registry that is local (using unix socket).

func (*LocalRegistry) Plugin

func (l *LocalRegistry) Plugin(name string) (*Plugin, error)

Plugin returns the plugin registered with the given name (or returns an error).

type Plugin

type Plugin struct {
	// Name of the plugin
	Name string `json:"-"`
	// Address of the plugin
	Addr string
	// TLS configuration of the plugin
	TLSConfig tlsconfig.Options
	// Client attached to the plugin
	Client *sock.Client `json:"-"`
	// contains filtered or unexported fields
}

Plugin is the definition of a docker plugin.

func GetPlugin

func GetPlugin(name string) (*Plugin, error)

func (*Plugin) CheckTenantID

func (p *Plugin) CheckTenantID(tenantID string) (bool, error)

func (*Plugin) CreateLoadBalancer

func (p *Plugin) CreateLoadBalancer(loadBalancer *networkprovider.LoadBalancer, affinity api.ServiceAffinity) (string, error)

Create load balancer, return ip and externalIP

func (*Plugin) CreateNetwork

func (p *Plugin) CreateNetwork(network *networkprovider.Network) error

Create network

func (*Plugin) DeleteLoadBalancer

func (p *Plugin) DeleteLoadBalancer(name string) error

Delete load balancer

func (*Plugin) DeleteNetwork

func (p *Plugin) DeleteNetwork(networkName string) error

Delete network by networkName

func (*Plugin) GetLoadBalancer

func (p *Plugin) GetLoadBalancer(name string) (*networkprovider.LoadBalancer, error)

Get load balancer by name

func (*Plugin) GetNetwork

func (p *Plugin) GetNetwork(networkName string) (*networkprovider.Network, error)

Get network by networkName

func (*Plugin) GetNetworkByID

func (p *Plugin) GetNetworkByID(networkID string) (*networkprovider.Network, error)

Get network by networkID

func (*Plugin) LoadBalancers

func (p *Plugin) LoadBalancers() networkprovider.LoadBalancers

LoadBalancer interface is self

func (*Plugin) Networks

func (p *Plugin) Networks() networkprovider.Networks

Network interface is self

func (*Plugin) PodStatus

func (p *Plugin) PodStatus(podName, namespace, podInfraContainerID string, network *networkprovider.Network, containerRuntime string) (string, error)

Status of pod

func (*Plugin) Pods

func (p *Plugin) Pods() networkprovider.Pods

Pods interface is self

func (*Plugin) ProviderName

func (p *Plugin) ProviderName() string

func (*Plugin) SetupPod

func (p *Plugin) SetupPod(podName, namespace, podInfraContainerID string, network *networkprovider.Network, containerRuntime string) error

Setup pod

func (*Plugin) TeardownPod

func (p *Plugin) TeardownPod(podName, namespace, podInfraContainerID string, network *networkprovider.Network, containerRuntime string) error

Teardown pod

func (*Plugin) UpdateLoadBalancer

func (p *Plugin) UpdateLoadBalancer(name string, hosts []*networkprovider.HostPort, externalIPs []string) (string, error)

Update load balancer, return externalIP

func (*Plugin) UpdateNetwork

func (p *Plugin) UpdateNetwork(network *networkprovider.Network) error

Update network

type Plugins

type Plugins struct {
	sync.Mutex
	// contains filtered or unexported fields
}

type PodStatusRequest

type PodStatusRequest struct {
	PodName             string                   `json:"podName"`
	Namespace           string                   `json:"namespace"`
	ContainerRuntime    string                   `json:"containerRuntime"`
	PodInfraContainerID string                   `json:"podInfraContainerID"`
	Network             *networkprovider.Network `json:"network"`
}

type PodStatusResponse

type PodStatusResponse struct {
	Result *PodStatusResult `json:"Result"`
	Response
}

type PodStatusResult

type PodStatusResult struct {
	IP string `json:"IP,omitempty"`
}

type Registry

type Registry interface {
	// Plugins lists all plugins.
	Plugins() ([]*Plugin, error)
	// Plugin returns the plugin registered with the given name (or returns an error).
	Plugin(name string) (*Plugin, error)
}

Registry defines behavior of a registry of plugins.

type Response

type Response struct {
	Err string `json:"Err"`
}

func (*Response) GetError

func (r *Response) GetError() string

type SetupPodRequest

type SetupPodRequest struct {
	PodName             string                   `json:"podName"`
	Namespace           string                   `json:"namespace"`
	ContainerRuntime    string                   `json:"containerRuntime"`
	PodInfraContainerID string                   `json:"podInfraContainerID"`
	Network             *networkprovider.Network `json:"network"`
}

type SetupPodResponse

type SetupPodResponse struct {
	Response
}

type TeardownPodRequest

type TeardownPodRequest struct {
	PodName             string                   `json:"podName"`
	Namespace           string                   `json:"namespace"`
	ContainerRuntime    string                   `json:"containerRuntime"`
	PodInfraContainerID string                   `json:"podInfraContainerID"`
	Network             *networkprovider.Network `json:"network"`
}

type TeardownPodResponse

type TeardownPodResponse struct {
	Response
}

type UpdateLoadBalancerRequest

type UpdateLoadBalancerRequest struct {
	Name        string                      `json:"name"`
	Hosts       []*networkprovider.HostPort `json:"hosts"`
	ExternalIPs []string                    `json:"externalIPs"`
}

type UpdateLoadBalancerResponse

type UpdateLoadBalancerResponse struct {
	Result *UpdateLoadBalancerResult `json:"Result"`
	Response
}

type UpdateLoadBalancerResult

type UpdateLoadBalancerResult struct {
	VIP string `json:"VIP,omitempty"`
}

type UpdateNetworkRequest

type UpdateNetworkRequest struct {
	Network *networkprovider.Network `json:"Network,omitempty"`
}

type UpdateNetworkResponse

type UpdateNetworkResponse struct {
	Response
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳