Documentation
¶
Overview ¶
Package drivers is a generated protocol buffer package.
It is generated from these files:
drivers.proto
It has these top-level messages:
Empty DriverFlags Flag DriverOptions StringSlice ClusterInfo
Index ¶
- Constants
- func GenerateServiceAccountToken(clientset *kubernetes.Clientset) (string, error)
- func RegisterDriverServer(s *grpc.Server, srv DriverServer)
- type ClusterInfo
- func (*ClusterInfo) Descriptor() ([]byte, []int)
- func (m *ClusterInfo) GetClientCertificate() string
- func (m *ClusterInfo) GetClientKey() string
- func (m *ClusterInfo) GetEndpoint() string
- func (m *ClusterInfo) GetMetadata() map[string]string
- func (m *ClusterInfo) GetNodeCount() int64
- func (m *ClusterInfo) GetPassword() string
- func (m *ClusterInfo) GetRootCaCertificate() string
- func (m *ClusterInfo) GetServiceAccountToken() string
- func (m *ClusterInfo) GetUsername() string
- func (m *ClusterInfo) GetVersion() string
- func (*ClusterInfo) ProtoMessage()
- func (m *ClusterInfo) Reset()
- func (m *ClusterInfo) String() string
- type Driver
- type DriverClient
- type DriverFlags
- type DriverOptions
- func (*DriverOptions) Descriptor() ([]byte, []int)
- func (m *DriverOptions) GetBoolOptions() map[string]bool
- func (m *DriverOptions) GetIntOptions() map[string]int64
- func (m *DriverOptions) GetStringOptions() map[string]string
- func (m *DriverOptions) GetStringSliceOptions() map[string]*StringSlice
- func (*DriverOptions) ProtoMessage()
- func (m *DriverOptions) Reset()
- func (m *DriverOptions) String() string
- type DriverServer
- type Empty
- type Flag
- type GrpcClient
- func (rpc *GrpcClient) Create() error
- func (rpc *GrpcClient) DriverName() string
- func (rpc *GrpcClient) Get() ClusterInfo
- func (rpc *GrpcClient) GetDriverCreateOptions() (DriverFlags, error)
- func (rpc *GrpcClient) GetDriverUpdateOptions() (DriverFlags, error)
- func (rpc *GrpcClient) PostCheck() error
- func (rpc *GrpcClient) Remove() error
- func (rpc *GrpcClient) SetDriverOptions(options DriverOptions) error
- func (rpc *GrpcClient) Update() error
- type GrpcServer
- func (s *GrpcServer) Create(ctx context.Context, in *Empty) (*Empty, error)
- func (s *GrpcServer) Get(cont context.Context, in *Empty) (*ClusterInfo, error)
- func (s *GrpcServer) GetDriverCreateOptions(ctx context.Context, in *Empty) (*DriverFlags, error)
- func (s *GrpcServer) GetDriverUpdateOptions(ctx context.Context, in *Empty) (*DriverFlags, error)
- func (s *GrpcServer) PostCheck(cont context.Context, in *Empty) (*Empty, error)
- func (s *GrpcServer) Remove(ctx context.Context, in *Empty) (*Empty, error)
- func (s *GrpcServer) Serve()
- func (s *GrpcServer) SetDriverOptions(ctx context.Context, in *DriverOptions) (*Empty, error)
- func (s *GrpcServer) Update(ctx context.Context, in *Empty) (*Empty, error)
- type RPCServer
- type StringSlice
Constants ¶
const ( // StringType is the type for string flag StringType = "string" // BoolType is the type for bool flag BoolType = "bool" // IntType is the type for int flag IntType = "int" // StringSliceType is the type for stringSlice flag StringSliceType = "stringSlice" )
Variables ¶
This section is empty.
Functions ¶
func GenerateServiceAccountToken ¶
func GenerateServiceAccountToken(clientset *kubernetes.Clientset) (string, error)
GenerateServiceAccountToken generate a serviceAccountToken for clusterAdmin given a rest clientset
func RegisterDriverServer ¶
func RegisterDriverServer(s *grpc.Server, srv DriverServer)
Types ¶
type ClusterInfo ¶
type ClusterInfo struct {
Version string `protobuf:"bytes,1,opt,name=version" json:"version,omitempty"`
ServiceAccountToken string `protobuf:"bytes,2,opt,name=service_account_token,json=serviceAccountToken" json:"service_account_token,omitempty"`
Endpoint string `protobuf:"bytes,3,opt,name=endpoint" json:"endpoint,omitempty"`
Username string `protobuf:"bytes,4,opt,name=username" json:"username,omitempty"`
Password string `protobuf:"bytes,5,opt,name=password" json:"password,omitempty"`
RootCaCertificate string `protobuf:"bytes,6,opt,name=root_ca_certificate,json=rootCaCertificate" json:"root_ca_certificate,omitempty"`
ClientCertificate string `protobuf:"bytes,7,opt,name=client_certificate,json=clientCertificate" json:"client_certificate,omitempty"`
ClientKey string `protobuf:"bytes,8,opt,name=client_key,json=clientKey" json:"client_key,omitempty"`
NodeCount int64 `protobuf:"varint,9,opt,name=node_count,json=nodeCount" json:"node_count,omitempty"`
Metadata map[string]string `` /* 137-byte string literal not displayed */
}
func (*ClusterInfo) Descriptor ¶
func (*ClusterInfo) Descriptor() ([]byte, []int)
func (*ClusterInfo) GetClientCertificate ¶
func (m *ClusterInfo) GetClientCertificate() string
func (*ClusterInfo) GetClientKey ¶
func (m *ClusterInfo) GetClientKey() string
func (*ClusterInfo) GetEndpoint ¶
func (m *ClusterInfo) GetEndpoint() string
func (*ClusterInfo) GetMetadata ¶
func (m *ClusterInfo) GetMetadata() map[string]string
func (*ClusterInfo) GetNodeCount ¶
func (m *ClusterInfo) GetNodeCount() int64
func (*ClusterInfo) GetPassword ¶
func (m *ClusterInfo) GetPassword() string
func (*ClusterInfo) GetRootCaCertificate ¶
func (m *ClusterInfo) GetRootCaCertificate() string
func (*ClusterInfo) GetServiceAccountToken ¶
func (m *ClusterInfo) GetServiceAccountToken() string
func (*ClusterInfo) GetUsername ¶
func (m *ClusterInfo) GetUsername() string
func (*ClusterInfo) GetVersion ¶
func (m *ClusterInfo) GetVersion() string
func (*ClusterInfo) ProtoMessage ¶
func (*ClusterInfo) ProtoMessage()
func (*ClusterInfo) Reset ¶
func (m *ClusterInfo) Reset()
func (*ClusterInfo) String ¶
func (m *ClusterInfo) String() string
type Driver ¶
type Driver interface {
// GetDriverCreateOptions returns cli flags that are used in create
GetDriverCreateOptions() (*DriverFlags, error)
// GetDriverUpdateOptions returns cli flags that are used in update
GetDriverUpdateOptions() (*DriverFlags, error)
// SetDriverOptions set the driver options into plugin. String, bool, int and stringslice are currently four supported types.
SetDriverOptions(driverOptions *DriverOptions) error
// Create creates the cluster
Create() error
// Update updates the cluster
Update() error
// Get retrieve the cluster and return cluster info
Get() (*ClusterInfo, error)
// PostCheck does post action after provisioning
PostCheck() error
// Remove removes the cluster
Remove() error
}
Driver defines the interface that each driver plugin should implement
type DriverClient ¶
type DriverClient interface {
Create(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
Update(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
Get(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ClusterInfo, error)
PostCheck(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
Remove(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
GetDriverCreateOptions(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*DriverFlags, error)
GetDriverUpdateOptions(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*DriverFlags, error)
SetDriverOptions(ctx context.Context, in *DriverOptions, opts ...grpc.CallOption) (*Empty, error)
}
func NewDriverClient ¶
func NewDriverClient(cc *grpc.ClientConn) DriverClient
type DriverFlags ¶
func (*DriverFlags) Descriptor ¶
func (*DriverFlags) Descriptor() ([]byte, []int)
func (*DriverFlags) GetOptions ¶
func (m *DriverFlags) GetOptions() map[string]*Flag
func (*DriverFlags) ProtoMessage ¶
func (*DriverFlags) ProtoMessage()
func (*DriverFlags) Reset ¶
func (m *DriverFlags) Reset()
func (*DriverFlags) String ¶
func (m *DriverFlags) String() string
type DriverOptions ¶
type DriverOptions struct {
BoolOptions map[string]bool `` /* 162-byte string literal not displayed */
StringOptions map[string]string `` /* 167-byte string literal not displayed */
IntOptions map[string]int64 `` /* 159-byte string literal not displayed */
StringSliceOptions map[string]*StringSlice `` /* 184-byte string literal not displayed */
}
func (*DriverOptions) Descriptor ¶
func (*DriverOptions) Descriptor() ([]byte, []int)
func (*DriverOptions) GetBoolOptions ¶
func (m *DriverOptions) GetBoolOptions() map[string]bool
func (*DriverOptions) GetIntOptions ¶
func (m *DriverOptions) GetIntOptions() map[string]int64
func (*DriverOptions) GetStringOptions ¶
func (m *DriverOptions) GetStringOptions() map[string]string
func (*DriverOptions) GetStringSliceOptions ¶
func (m *DriverOptions) GetStringSliceOptions() map[string]*StringSlice
func (*DriverOptions) ProtoMessage ¶
func (*DriverOptions) ProtoMessage()
func (*DriverOptions) Reset ¶
func (m *DriverOptions) Reset()
func (*DriverOptions) String ¶
func (m *DriverOptions) String() string
type DriverServer ¶
type DriverServer interface {
Create(context.Context, *Empty) (*Empty, error)
Update(context.Context, *Empty) (*Empty, error)
Get(context.Context, *Empty) (*ClusterInfo, error)
PostCheck(context.Context, *Empty) (*Empty, error)
Remove(context.Context, *Empty) (*Empty, error)
GetDriverCreateOptions(context.Context, *Empty) (*DriverFlags, error)
GetDriverUpdateOptions(context.Context, *Empty) (*DriverFlags, error)
SetDriverOptions(context.Context, *DriverOptions) (*Empty, error)
}
type Empty ¶
type Empty struct {
}
func (*Empty) Descriptor ¶
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
type Flag ¶
type Flag struct {
Type string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"`
Usage string `protobuf:"bytes,2,opt,name=usage" json:"usage,omitempty"`
Value string `protobuf:"bytes,3,opt,name=value" json:"value,omitempty"`
}
func (*Flag) Descriptor ¶
func (*Flag) ProtoMessage ¶
func (*Flag) ProtoMessage()
type GrpcClient ¶
type GrpcClient struct {
// contains filtered or unexported fields
}
GrpcClient defines the grpc client struct
func NewClient ¶
func NewClient(driverName string, addr string) (*GrpcClient, error)
NewClient creates a grpc client for a driver plugin
func (*GrpcClient) DriverName ¶
func (rpc *GrpcClient) DriverName() string
DriverName returns the driver name
func (*GrpcClient) GetDriverCreateOptions ¶
func (rpc *GrpcClient) GetDriverCreateOptions() (DriverFlags, error)
GetDriverCreateOptions call grpc getDriverCreateOptions
func (*GrpcClient) GetDriverUpdateOptions ¶
func (rpc *GrpcClient) GetDriverUpdateOptions() (DriverFlags, error)
GetDriverUpdateOptions call grpc getDriverUpdateOptions
func (*GrpcClient) PostCheck ¶
func (rpc *GrpcClient) PostCheck() error
func (*GrpcClient) SetDriverOptions ¶
func (rpc *GrpcClient) SetDriverOptions(options DriverOptions) error
SetDriverOptions set the driver options
type GrpcServer ¶
type GrpcServer struct {
// contains filtered or unexported fields
}
GrpcServer defines the server struct
func NewServer ¶
func NewServer(driver Driver, addr chan string) *GrpcServer
NewServer creates a grpc server for a specific plugin
func (*GrpcServer) Get ¶
func (s *GrpcServer) Get(cont context.Context, in *Empty) (*ClusterInfo, error)
Get implements grpc method
func (*GrpcServer) GetDriverCreateOptions ¶
func (s *GrpcServer) GetDriverCreateOptions(ctx context.Context, in *Empty) (*DriverFlags, error)
GetDriverCreateOptions implements grpc method
func (*GrpcServer) GetDriverUpdateOptions ¶
func (s *GrpcServer) GetDriverUpdateOptions(ctx context.Context, in *Empty) (*DriverFlags, error)
GetDriverUpdateOptions implements grpc method
func (*GrpcServer) SetDriverOptions ¶
func (s *GrpcServer) SetDriverOptions(ctx context.Context, in *DriverOptions) (*Empty, error)
SetDriverOptions implements grpc method
type RPCServer ¶
type RPCServer interface {
Serve()
}
RPCServer defines the interface for a rpc server
type StringSlice ¶
type StringSlice struct {
Value []string `protobuf:"bytes,1,rep,name=value" json:"value,omitempty"`
}
func (*StringSlice) Descriptor ¶
func (*StringSlice) Descriptor() ([]byte, []int)
func (*StringSlice) GetValue ¶
func (m *StringSlice) GetValue() []string
func (*StringSlice) ProtoMessage ¶
func (*StringSlice) ProtoMessage()
func (*StringSlice) Reset ¶
func (m *StringSlice) Reset()
func (*StringSlice) String ¶
func (m *StringSlice) String() string