drivers

package
v0.0.4-dev Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2017 License: Apache-2.0 Imports: 15 Imported by: 0

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

View Source
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

type DriverFlags struct {
	Options map[string]*Flag `` /* 134-byte string literal not displayed */
}

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) Descriptor() ([]byte, []int)

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) Reset

func (m *Empty) Reset()

func (*Empty) String

func (m *Empty) String() string

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) Descriptor() ([]byte, []int)

func (*Flag) GetType

func (m *Flag) GetType() string

func (*Flag) GetUsage

func (m *Flag) GetUsage() string

func (*Flag) GetValue

func (m *Flag) GetValue() string

func (*Flag) ProtoMessage

func (*Flag) ProtoMessage()

func (*Flag) Reset

func (m *Flag) Reset()

func (*Flag) String

func (m *Flag) String() string

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) Create

func (rpc *GrpcClient) Create() error

Create call grpc create

func (*GrpcClient) DriverName

func (rpc *GrpcClient) DriverName() string

DriverName returns the driver name

func (*GrpcClient) Get

func (rpc *GrpcClient) Get() ClusterInfo

Get call grpc get

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) Remove

func (rpc *GrpcClient) Remove() error

Remove call grpc remove

func (*GrpcClient) SetDriverOptions

func (rpc *GrpcClient) SetDriverOptions(options DriverOptions) error

SetDriverOptions set the driver options

func (*GrpcClient) Update

func (rpc *GrpcClient) Update() error

Update call grpc update

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) Create

func (s *GrpcServer) Create(ctx context.Context, in *Empty) (*Empty, error)

Create implements grpc method

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) PostCheck

func (s *GrpcServer) PostCheck(cont context.Context, in *Empty) (*Empty, error)

func (*GrpcServer) Remove

func (s *GrpcServer) Remove(ctx context.Context, in *Empty) (*Empty, error)

Remove implements grpc method

func (*GrpcServer) Serve

func (s *GrpcServer) Serve()

Serve serves a grpc server

func (*GrpcServer) SetDriverOptions

func (s *GrpcServer) SetDriverOptions(ctx context.Context, in *DriverOptions) (*Empty, error)

SetDriverOptions implements grpc method

func (*GrpcServer) Update

func (s *GrpcServer) Update(ctx context.Context, in *Empty) (*Empty, error)

Update 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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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