proto

package
v0.0.0-...-487a084 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package proto defines the Pop service, a gRPC based protocol to handle and control a Docker Point-of-Presence. This package contains the protobuf-defined interfaces of the protocol, plus a few constants.

Package proto is a generated protocol buffer package.

It is generated from these files:

pop.proto

It has these top-level messages:

Container
ContainerConfig
ContainerList
Credentials
Endpoint
Filter
Flavour
FlavourList
Image
ImageList
Infos
Ip
Metadata
Network
NetworkList
NewMetadata
Subnet
Token

Index

Constants

View Source
const (
	// DefaultAddress is the default address for the client to connect to.
	DefaultAddress = "localhost:60000"

	// DefaultListenProtocol is the default protocol the server uses for Listen.
	DefaultListenProtocol = "tcp"

	// DefaultListenAddress is the default address the server uses for Listen.
	DefaultListenAddress = ":60000"

	// LoginMethod is the signature of the login method. Check this string
	// carefully.
	LoginMethod = "/vim_pop.Pop/Login"
)
View Source
const (
	// TokenKey represents the metadata key to identify the token.
	TokenKey = "token"
)

Variables

View Source
var (
	// AuthErr represent an authentication failure (ie, wrong password).
	AuthErr = grpc.Errorf(codes.InvalidArgument, "invalid credentials")

	// InternalErr represents an internal crash of the server.
	InternalErr = grpc.Errorf(codes.Internal, "server fault")

	// InvalidArgErr signals the caller that the arguments given with the request
	// are invalid.
	InvalidArgErr = grpc.Errorf(codes.InvalidArgument, "invalid arguments")

	// InvalidTokenErr signals the caller that its token is invalid, and a new
	// session should be started through an invocation of Login().
	InvalidTokenErr = grpc.Errorf(codes.PermissionDenied, "invalid token")

	// NotLoggedErr means that the caller tried to execute any operation different
	// from Login without a valid token.
	NotLoggedErr = grpc.Errorf(codes.Unauthenticated, "not authenticated")
)
View Source
var Container_Status_name = map[int32]string{
	0: "UNAVAILABLE",
	1: "CREATED",
	2: "RUNNING",
	3: "EXITED",
	4: "FAILED",
	5: "STOPPING",
}
View Source
var Container_Status_value = map[string]int32{
	"UNAVAILABLE": 0,
	"CREATED":     1,
	"RUNNING":     2,
	"EXITED":      3,
	"FAILED":      4,
	"STOPPING":    5,
}

Functions

func RegisterPopServer

func RegisterPopServer(s *grpc.Server, srv PopServer)

Types

type Container

type Container struct {
	Id             string               `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
	Names          []string             `protobuf:"bytes,2,rep,name=names" json:"names,omitempty"`
	ImageId        string               `protobuf:"bytes,3,opt,name=image_id,json=imageId" json:"image_id,omitempty"`
	FlavourId      string               `protobuf:"bytes,4,opt,name=flavour_id,json=flavourId" json:"flavour_id,omitempty"`
	Command        string               `protobuf:"bytes,5,opt,name=command" json:"command,omitempty"`
	Created        int64                `protobuf:"varint,6,opt,name=created" json:"created,omitempty"`
	Started        int64                `protobuf:"varint,7,opt,name=started" json:"started,omitempty"`
	Status         Container_Status     `protobuf:"varint,8,opt,name=status,enum=vim_pop.Container_Status" json:"status,omitempty"`
	ExtendedStatus string               `protobuf:"bytes,9,opt,name=extended_status,json=extendedStatus" json:"extended_status,omitempty"`
	Endpoints      map[string]*Endpoint `` /* 139-byte string literal not displayed */
	Md             *Metadata            `protobuf:"bytes,11,opt,name=md" json:"md,omitempty"`
}

func (*Container) Descriptor

func (*Container) Descriptor() ([]byte, []int)

func (*Container) GetCommand

func (m *Container) GetCommand() string

func (*Container) GetCreated

func (m *Container) GetCreated() int64

func (*Container) GetEndpoints

func (m *Container) GetEndpoints() map[string]*Endpoint

func (*Container) GetExtendedStatus

func (m *Container) GetExtendedStatus() string

func (*Container) GetFlavourId

func (m *Container) GetFlavourId() string

func (*Container) GetId

func (m *Container) GetId() string

func (*Container) GetImageId

func (m *Container) GetImageId() string

func (*Container) GetMd

func (m *Container) GetMd() *Metadata

func (*Container) GetNames

func (m *Container) GetNames() []string

func (*Container) GetStarted

func (m *Container) GetStarted() int64

func (*Container) GetStatus

func (m *Container) GetStatus() Container_Status

func (*Container) ProtoMessage

func (*Container) ProtoMessage()

func (*Container) Reset

func (m *Container) Reset()

func (*Container) String

func (m *Container) String() string

type ContainerConfig

type ContainerConfig struct {
	Name      string               `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
	ImageId   string               `protobuf:"bytes,2,opt,name=image_id,json=imageId" json:"image_id,omitempty"`
	FlavourId string               `protobuf:"bytes,3,opt,name=flavour_id,json=flavourId" json:"flavour_id,omitempty"`
	Endpoints map[string]*Endpoint `` /* 138-byte string literal not displayed */
}

func (*ContainerConfig) Descriptor

func (*ContainerConfig) Descriptor() ([]byte, []int)

func (*ContainerConfig) GetEndpoints

func (m *ContainerConfig) GetEndpoints() map[string]*Endpoint

func (*ContainerConfig) GetFlavourId

func (m *ContainerConfig) GetFlavourId() string

func (*ContainerConfig) GetImageId

func (m *ContainerConfig) GetImageId() string

func (*ContainerConfig) GetName

func (m *ContainerConfig) GetName() string

func (*ContainerConfig) ProtoMessage

func (*ContainerConfig) ProtoMessage()

func (*ContainerConfig) Reset

func (m *ContainerConfig) Reset()

func (*ContainerConfig) String

func (m *ContainerConfig) String() string

type ContainerList

type ContainerList struct {
	List []*Container `protobuf:"bytes,1,rep,name=list" json:"list,omitempty"`
}

func (*ContainerList) Descriptor

func (*ContainerList) Descriptor() ([]byte, []int)

func (*ContainerList) GetList

func (m *ContainerList) GetList() []*Container

func (*ContainerList) ProtoMessage

func (*ContainerList) ProtoMessage()

func (*ContainerList) Reset

func (m *ContainerList) Reset()

func (*ContainerList) String

func (m *ContainerList) String() string

type Container_Status

type Container_Status int32
const (
	Container_UNAVAILABLE Container_Status = 0
	Container_CREATED     Container_Status = 1
	Container_RUNNING     Container_Status = 2
	Container_EXITED      Container_Status = 3
	Container_FAILED      Container_Status = 4
	Container_STOPPING    Container_Status = 5
)

func (Container_Status) EnumDescriptor

func (Container_Status) EnumDescriptor() ([]byte, []int)

func (Container_Status) String

func (x Container_Status) String() string

type Credentials

type Credentials struct {
	Username string `protobuf:"bytes,1,opt,name=username" json:"username,omitempty"`
	Password string `protobuf:"bytes,2,opt,name=password" json:"password,omitempty"`
}

Credentials represents the login credentials for a given user.

func (*Credentials) Descriptor

func (*Credentials) Descriptor() ([]byte, []int)

func (*Credentials) GetPassword

func (m *Credentials) GetPassword() string

func (*Credentials) GetUsername

func (m *Credentials) GetUsername() string

func (*Credentials) ProtoMessage

func (*Credentials) ProtoMessage()

func (*Credentials) Reset

func (m *Credentials) Reset()

func (*Credentials) String

func (m *Credentials) String() string

type Endpoint

type Endpoint struct {
	NetId      string `protobuf:"bytes,1,opt,name=net_id,json=netId" json:"net_id,omitempty"`
	NetName    string `protobuf:"bytes,2,opt,name=net_name,json=netName" json:"net_name,omitempty"`
	EndpointId string `protobuf:"bytes,3,opt,name=endpoint_id,json=endpointId" json:"endpoint_id,omitempty"`
	Ipv4       *Ip    `protobuf:"bytes,4,opt,name=ipv4" json:"ipv4,omitempty"`
	Ipv6       *Ip    `protobuf:"bytes,5,opt,name=ipv6" json:"ipv6,omitempty"`
	Mac        string `protobuf:"bytes,6,opt,name=mac" json:"mac,omitempty"`
}

func (*Endpoint) Descriptor

func (*Endpoint) Descriptor() ([]byte, []int)

func (*Endpoint) GetEndpointId

func (m *Endpoint) GetEndpointId() string

func (*Endpoint) GetIpv4

func (m *Endpoint) GetIpv4() *Ip

func (*Endpoint) GetIpv6

func (m *Endpoint) GetIpv6() *Ip

func (*Endpoint) GetMac

func (m *Endpoint) GetMac() string

func (*Endpoint) GetNetId

func (m *Endpoint) GetNetId() string

func (*Endpoint) GetNetName

func (m *Endpoint) GetNetName() string

func (*Endpoint) ProtoMessage

func (*Endpoint) ProtoMessage()

func (*Endpoint) Reset

func (m *Endpoint) Reset()

func (*Endpoint) String

func (m *Endpoint) String() string

type Filter

type Filter struct {
	// Types that are valid to be assigned to Options:
	//	*Filter_Id
	//	*Filter_Name
	Options isFilter_Options `protobuf_oneof:"options"`
}

Filter is used to specify a filter that matches a container.

func (*Filter) Descriptor

func (*Filter) Descriptor() ([]byte, []int)

func (*Filter) GetId

func (m *Filter) GetId() string

func (*Filter) GetName

func (m *Filter) GetName() string

func (*Filter) GetOptions

func (m *Filter) GetOptions() isFilter_Options

func (*Filter) ProtoMessage

func (*Filter) ProtoMessage()

func (*Filter) Reset

func (m *Filter) Reset()

func (*Filter) String

func (m *Filter) String() string

func (*Filter) XXX_OneofFuncs

func (*Filter) XXX_OneofFuncs() (func(msg proto1.Message, b *proto1.Buffer) error, func(msg proto1.Message, tag, wire int, b *proto1.Buffer) (bool, error), func(msg proto1.Message) (n int), []interface{})

XXX_OneofFuncs is for the internal use of the proto package.

type Filter_Id

type Filter_Id struct {
	Id string `protobuf:"bytes,1,opt,name=id,oneof"`
}

type Filter_Name

type Filter_Name struct {
	Name string `protobuf:"bytes,2,opt,name=name,oneof"`
}

type Flavour

type Flavour struct {
	Id   string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
	Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"`
}

func (*Flavour) Descriptor

func (*Flavour) Descriptor() ([]byte, []int)

func (*Flavour) GetId

func (m *Flavour) GetId() string

func (*Flavour) GetName

func (m *Flavour) GetName() string

func (*Flavour) ProtoMessage

func (*Flavour) ProtoMessage()

func (*Flavour) Reset

func (m *Flavour) Reset()

func (*Flavour) String

func (m *Flavour) String() string

type FlavourList

type FlavourList struct {
	List []*Flavour `protobuf:"bytes,1,rep,name=list" json:"list,omitempty"`
}

func (*FlavourList) Descriptor

func (*FlavourList) Descriptor() ([]byte, []int)

func (*FlavourList) GetList

func (m *FlavourList) GetList() []*Flavour

func (*FlavourList) ProtoMessage

func (*FlavourList) ProtoMessage()

func (*FlavourList) Reset

func (m *FlavourList) Reset()

func (*FlavourList) String

func (m *FlavourList) String() string

type Image

type Image struct {
	Id      string   `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
	Names   []string `protobuf:"bytes,2,rep,name=names" json:"names,omitempty"`
	Created int64    `protobuf:"varint,3,opt,name=created" json:"created,omitempty"`
}

func (*Image) Descriptor

func (*Image) Descriptor() ([]byte, []int)

func (*Image) GetCreated

func (m *Image) GetCreated() int64

func (*Image) GetId

func (m *Image) GetId() string

func (*Image) GetNames

func (m *Image) GetNames() []string

func (*Image) ProtoMessage

func (*Image) ProtoMessage()

func (*Image) Reset

func (m *Image) Reset()

func (*Image) String

func (m *Image) String() string

type ImageList

type ImageList struct {
	List []*Image `protobuf:"bytes,1,rep,name=list" json:"list,omitempty"`
}

func (*ImageList) Descriptor

func (*ImageList) Descriptor() ([]byte, []int)

func (*ImageList) GetList

func (m *ImageList) GetList() []*Image

func (*ImageList) ProtoMessage

func (*ImageList) ProtoMessage()

func (*ImageList) Reset

func (m *ImageList) Reset()

func (*ImageList) String

func (m *ImageList) String() string

type Infos

type Infos struct {
	Type      string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"`
	Name      string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"`
	Timestamp int64  `protobuf:"varint,3,opt,name=timestamp" json:"timestamp,omitempty"`
}

func (*Infos) Descriptor

func (*Infos) Descriptor() ([]byte, []int)

func (*Infos) GetName

func (m *Infos) GetName() string

func (*Infos) GetTimestamp

func (m *Infos) GetTimestamp() int64

func (*Infos) GetType

func (m *Infos) GetType() string

func (*Infos) ProtoMessage

func (*Infos) ProtoMessage()

func (*Infos) Reset

func (m *Infos) Reset()

func (*Infos) String

func (m *Infos) String() string

type Ip

type Ip struct {
	Address string  `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"`
	Subnet  *Subnet `protobuf:"bytes,2,opt,name=subnet" json:"subnet,omitempty"`
}

func (*Ip) Descriptor

func (*Ip) Descriptor() ([]byte, []int)

func (*Ip) GetAddress

func (m *Ip) GetAddress() string

func (*Ip) GetSubnet

func (m *Ip) GetSubnet() *Subnet

func (*Ip) ProtoMessage

func (*Ip) ProtoMessage()

func (*Ip) Reset

func (m *Ip) Reset()

func (*Ip) String

func (m *Ip) String() string

type Metadata

type Metadata struct {
	Entries map[string]string `` /* 134-byte string literal not displayed */
}

Metadata contains a key-value set of metadata pairs, that will be exposed to the underlying container.

func (*Metadata) Descriptor

func (*Metadata) Descriptor() ([]byte, []int)

func (*Metadata) GetEntries

func (m *Metadata) GetEntries() map[string]string

func (*Metadata) ProtoMessage

func (*Metadata) ProtoMessage()

func (*Metadata) Reset

func (m *Metadata) Reset()

func (*Metadata) String

func (m *Metadata) String() string

type Network

type Network struct {
	Id       string    `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
	Name     string    `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"`
	External bool      `protobuf:"varint,3,opt,name=external" json:"external,omitempty"`
	Subnets  []*Subnet `protobuf:"bytes,4,rep,name=subnets" json:"subnets,omitempty"`
}

func (*Network) Descriptor

func (*Network) Descriptor() ([]byte, []int)

func (*Network) GetExternal

func (m *Network) GetExternal() bool

func (*Network) GetId

func (m *Network) GetId() string

func (*Network) GetName

func (m *Network) GetName() string

func (*Network) GetSubnets

func (m *Network) GetSubnets() []*Subnet

func (*Network) ProtoMessage

func (*Network) ProtoMessage()

func (*Network) Reset

func (m *Network) Reset()

func (*Network) String

func (m *Network) String() string

type NetworkList

type NetworkList struct {
	List []*Network `protobuf:"bytes,1,rep,name=list" json:"list,omitempty"`
}

func (*NetworkList) Descriptor

func (*NetworkList) Descriptor() ([]byte, []int)

func (*NetworkList) GetList

func (m *NetworkList) GetList() []*Network

func (*NetworkList) ProtoMessage

func (*NetworkList) ProtoMessage()

func (*NetworkList) Reset

func (m *NetworkList) Reset()

func (*NetworkList) String

func (m *NetworkList) String() string

type NewMetadata

type NewMetadata struct {
	Filter *Filter   `protobuf:"bytes,1,opt,name=filter" json:"filter,omitempty"`
	Md     *Metadata `protobuf:"bytes,2,opt,name=md" json:"md,omitempty"`
}

func (*NewMetadata) Descriptor

func (*NewMetadata) Descriptor() ([]byte, []int)

func (*NewMetadata) GetFilter

func (m *NewMetadata) GetFilter() *Filter

func (*NewMetadata) GetMd

func (m *NewMetadata) GetMd() *Metadata

func (*NewMetadata) ProtoMessage

func (*NewMetadata) ProtoMessage()

func (*NewMetadata) Reset

func (m *NewMetadata) Reset()

func (*NewMetadata) String

func (m *NewMetadata) String() string

type PopClient

type PopClient interface {
	// Containers returns the containers available in the PoP, either
	// created or running.
	Containers(ctx context.Context, in *Filter, opts ...grpc.CallOption) (*ContainerList, error)
	// Flavours returns the available flavours.
	// This doesn't make much sense with containers, but it's here to
	// better abstract the PoP.
	Flavours(ctx context.Context, in *Filter, opts ...grpc.CallOption) (*FlavourList, error)
	// Images returns the images available in the PoP.
	Images(ctx context.Context, in *Filter, opts ...grpc.CallOption) (*ImageList, error)
	// Networks returns the available retworks in the PoP.
	Networks(ctx context.Context, in *Filter, opts ...grpc.CallOption) (*NetworkList, error)
	// Create creates a new container as described.
	Create(ctx context.Context, in *ContainerConfig, opts ...grpc.CallOption) (*Container, error)
	// Delete stops and deletes the container identified by the given filter.
	Delete(ctx context.Context, in *Filter, opts ...grpc.CallOption) (*google_protobuf.Empty, error)
	// Metadata adds the given metadata values to the container that matches with the ID.
	// An empty value for a key means that the key will be removed from the metadata.
	Metadata(ctx context.Context, in *NewMetadata, opts ...grpc.CallOption) (*google_protobuf.Empty, error)
	// Start starts the container identified by the given filter.
	// Any metadata key stored in the server will be passed to the newly instantiated container.
	Start(ctx context.Context, in *Filter, opts ...grpc.CallOption) (*Container, error)
	// Stop starts the container identified by the given filter.
	Stop(ctx context.Context, in *Filter, opts ...grpc.CallOption) (*google_protobuf.Empty, error)
	// Login logs an user in and sets up a session.
	// The returned token should be set into the metadata
	// of the gRPC session with key "token" to authenticate your client.
	Login(ctx context.Context, in *Credentials, opts ...grpc.CallOption) (*Token, error)
	// Logout invalids the current token.
	Logout(ctx context.Context, in *google_protobuf.Empty, opts ...grpc.CallOption) (*google_protobuf.Empty, error)
	// Info can be used to check if the Pop is alive and if your credentials to this service are valid.
	// It also returns informations about this server.
	Info(ctx context.Context, in *google_protobuf.Empty, opts ...grpc.CallOption) (*Infos, error)
}

func NewPopClient

func NewPopClient(cc *grpc.ClientConn) PopClient

type PopServer

type PopServer interface {
	// Containers returns the containers available in the PoP, either
	// created or running.
	Containers(context.Context, *Filter) (*ContainerList, error)
	// Flavours returns the available flavours.
	// This doesn't make much sense with containers, but it's here to
	// better abstract the PoP.
	Flavours(context.Context, *Filter) (*FlavourList, error)
	// Images returns the images available in the PoP.
	Images(context.Context, *Filter) (*ImageList, error)
	// Networks returns the available retworks in the PoP.
	Networks(context.Context, *Filter) (*NetworkList, error)
	// Create creates a new container as described.
	Create(context.Context, *ContainerConfig) (*Container, error)
	// Delete stops and deletes the container identified by the given filter.
	Delete(context.Context, *Filter) (*google_protobuf.Empty, error)
	// Metadata adds the given metadata values to the container that matches with the ID.
	// An empty value for a key means that the key will be removed from the metadata.
	Metadata(context.Context, *NewMetadata) (*google_protobuf.Empty, error)
	// Start starts the container identified by the given filter.
	// Any metadata key stored in the server will be passed to the newly instantiated container.
	Start(context.Context, *Filter) (*Container, error)
	// Stop starts the container identified by the given filter.
	Stop(context.Context, *Filter) (*google_protobuf.Empty, error)
	// Login logs an user in and sets up a session.
	// The returned token should be set into the metadata
	// of the gRPC session with key "token" to authenticate your client.
	Login(context.Context, *Credentials) (*Token, error)
	// Logout invalids the current token.
	Logout(context.Context, *google_protobuf.Empty) (*google_protobuf.Empty, error)
	// Info can be used to check if the Pop is alive and if your credentials to this service are valid.
	// It also returns informations about this server.
	Info(context.Context, *google_protobuf.Empty) (*Infos, error)
}

type Subnet

type Subnet struct {
	Cidr    string `protobuf:"bytes,1,opt,name=cidr" json:"cidr,omitempty"`
	Gateway string `protobuf:"bytes,2,opt,name=gateway" json:"gateway,omitempty"`
}

func (*Subnet) Descriptor

func (*Subnet) Descriptor() ([]byte, []int)

func (*Subnet) GetCidr

func (m *Subnet) GetCidr() string

func (*Subnet) GetGateway

func (m *Subnet) GetGateway() string

func (*Subnet) ProtoMessage

func (*Subnet) ProtoMessage()

func (*Subnet) Reset

func (m *Subnet) Reset()

func (*Subnet) String

func (m *Subnet) String() string

type Token

type Token struct {
	Value string `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"`
}

Token is a token generated by the server after a successful login. This token should be set as metadata, to authenticate every other

func (*Token) Descriptor

func (*Token) Descriptor() ([]byte, []int)

func (*Token) GetValue

func (m *Token) GetValue() string

func (*Token) ProtoMessage

func (*Token) ProtoMessage()

func (*Token) Reset

func (m *Token) Reset()

func (*Token) String

func (m *Token) String() string

Jump to

Keyboard shortcuts

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