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
- Variables
- func RegisterPopServer(s *grpc.Server, srv PopServer)
- type Container
- func (*Container) Descriptor() ([]byte, []int)
- func (m *Container) GetCommand() string
- func (m *Container) GetCreated() int64
- func (m *Container) GetEndpoints() map[string]*Endpoint
- func (m *Container) GetExtendedStatus() string
- func (m *Container) GetFlavourId() string
- func (m *Container) GetId() string
- func (m *Container) GetImageId() string
- func (m *Container) GetMd() *Metadata
- func (m *Container) GetNames() []string
- func (m *Container) GetStarted() int64
- func (m *Container) GetStatus() Container_Status
- func (*Container) ProtoMessage()
- func (m *Container) Reset()
- func (m *Container) String() string
- type ContainerConfig
- func (*ContainerConfig) Descriptor() ([]byte, []int)
- func (m *ContainerConfig) GetEndpoints() map[string]*Endpoint
- func (m *ContainerConfig) GetFlavourId() string
- func (m *ContainerConfig) GetImageId() string
- func (m *ContainerConfig) GetName() string
- func (*ContainerConfig) ProtoMessage()
- func (m *ContainerConfig) Reset()
- func (m *ContainerConfig) String() string
- type ContainerList
- type Container_Status
- type Credentials
- type Endpoint
- func (*Endpoint) Descriptor() ([]byte, []int)
- func (m *Endpoint) GetEndpointId() string
- func (m *Endpoint) GetIpv4() *Ip
- func (m *Endpoint) GetIpv6() *Ip
- func (m *Endpoint) GetMac() string
- func (m *Endpoint) GetNetId() string
- func (m *Endpoint) GetNetName() string
- func (*Endpoint) ProtoMessage()
- func (m *Endpoint) Reset()
- func (m *Endpoint) String() string
- type Filter
- func (*Filter) Descriptor() ([]byte, []int)
- func (m *Filter) GetId() string
- func (m *Filter) GetName() string
- func (m *Filter) GetOptions() isFilter_Options
- func (*Filter) ProtoMessage()
- func (m *Filter) Reset()
- func (m *Filter) String() string
- func (*Filter) XXX_OneofFuncs() (func(msg proto1.Message, b *proto1.Buffer) error, ...)
- type Filter_Id
- type Filter_Name
- type Flavour
- type FlavourList
- type Image
- type ImageList
- type Infos
- type Ip
- type Metadata
- type Network
- type NetworkList
- type NewMetadata
- type PopClient
- type PopServer
- type Subnet
- type Token
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 ¶
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) GetCommand ¶
func (*Container) GetCreated ¶
func (*Container) GetEndpoints ¶
func (*Container) GetExtendedStatus ¶
func (*Container) GetFlavourId ¶
func (*Container) GetImageId ¶
func (*Container) GetStarted ¶
func (*Container) GetStatus ¶
func (m *Container) GetStatus() Container_Status
func (*Container) ProtoMessage ¶
func (*Container) ProtoMessage()
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) GetEndpointId ¶
func (*Endpoint) GetNetName ¶
func (*Endpoint) ProtoMessage ¶
func (*Endpoint) ProtoMessage()
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) GetOptions ¶
func (m *Filter) GetOptions() isFilter_Options
func (*Filter) ProtoMessage ¶
func (*Filter) ProtoMessage()
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) ProtoMessage ¶
func (*Flavour) ProtoMessage()
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) GetCreated ¶
func (*Image) ProtoMessage ¶
func (*Image) ProtoMessage()
type ImageList ¶
type ImageList struct {
List []*Image `protobuf:"bytes,1,rep,name=list" json:"list,omitempty"`
}
func (*ImageList) Descriptor ¶
func (*ImageList) ProtoMessage ¶
func (*ImageList) ProtoMessage()
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) GetTimestamp ¶
func (*Infos) ProtoMessage ¶
func (*Infos) ProtoMessage()
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) GetAddress ¶
func (*Ip) ProtoMessage ¶
func (*Ip) ProtoMessage()
type Metadata ¶
Metadata contains a key-value set of metadata pairs, that will be exposed to the underlying container.
func (*Metadata) Descriptor ¶
func (*Metadata) GetEntries ¶
func (*Metadata) ProtoMessage ¶
func (*Metadata) ProtoMessage()
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) GetExternal ¶
func (*Network) GetSubnets ¶
func (*Network) ProtoMessage ¶
func (*Network) ProtoMessage()
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) GetGateway ¶
func (*Subnet) ProtoMessage ¶
func (*Subnet) ProtoMessage()
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) ProtoMessage ¶
func (*Token) ProtoMessage()
Click to show internal directories.
Click to hide internal directories.