distribution

package
v0.1.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

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

Cluster - distribution model

func NewClusterModel

func NewClusterModel(ctx context.Context, stg storage.Storage) *Cluster

NewClusterModel - return new cluster model

func (*Cluster) Get

func (c *Cluster) Get() (*types.Cluster, error)

Info - get cluster info

func (*Cluster) Watch

func (c *Cluster) Watch(ch chan types.ClusterEvent)

Watch cluster changes

type Config

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

func NewConfigModel

func NewConfigModel(ctx context.Context, stg storage.Storage) *Config

func (*Config) Create

func (n *Config) Create(namespace *types.Namespace, config *types.Config) (*types.Config, error)

func (*Config) Get

func (n *Config) Get(namespace, name string) (*types.Config, error)

func (*Config) List

func (n *Config) List(filter string) (*types.ConfigList, error)

func (*Config) Remove

func (n *Config) Remove(config *types.Config) error

func (*Config) Update

func (n *Config) Update(config *types.Config) (*types.Config, error)

func (*Config) Watch

func (n *Config) Watch(ch chan types.ConfigEvent, rev *int64) error

type Deployment

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

Deployment - distribution model

func NewDeploymentModel

func NewDeploymentModel(ctx context.Context, stg storage.Storage) *Deployment

func (*Deployment) Cancel

func (d *Deployment) Cancel(dt *types.Deployment) error

Cancel deployment

func (*Deployment) Create

func (d *Deployment) Create(service *types.Service, version int) (*types.Deployment, error)

Create new deployment

func (*Deployment) Destroy

func (d *Deployment) Destroy(dt *types.Deployment) error

Destroy deployment

func (*Deployment) Get

func (d *Deployment) Get(namespace, service, name string) (*types.Deployment, error)

Get deployment info by namespace service and deployment name

func (*Deployment) ListByNamespace

func (d *Deployment) ListByNamespace(namespace string) (*types.DeploymentList, error)

ListByService - list of deployments by service

func (*Deployment) ListByService

func (d *Deployment) ListByService(namespace, service string) (*types.DeploymentList, error)

ListByService - list of deployments by service

func (*Deployment) Remove

func (d *Deployment) Remove(dt *types.Deployment) error

Destroy deployment

func (*Deployment) Runtime

func (d *Deployment) Runtime() (*types.Runtime, error)

func (*Deployment) Update

func (d *Deployment) Update(dt *types.Deployment) error

Update deployment

func (*Deployment) Watch

func (d *Deployment) Watch(dt chan types.DeploymentEvent, rev *int64) error

Watch deployment changes

type Discovery

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

func NewDiscoveryModel

func NewDiscoveryModel(ctx context.Context, stg storage.Storage) *Discovery

func (*Discovery) Get

func (n *Discovery) Get(name string) (*types.Discovery, error)

func (*Discovery) List

func (n *Discovery) List() (*types.DiscoveryList, error)

func (*Discovery) Put

func (n *Discovery) Put(discovery *types.Discovery) error

func (*Discovery) Remove

func (n *Discovery) Remove(discovery *types.Discovery) error

func (*Discovery) Set

func (n *Discovery) Set(discovery *types.Discovery) error

func (*Discovery) SetOnline

func (n *Discovery) SetOnline(discovery *types.Discovery) error

func (*Discovery) Watch

func (n *Discovery) Watch(ch chan types.DiscoveryEvent, rev *int64) error

func (*Discovery) WatchOnline

func (n *Discovery) WatchOnline(ch chan types.DiscoveryStatusEvent) error

type Endpoint

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

func NewEndpointModel

func NewEndpointModel(ctx context.Context, stg storage.Storage) *Endpoint

func (*Endpoint) Create

func (e *Endpoint) Create(namespace, service string, opts *types.EndpointCreateOptions) (*types.Endpoint, error)

func (*Endpoint) Get

func (e *Endpoint) Get(namespace, service string) (*types.Endpoint, error)

func (*Endpoint) ListByNamespace

func (e *Endpoint) ListByNamespace(namespace string) (*types.EndpointList, error)

func (*Endpoint) ManifestAdd

func (e *Endpoint) ManifestAdd(name string, manifest *types.EndpointManifest) error

Add particular network manifest

func (*Endpoint) ManifestDel

func (e *Endpoint) ManifestDel(name string) error

Del particular network manifest

func (*Endpoint) ManifestGet

func (e *Endpoint) ManifestGet(name string) (*types.EndpointManifest, error)

Get particular network manifest

func (*Endpoint) ManifestGetName

func (e *Endpoint) ManifestGetName(namespace, service string) string

func (*Endpoint) ManifestMap

func (e *Endpoint) ManifestMap() (*types.EndpointManifestMap, error)

Get network subnet manifests map

func (*Endpoint) ManifestSet

func (e *Endpoint) ManifestSet(name string, manifest *types.EndpointManifest) error

Set particular network manifest

func (*Endpoint) ManifestWatch

func (e *Endpoint) ManifestWatch(ch chan types.EndpointManifestEvent, rev *int64) error

watch subnet manifests

func (*Endpoint) Remove

func (e *Endpoint) Remove(endpoint *types.Endpoint) error

func (*Endpoint) SetSpec

func (e *Endpoint) SetSpec(endpoint *types.Endpoint, spec *types.EndpointSpec) (*types.Endpoint, error)

func (*Endpoint) Update

func (e *Endpoint) Update(endpoint *types.Endpoint, opts *types.EndpointUpdateOptions) (*types.Endpoint, error)

func (*Endpoint) Watch

func (e *Endpoint) Watch(ch chan types.EndpointEvent, rev *int64) error

Watch endpoint changes

type Ingress

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

func NewIngressModel

func NewIngressModel(ctx context.Context, stg storage.Storage) *Ingress

func (*Ingress) Get

func (n *Ingress) Get(name string) (*types.Ingress, error)

func (*Ingress) List

func (n *Ingress) List() (*types.IngressList, error)

func (*Ingress) Put

func (n *Ingress) Put(ingress *types.Ingress) error

func (*Ingress) Remove

func (n *Ingress) Remove(ingress *types.Ingress) error

func (*Ingress) Set

func (n *Ingress) Set(ingress *types.Ingress) error

func (*Ingress) Watch

func (n *Ingress) Watch(ch chan types.IngressEvent, rev *int64) error

type NM

type NM struct {
	Meta   struct{}
	Entity Namespace
}

func (*NM) Set

func (n *NM) Set(Namespace) error

type Namespace

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

func NewNamespaceModel

func NewNamespaceModel(ctx context.Context, stg storage.Storage) *Namespace

func (*Namespace) Create

func (n *Namespace) Create(ns *types.Namespace) (*types.Namespace, error)

func (*Namespace) Get

func (n *Namespace) Get(name string) (*types.Namespace, error)

func (*Namespace) List

func (n *Namespace) List() (*types.NamespaceList, error)

func (*Namespace) Remove

func (n *Namespace) Remove(namespace *types.Namespace) error

func (*Namespace) Update

func (n *Namespace) Update(namespace *types.Namespace) error

func (*Namespace) Watch

func (n *Namespace) Watch(ch chan types.NamespaceEvent) error

Watch namespace changes

type Network

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

func NewNetworkModel

func NewNetworkModel(ctx context.Context, stg storage.Storage) *Network

NewNetworkModel returns new network management model

func (*Network) Del

func (s *Network) Del(net *types.Network) error

Remove network from storage

func (*Network) Get

func (s *Network) Get() (*types.Network, error)

Get network info

func (*Network) Put

func (s *Network) Put(net *types.Network) (*types.Network, error)

Create new network info

func (*Network) Runtime

func (s *Network) Runtime() (*types.Runtime, error)

func (*Network) Set

func (s *Network) Set(net *types.Network) (*types.Network, error)

Update network in namespace

func (*Network) SubnetDel

func (s *Network) SubnetDel(name string) error

Remove subnet

func (*Network) SubnetEqual

func (s *Network) SubnetEqual(snet *types.Subnet, spec types.SubnetSpec) bool

Check subnet

func (*Network) SubnetGet

func (s *Network) SubnetGet(cidr string) (*types.Subnet, error)

Get subnet by name

func (*Network) SubnetList

func (s *Network) SubnetList() ([]*types.Subnet, error)

Get subnet list

func (*Network) SubnetManifestAdd

func (s *Network) SubnetManifestAdd(snet *types.Subnet) error

Add particular network manifest

func (*Network) SubnetManifestDel

func (s *Network) SubnetManifestDel(name string) error

Del particular network manifest

func (*Network) SubnetManifestGet

func (s *Network) SubnetManifestGet(name string) (*types.SubnetManifest, error)

Get particular network manifest

func (*Network) SubnetManifestMap

func (s *Network) SubnetManifestMap() (*types.SubnetManifestMap, error)

Get network subnet manifests map

func (*Network) SubnetManifestSet

func (s *Network) SubnetManifestSet(m *types.SubnetManifest, snet *types.Subnet) error

Set particular network manifest

func (*Network) SubnetManifestWatch

func (s *Network) SubnetManifestWatch(ch chan types.SubnetManifestEvent, rev *int64) error

watch subnet manifests

func (*Network) SubnetPut

func (s *Network) SubnetPut(hostname string, spec types.SubnetSpec) (*types.Subnet, error)

Create new subnet

func (*Network) SubnetSet

func (s *Network) SubnetSet(snet *types.Subnet) error

Update subnet

func (*Network) SubnetWatch

func (s *Network) SubnetWatch(ch chan types.SubnetEvent, rev *int64) error

Watch network changes

func (*Network) Watch

func (s *Network) Watch(ch chan types.NetworkEvent, rev *int64) error

Watch network changes

type Node

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

func NewNodeModel

func NewNodeModel(ctx context.Context, stg storage.Storage) *Node

func (*Node) Get

func (n *Node) Get(hostname string) (*types.Node, error)

func (*Node) List

func (n *Node) List() (*types.NodeList, error)

func (*Node) Put

func (n *Node) Put(opts *types.NodeCreateOptions) (*types.Node, error)

func (*Node) Remove

func (n *Node) Remove(node *types.Node) error

func (*Node) Set

func (n *Node) Set(node *types.Node) error

func (*Node) Watch

func (n *Node) Watch(ch chan types.NodeEvent, rev *int64) error

Watch node changes

type Pod

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

func NewPodModel

func NewPodModel(ctx context.Context, stg storage.Storage) *Pod

func (*Pod) Create

func (p *Pod) Create(deployment *types.Deployment) (*types.Pod, error)

Create new pod

func (*Pod) Destroy

func (p *Pod) Destroy(pod *types.Pod) error

Destroy pod

func (*Pod) Get

func (p *Pod) Get(namespace, service, deployment, name string) (*types.Pod, error)

Get pod info from storage

func (*Pod) ListByDeployment

func (p *Pod) ListByDeployment(namespace, service, deployment string) (*types.PodList, error)

ListByDeployment returns pod list in selected deployment

func (*Pod) ListByNamespace

func (p *Pod) ListByNamespace(namespace string) (*types.PodList, error)

ListByNamespace returns pod list in selected namespace

func (*Pod) ListByService

func (p *Pod) ListByService(namespace, service string) (*types.PodList, error)

ListByService returns pod list in selected service

func (*Pod) ManifestAdd

func (p *Pod) ManifestAdd(node, pod string, manifest *types.PodManifest) error

func (*Pod) ManifestDel

func (p *Pod) ManifestDel(node, pod string) error

func (*Pod) ManifestGet

func (p *Pod) ManifestGet(node, pod string) (*types.PodManifest, error)

func (*Pod) ManifestMap

func (p *Pod) ManifestMap(node string) (*types.PodManifestMap, error)

func (*Pod) ManifestSet

func (p *Pod) ManifestSet(node, pod string, manifest *types.PodManifest) error

func (*Pod) ManifestWatch

func (p *Pod) ManifestWatch(node string, ch chan types.PodManifestEvent, rev *int64) error

func (*Pod) Remove

func (p *Pod) Remove(pod *types.Pod) error

Remove pod from storage

func (*Pod) Runtime

func (p *Pod) Runtime() (*types.Runtime, error)

func (*Pod) SetNode

func (p *Pod) SetNode(pod *types.Pod, node *types.Node) error

SetNode - set node info to pod

func (*Pod) Update

func (p *Pod) Update(pod *types.Pod) error

SetStatus - set state for pod

func (*Pod) Watch

func (p *Pod) Watch(ch chan types.PodEvent, rev *int64) error

type Route

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

func NewRouteModel

func NewRouteModel(ctx context.Context, stg storage.Storage) *Route

func (*Route) Add

func (r *Route) Add(namespace *types.Namespace, route *types.Route) (*types.Route, error)

func (*Route) Del

func (r *Route) Del(route *types.Route) error

func (*Route) Get

func (r *Route) Get(namespace, name string) (*types.Route, error)

func (*Route) List

func (r *Route) List() (*types.RouteList, error)

func (*Route) ListByNamespace

func (r *Route) ListByNamespace(namespace string) (*types.RouteList, error)

func (*Route) ManifestAdd

func (r *Route) ManifestAdd(ingress, route string, manifest *types.RouteManifest) error

func (*Route) ManifestDel

func (r *Route) ManifestDel(ingress, route string) error

func (*Route) ManifestGet

func (r *Route) ManifestGet(ingress, route string) (*types.RouteManifest, error)

func (*Route) ManifestMap

func (r *Route) ManifestMap(ingress string) (*types.RouteManifestMap, error)

func (*Route) ManifestSet

func (r *Route) ManifestSet(ingress, route string, manifest *types.RouteManifest) error

func (*Route) ManifestWatch

func (r *Route) ManifestWatch(ingress string, ch chan types.RouteManifestEvent, rev *int64) error

func (*Route) Runtime

func (r *Route) Runtime() (*types.Runtime, error)

func (*Route) Set

func (r *Route) Set(route *types.Route) (*types.Route, error)

func (*Route) Watch

func (r *Route) Watch(ch chan types.RouteEvent, rev *int64) error

type Secret

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

func NewSecretModel

func NewSecretModel(ctx context.Context, stg storage.Storage) *Secret

func (*Secret) Create

func (n *Secret) Create(namespace *types.Namespace, secret *types.Secret) (*types.Secret, error)

func (*Secret) Get

func (n *Secret) Get(namespace, name string) (*types.Secret, error)

func (*Secret) List

func (n *Secret) List(filter string) (*types.SecretList, error)

func (*Secret) Remove

func (n *Secret) Remove(secret *types.Secret) error

func (*Secret) Update

func (n *Secret) Update(secret *types.Secret) (*types.Secret, error)

func (*Secret) Watch

func (n *Secret) Watch(ch chan types.SecretEvent, rev *int64) error

type Service

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

func NewServiceModel

func NewServiceModel(ctx context.Context, stg storage.Storage) *Service

NewServiceModel returns new service management model

func (*Service) Create

func (s *Service) Create(namespace *types.Namespace, svc *types.Service) (*types.Service, error)

Create new service model in namespace

func (*Service) Destroy

func (s *Service) Destroy(service *types.Service) (*types.Service, error)

Destroy method marks service for destroy

func (*Service) Get

func (s *Service) Get(namespace, name string) (*types.Service, error)

Get service by namespace and service name

func (*Service) List

func (s *Service) List(namespace string) (*types.ServiceList, error)

List method return map of services in selected namespace

func (*Service) Remove

func (s *Service) Remove(service *types.Service) error

Remove service from storage

func (*Service) Runtime

func (s *Service) Runtime() (*types.Runtime, error)

func (*Service) Set

func (s *Service) Set(service *types.Service) error

Set state for deployment

func (*Service) Update

func (s *Service) Update(service *types.Service) (*types.Service, error)

Update service in namespace

func (*Service) Watch

func (s *Service) Watch(ch chan types.ServiceEvent, rev *int64) error

Watch service changes

type Volume

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

func NewVolumeModel

func NewVolumeModel(ctx context.Context, stg storage.Storage) *Volume

func (*Volume) Create

func (v *Volume) Create(namespace *types.Namespace, vol *types.Volume) (*types.Volume, error)

func (*Volume) Destroy

func (v *Volume) Destroy(volume *types.Volume) error

func (*Volume) Get

func (v *Volume) Get(namespace, name string) (*types.Volume, error)

func (*Volume) ListByNamespace

func (v *Volume) ListByNamespace(namespace string) (*types.VolumeList, error)

func (*Volume) ManifestAdd

func (v *Volume) ManifestAdd(node, volume string, manifest *types.VolumeManifest) error

func (*Volume) ManifestDel

func (v *Volume) ManifestDel(node, volume string) error

func (*Volume) ManifestGet

func (v *Volume) ManifestGet(node, volume string) (*types.VolumeManifest, error)

func (*Volume) ManifestMap

func (v *Volume) ManifestMap(node string) (*types.VolumeManifestMap, error)

func (*Volume) ManifestSet

func (v *Volume) ManifestSet(node, volume string, manifest *types.VolumeManifest) error

func (*Volume) ManifestWatch

func (p *Volume) ManifestWatch(node string, ch chan types.VolumeManifestEvent, rev *int64) error

func (*Volume) Remove

func (v *Volume) Remove(volume *types.Volume) error

func (*Volume) Runtime

func (v *Volume) Runtime() (*types.Runtime, error)

func (*Volume) Update

func (v *Volume) Update(volume *types.Volume) error

func (*Volume) Watch

func (v *Volume) Watch(ch chan types.VolumeEvent, rev *int64) error

Watch service changes

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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