api

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2018 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttachHooks

type AttachHooks func(endpoint config.Endpoint, done <-chan struct{})

AttachHooks is additional process what runs when is attached to container

type AttachIO

type AttachIO struct {
	Stdin  io.Reader
	Stdout io.Writer
	Stderr io.Writer
}

AttachIO wraps stdin/stdout for attach

func NewAttachIO

func NewAttachIO(stdin io.Reader, stdout, stderr io.Writer) AttachIO

NewAttachIO is wrapper for stdin, stdout and stderr

type Client

type Client struct {
	Namespace string
	Endpoint  config.Endpoint
	// contains filtered or unexported fields
}

Client connects directly to node RPC API

func NewClient added in v0.2.3

func NewClient(namespace string, endpoint config.Endpoint) *Client

NewClient creates new RPC server client

func (*Client) Attach

func (c *Client) Attach(containerID string, attachIO AttachIO, hooks ...AttachHooks) (err error)

Attach hooks to container main process stdin/stout

func (*Client) CreatePod

func (c *Client) CreatePod(status chan<- []*progress.ImageFetch, pod *pods.Pod, opts ...PodOpts) error

CreatePod creates new pod to the node

func (*Client) DeletePod

func (c *Client) DeletePod(pod *pods.Pod) (*pods.Pod, error)

DeletePod removes pod from the node

func (*Client) Exec added in v0.2.3

func (c *Client) Exec(containerID string, args []string, tty bool, attachIO AttachIO, hooks ...AttachHooks) (err error)

Exec executes command inside some container

func (*Client) GetInfo added in v0.2.3

func (c *Client) GetInfo() (*node.Info, error)

GetInfo calls server and get node info

func (*Client) GetPod

func (c *Client) GetPod(podName string) (*pods.Pod, error)

GetPod return Pod by name

func (*Client) GetPods

func (c *Client) GetPods() ([]*pods.Pod, error)

GetPods calls server and fetches all pods information

func (*Client) Signal

func (c *Client) Signal(containerID string, signal syscall.Signal) (err error)

Signal sends kill signal to container process

func (*Client) StartPod

func (c *Client) StartPod(name string) (*pods.Pod, error)

StartPod starts created pod in node

type PodOpts

type PodOpts func(pod *pods.Pod) error

PodOpts adds more information to the Pod going to be created

func WithContainer

func WithContainer(container *containers.Container) PodOpts

WithContainer adds container to the Pod spec

func WithSharedMount

func WithSharedMount(mounts ...*containers.Mount) PodOpts

WithSharedMount adds mount point to each container

func WithWorkingDir

func WithWorkingDir(workDir string) PodOpts

WithWorkingDir sets each container workdir If workdir is already defined, will return error

type Server

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

Server implements the GRPC API for the eli

func NewServer

func NewServer(listen string, client runtime.Client, resolver *resolver.Resolver) *Server

NewServer creates new API server

func (*Server) Attach

func (s *Server) Attach(server containers.Containers_AttachServer) error

Attach connects to process in container and streams stdout and stderr outputs to client

func (*Server) Create

func (s *Server) Create(req *pods.CreatePodRequest, server pods.Pods_CreateServer) error

Create is 'pods' service Create implementation

func (*Server) Delete

func (s *Server) Delete(context context.Context, req *pods.DeletePodRequest) (*pods.DeletePodResponse, error)

Delete is 'pods' service Delete implementation

func (*Server) Exec added in v0.2.3

func (s *Server) Exec(server containers.Containers_ExecServer) error

Exec connects to process in container and streams stdout and stderr outputs to client

func (*Server) Info added in v0.2.3

func (s *Server) Info(context context.Context, req *node.InfoRequest) (*node.InfoResponse, error)

Info is Node service Info implementation

func (*Server) List

func (s *Server) List(context context.Context, req *pods.ListPodsRequest) (*pods.ListPodsResponse, error)

List is 'pods' service List implementation

func (*Server) Serve

func (s *Server) Serve()

Serve starts the server to serve GRPC server

func (*Server) Signal

Signal connects to process in container and send signal to the process

func (*Server) Start

func (s *Server) Start(context context.Context, req *pods.StartPodRequest) (*pods.StartPodResponse, error)

Start is 'pods' service Start implementation

func (*Server) Stop added in v0.2.0

func (s *Server) Stop()

Stop the GRPC server

Directories

Path Synopsis
Package core is a generated protocol buffer package.
Package core is a generated protocol buffer package.
services
containers/v1
Package containers is a generated protocol buffer package.
Package containers is a generated protocol buffer package.
node/v1
Package node is a generated protocol buffer package.
Package node is a generated protocol buffer package.
pods/v1
Package pods is a generated protocol buffer package.
Package pods is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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