Documentation ¶
Index ¶
- Variables
- func RegisterStorageServer(s *grpc.Server, srv StorageServer)
- type Response
- func (*Response) Descriptor() ([]byte, []int)
- func (m *Response) GetStatus() Response_Status
- func (*Response) ProtoMessage()
- func (m *Response) Reset()
- func (m *Response) String() string
- func (m *Response) XXX_DiscardUnknown()
- func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Response) XXX_Merge(src proto.Message)
- func (m *Response) XXX_Size() int
- func (m *Response) XXX_Unmarshal(b []byte) error
- type Response_Status
- type Service
- type Storage
- type StorageClient
- type StorageServer
- type UUID
- func (*UUID) Descriptor() ([]byte, []int)
- func (m *UUID) GetValue() string
- func (*UUID) ProtoMessage()
- func (m *UUID) Reset()
- func (m *UUID) String() string
- func (m *UUID) XXX_DiscardUnknown()
- func (m *UUID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *UUID) XXX_Merge(src proto.Message)
- func (m *UUID) XXX_Size() int
- func (m *UUID) XXX_Unmarshal(b []byte) error
- type UnimplementedStorageServer
- type Volume
- func (*Volume) Descriptor() ([]byte, []int)
- func (m *Volume) GetSize() int64
- func (m *Volume) GetUUID() string
- func (*Volume) ProtoMessage()
- func (m *Volume) Reset()
- func (m *Volume) String() string
- func (m *Volume) XXX_DiscardUnknown()
- func (m *Volume) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Volume) XXX_Merge(src proto.Message)
- func (m *Volume) XXX_Size() int
- func (m *Volume) XXX_Unmarshal(b []byte) error
- type VolumeList
- func (*VolumeList) Descriptor() ([]byte, []int)
- func (m *VolumeList) GetVolumes() []*Volume
- func (*VolumeList) ProtoMessage()
- func (m *VolumeList) Reset()
- func (m *VolumeList) String() string
- func (m *VolumeList) XXX_DiscardUnknown()
- func (m *VolumeList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *VolumeList) XXX_Merge(src proto.Message)
- func (m *VolumeList) XXX_Size() int
- func (m *VolumeList) XXX_Unmarshal(b []byte) error
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) GetStatus ¶
func (m *Response) GetStatus() Response_Status
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) XXX_DiscardUnknown ¶
func (m *Response) XXX_DiscardUnknown()
func (*Response) XXX_Marshal ¶
func (*Response) XXX_Unmarshal ¶
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
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) ProtoMessage ¶
func (*UUID) ProtoMessage()
func (*UUID) XXX_DiscardUnknown ¶
func (m *UUID) XXX_DiscardUnknown()
func (*UUID) XXX_Unmarshal ¶
type UnimplementedStorageServer ¶
type UnimplementedStorageServer struct { }
UnimplementedStorageServer can be embedded to have forward compatible implementations.
func (*UnimplementedStorageServer) List ¶
func (*UnimplementedStorageServer) List(ctx context.Context, req *empty.Empty) (*VolumeList, error)
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) ProtoMessage ¶
func (*Volume) ProtoMessage()
func (*Volume) XXX_DiscardUnknown ¶
func (m *Volume) XXX_DiscardUnknown()
func (*Volume) XXX_Marshal ¶
func (*Volume) XXX_Unmarshal ¶
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
Click to show internal directories.
Click to hide internal directories.