storage

package
v0.0.0-...-b39efbf Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Response_Status_name = map[int32]string{
	0: "SUCCESS",
	1: "FAIL",
}
View Source
var Response_Status_value = map[string]int32{
	"SUCCESS": 0,
	"FAIL":    1,
}

Functions

func RegisterStorageServer

func RegisterStorageServer(s *grpc.Server, srv StorageServer)

Types

type Response

type Response struct {
	Status               Response_Status `protobuf:"varint,1,opt,name=status,proto3,enum=storage.Response_Status" json:"status,omitempty"`
	XXX_NoUnkeyedLiteral struct{}        `json:"-"`
	XXX_unrecognized     []byte          `json:"-"`
	XXX_sizecache        int32           `json:"-"`
}

func (*Response) Descriptor

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

func (*Response) GetStatus

func (m *Response) GetStatus() Response_Status

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) Reset

func (m *Response) Reset()

func (*Response) String

func (m *Response) String() string

func (*Response) XXX_DiscardUnknown

func (m *Response) XXX_DiscardUnknown()

func (*Response) XXX_Marshal

func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Response) XXX_Merge

func (m *Response) XXX_Merge(src proto.Message)

func (*Response) XXX_Size

func (m *Response) XXX_Size() int

func (*Response) XXX_Unmarshal

func (m *Response) XXX_Unmarshal(b []byte) error

type Response_Status

type Response_Status int32
const (
	Response_SUCCESS Response_Status = 0
	Response_FAIL    Response_Status = 1
)

func (Response_Status) EnumDescriptor

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

func (Response_Status) String

func (x Response_Status) String() string

type Service

type Service interface {
	Create(ctx context.Context, volume *Volume) (*Response, error)
	Delete(ctx context.Context, volID *uuid.UUID) (*Response, error)
	List(ctx context.Context) (*VolumeList, error)
}

TODO: move to internal?

type Storage

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

func NewStorageService

func NewStorageService(connManager *rpc.GRPCConnection, log *log.Logger) *Storage

func (*Storage) Create

func (s *Storage) Create(ctx context.Context, volume *Volume) (*Response, error)

func (*Storage) Delete

func (s *Storage) Delete(ctx context.Context, volID *uuid.UUID) (*Response, error)

func (*Storage) List

func (s *Storage) List(ctx context.Context) (*VolumeList, error)

type StorageClient

type StorageClient interface {
	Create(ctx context.Context, in *Volume, opts ...grpc.CallOption) (*Response, error)
	Remove(ctx context.Context, in *UUID, opts ...grpc.CallOption) (*Response, error)
	List(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*VolumeList, error)
}

StorageClient is the client API for Storage service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewStorageClient

func NewStorageClient(cc *grpc.ClientConn) StorageClient

type StorageServer

type StorageServer interface {
	Create(context.Context, *Volume) (*Response, error)
	Remove(context.Context, *UUID) (*Response, error)
	List(context.Context, *empty.Empty) (*VolumeList, error)
}

StorageServer is the server API for Storage service.

type UUID

type UUID struct {
	Value                string   `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*UUID) Descriptor

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

func (*UUID) GetValue

func (m *UUID) GetValue() string

func (*UUID) ProtoMessage

func (*UUID) ProtoMessage()

func (*UUID) Reset

func (m *UUID) Reset()

func (*UUID) String

func (m *UUID) String() string

func (*UUID) XXX_DiscardUnknown

func (m *UUID) XXX_DiscardUnknown()

func (*UUID) XXX_Marshal

func (m *UUID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*UUID) XXX_Merge

func (m *UUID) XXX_Merge(src proto.Message)

func (*UUID) XXX_Size

func (m *UUID) XXX_Size() int

func (*UUID) XXX_Unmarshal

func (m *UUID) XXX_Unmarshal(b []byte) error

type UnimplementedStorageServer

type UnimplementedStorageServer struct {
}

UnimplementedStorageServer can be embedded to have forward compatible implementations.

func (*UnimplementedStorageServer) Create

func (*UnimplementedStorageServer) List

func (*UnimplementedStorageServer) Remove

type Volume

type Volume struct {
	UUID                 string   `protobuf:"bytes,1,opt,name=UUID,proto3" json:"UUID,omitempty"`
	Size                 int64    `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Volume) Descriptor

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

func (*Volume) GetSize

func (m *Volume) GetSize() int64

func (*Volume) GetUUID

func (m *Volume) GetUUID() string

func (*Volume) ProtoMessage

func (*Volume) ProtoMessage()

func (*Volume) Reset

func (m *Volume) Reset()

func (*Volume) String

func (m *Volume) String() string

func (*Volume) XXX_DiscardUnknown

func (m *Volume) XXX_DiscardUnknown()

func (*Volume) XXX_Marshal

func (m *Volume) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Volume) XXX_Merge

func (m *Volume) XXX_Merge(src proto.Message)

func (*Volume) XXX_Size

func (m *Volume) XXX_Size() int

func (*Volume) XXX_Unmarshal

func (m *Volume) XXX_Unmarshal(b []byte) error

type VolumeList

type VolumeList struct {
	Volumes              []*Volume `protobuf:"bytes,1,rep,name=volumes,proto3" json:"volumes,omitempty"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

func (*VolumeList) Descriptor

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

func (*VolumeList) GetVolumes

func (m *VolumeList) GetVolumes() []*Volume

func (*VolumeList) ProtoMessage

func (*VolumeList) ProtoMessage()

func (*VolumeList) Reset

func (m *VolumeList) Reset()

func (*VolumeList) String

func (m *VolumeList) String() string

func (*VolumeList) XXX_DiscardUnknown

func (m *VolumeList) XXX_DiscardUnknown()

func (*VolumeList) XXX_Marshal

func (m *VolumeList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*VolumeList) XXX_Merge

func (m *VolumeList) XXX_Merge(src proto.Message)

func (*VolumeList) XXX_Size

func (m *VolumeList) XXX_Size() int

func (*VolumeList) XXX_Unmarshal

func (m *VolumeList) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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