Documentation ¶
Index ¶
- Variables
- func RegisterStorageProviderServer(s grpc.ServiceRegistrar, srv StorageProviderServer)
- func Start(storage storage.StorageProvider) (err error)
- type BridgeStorageProviderServer
- func (s *BridgeStorageProviderServer) CloseFile(ctx context.Context, req *CloseFileQuery) (*Error, error)
- func (s *BridgeStorageProviderServer) Configure(ctx context.Context, req *ConfigData) (*Error, error)
- func (s *BridgeStorageProviderServer) Delete(ctx context.Context, req *DeleteQuery) (*Error, error)
- func (s *BridgeStorageProviderServer) InitUser(ctx context.Context, req *User) (*Error, error)
- func (s *BridgeStorageProviderServer) ListDirectory(req *ListDirectoryQuery, srv StorageProvider_ListDirectoryServer) error
- func (s *BridgeStorageProviderServer) MkDir(ctx context.Context, req *MkdirQuery) (*Error, error)
- func (s *BridgeStorageProviderServer) Move(ctx context.Context, req *MoveQuery) (*Error, error)
- func (s *BridgeStorageProviderServer) OpenFile(ctx context.Context, req *OpenFileQuery) (*OpenFileReply, error)
- func (s *BridgeStorageProviderServer) ReadFile(req *ReadFileQuery, srv StorageProvider_ReadFileServer) error
- func (s *BridgeStorageProviderServer) WriteFile(ctx context.Context, req *WriteFileQuery) (*WriteFileReply, error)
- type CloseFileQuery
- type ConfigData
- type DeleteQuery
- func (*DeleteQuery) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteQuery) GetFullPath() string
- func (x *DeleteQuery) GetUser() *User
- func (*DeleteQuery) ProtoMessage()
- func (x *DeleteQuery) ProtoReflect() protoreflect.Message
- func (x *DeleteQuery) Reset()
- func (x *DeleteQuery) String() string
- type Error
- type File
- type FileInfo
- func (*FileInfo) Descriptor() ([]byte, []int)deprecated
- func (x *FileInfo) GetCreatedAt() uint64
- func (x *FileInfo) GetDirectory() bool
- func (x *FileInfo) GetFullPath() string
- func (x *FileInfo) GetName() string
- func (x *FileInfo) GetSize() uint64
- func (x *FileInfo) GetUpdatedAt() uint64
- func (*FileInfo) ProtoMessage()
- func (x *FileInfo) ProtoReflect() protoreflect.Message
- func (x *FileInfo) Reset()
- func (x *FileInfo) String() string
- type GrpcStorage
- func (s *GrpcStorage) Close() error
- func (s *GrpcStorage) Delete(ctx context.Context, user *models.User, fullpath string) error
- func (s *GrpcStorage) File(ctx context.Context, user *models.User, fullpath string) (storage.File, error)
- func (s *GrpcStorage) InitUser(ctx context.Context, user *models.User) error
- func (s *GrpcStorage) ListDirectory(ctx context.Context, user *models.User, path string) (<-chan storage.FileInfo, error)
- func (s *GrpcStorage) Mkdir(ctx context.Context, user *models.User, path string) error
- func (s *GrpcStorage) Move(ctx context.Context, user *models.User, src, dst string) error
- type ListDirectoryQuery
- func (*ListDirectoryQuery) Descriptor() ([]byte, []int)deprecated
- func (x *ListDirectoryQuery) GetPath() string
- func (x *ListDirectoryQuery) GetUser() *User
- func (*ListDirectoryQuery) ProtoMessage()
- func (x *ListDirectoryQuery) ProtoReflect() protoreflect.Message
- func (x *ListDirectoryQuery) Reset()
- func (x *ListDirectoryQuery) String() string
- type MkdirQuery
- type MoveQuery
- func (*MoveQuery) Descriptor() ([]byte, []int)deprecated
- func (x *MoveQuery) GetDst() string
- func (x *MoveQuery) GetSrc() string
- func (x *MoveQuery) GetUser() *User
- func (*MoveQuery) ProtoMessage()
- func (x *MoveQuery) ProtoReflect() protoreflect.Message
- func (x *MoveQuery) Reset()
- func (x *MoveQuery) String() string
- type OpenFileQuery
- func (*OpenFileQuery) Descriptor() ([]byte, []int)deprecated
- func (x *OpenFileQuery) GetFullPath() string
- func (x *OpenFileQuery) GetUser() *User
- func (*OpenFileQuery) ProtoMessage()
- func (x *OpenFileQuery) ProtoReflect() protoreflect.Message
- func (x *OpenFileQuery) Reset()
- func (x *OpenFileQuery) String() string
- type OpenFileReply
- func (*OpenFileReply) Descriptor() ([]byte, []int)deprecated
- func (x *OpenFileReply) GetError() *Error
- func (x *OpenFileReply) GetId() int32
- func (*OpenFileReply) ProtoMessage()
- func (x *OpenFileReply) ProtoReflect() protoreflect.Message
- func (x *OpenFileReply) Reset()
- func (x *OpenFileReply) String() string
- type ReadFileQuery
- type ReadFileReply
- func (*ReadFileReply) Descriptor() ([]byte, []int)deprecated
- func (x *ReadFileReply) GetData() []byte
- func (x *ReadFileReply) GetEOF() bool
- func (x *ReadFileReply) GetError() *Error
- func (*ReadFileReply) ProtoMessage()
- func (x *ReadFileReply) ProtoReflect() protoreflect.Message
- func (x *ReadFileReply) Reset()
- func (x *ReadFileReply) String() string
- type StorageProviderClient
- type StorageProviderServer
- type StorageProvider_ListDirectoryClient
- type StorageProvider_ListDirectoryServer
- type StorageProvider_ReadFileClient
- type StorageProvider_ReadFileServer
- type UnimplementedStorageProviderServer
- func (UnimplementedStorageProviderServer) CloseFile(context.Context, *CloseFileQuery) (*Error, error)
- func (UnimplementedStorageProviderServer) Configure(context.Context, *ConfigData) (*Error, error)
- func (UnimplementedStorageProviderServer) Delete(context.Context, *DeleteQuery) (*Error, error)
- func (UnimplementedStorageProviderServer) InitUser(context.Context, *User) (*Error, error)
- func (UnimplementedStorageProviderServer) ListDirectory(*ListDirectoryQuery, StorageProvider_ListDirectoryServer) error
- func (UnimplementedStorageProviderServer) MkDir(context.Context, *MkdirQuery) (*Error, error)
- func (UnimplementedStorageProviderServer) Move(context.Context, *MoveQuery) (*Error, error)
- func (UnimplementedStorageProviderServer) OpenFile(context.Context, *OpenFileQuery) (*OpenFileReply, error)
- func (UnimplementedStorageProviderServer) ReadFile(*ReadFileQuery, StorageProvider_ReadFileServer) error
- func (UnimplementedStorageProviderServer) WriteFile(context.Context, *WriteFileQuery) (*WriteFileReply, error)
- type UnsafeStorageProviderServer
- type User
- type WriteFileQuery
- func (*WriteFileQuery) Descriptor() ([]byte, []int)deprecated
- func (x *WriteFileQuery) GetData() []byte
- func (x *WriteFileQuery) GetId() int32
- func (*WriteFileQuery) ProtoMessage()
- func (x *WriteFileQuery) ProtoReflect() protoreflect.Message
- func (x *WriteFileQuery) Reset()
- func (x *WriteFileQuery) String() string
- type WriteFileReply
- func (*WriteFileReply) Descriptor() ([]byte, []int)deprecated
- func (x *WriteFileReply) GetError() *Error
- func (x *WriteFileReply) GetSizeWritten() int32
- func (*WriteFileReply) ProtoMessage()
- func (x *WriteFileReply) ProtoReflect() protoreflect.Message
- func (x *WriteFileReply) Reset()
- func (x *WriteFileReply) String() string
Constants ¶
This section is empty.
Variables ¶
var ErrNoUser = &Error{Message: "No user specified"}
var File_storage_proto protoreflect.FileDescriptor
var StorageProvider_ServiceDesc = grpc.ServiceDesc{ ServiceName: "leichtcloud.storage.plugin.StorageProvider", HandlerType: (*StorageProviderServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Configure", Handler: _StorageProvider_Configure_Handler, }, { MethodName: "InitUser", Handler: _StorageProvider_InitUser_Handler, }, { MethodName: "MkDir", Handler: _StorageProvider_MkDir_Handler, }, { MethodName: "Move", Handler: _StorageProvider_Move_Handler, }, { MethodName: "OpenFile", Handler: _StorageProvider_OpenFile_Handler, }, { MethodName: "CloseFile", Handler: _StorageProvider_CloseFile_Handler, }, { MethodName: "WriteFile", Handler: _StorageProvider_WriteFile_Handler, }, { MethodName: "Delete", Handler: _StorageProvider_Delete_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "ListDirectory", Handler: _StorageProvider_ListDirectory_Handler, ServerStreams: true, }, { StreamName: "ReadFile", Handler: _StorageProvider_ReadFile_Handler, ServerStreams: true, }, }, Metadata: "storage.proto", }
StorageProvider_ServiceDesc is the grpc.ServiceDesc for StorageProvider service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterStorageProviderServer ¶
func RegisterStorageProviderServer(s grpc.ServiceRegistrar, srv StorageProviderServer)
func Start ¶
func Start(storage storage.StorageProvider) (err error)
This is meant to be called in the main() of your plugin
Types ¶
type BridgeStorageProviderServer ¶
type BridgeStorageProviderServer struct { Storage storage.StorageProvider // contains filtered or unexported fields }
func NewStorageBridge ¶
func NewStorageBridge(storage storage.StorageProvider) *BridgeStorageProviderServer
func (*BridgeStorageProviderServer) CloseFile ¶
func (s *BridgeStorageProviderServer) CloseFile(ctx context.Context, req *CloseFileQuery) (*Error, error)
func (*BridgeStorageProviderServer) Configure ¶
func (s *BridgeStorageProviderServer) Configure(ctx context.Context, req *ConfigData) (*Error, error)
func (*BridgeStorageProviderServer) Delete ¶
func (s *BridgeStorageProviderServer) Delete(ctx context.Context, req *DeleteQuery) (*Error, error)
func (*BridgeStorageProviderServer) ListDirectory ¶
func (s *BridgeStorageProviderServer) ListDirectory(req *ListDirectoryQuery, srv StorageProvider_ListDirectoryServer) error
func (*BridgeStorageProviderServer) MkDir ¶
func (s *BridgeStorageProviderServer) MkDir(ctx context.Context, req *MkdirQuery) (*Error, error)
func (*BridgeStorageProviderServer) OpenFile ¶
func (s *BridgeStorageProviderServer) OpenFile(ctx context.Context, req *OpenFileQuery) (*OpenFileReply, error)
func (*BridgeStorageProviderServer) ReadFile ¶
func (s *BridgeStorageProviderServer) ReadFile(req *ReadFileQuery, srv StorageProvider_ReadFileServer) error
func (*BridgeStorageProviderServer) WriteFile ¶
func (s *BridgeStorageProviderServer) WriteFile(ctx context.Context, req *WriteFileQuery) (*WriteFileReply, error)
type CloseFileQuery ¶
type CloseFileQuery struct { Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*CloseFileQuery) Descriptor
deprecated
func (*CloseFileQuery) Descriptor() ([]byte, []int)
Deprecated: Use CloseFileQuery.ProtoReflect.Descriptor instead.
func (*CloseFileQuery) GetId ¶
func (x *CloseFileQuery) GetId() int32
func (*CloseFileQuery) ProtoMessage ¶
func (*CloseFileQuery) ProtoMessage()
func (*CloseFileQuery) ProtoReflect ¶
func (x *CloseFileQuery) ProtoReflect() protoreflect.Message
func (*CloseFileQuery) Reset ¶
func (x *CloseFileQuery) Reset()
func (*CloseFileQuery) String ¶
func (x *CloseFileQuery) String() string
type ConfigData ¶
type ConfigData struct { Yaml []byte `protobuf:"bytes,1,opt,name=yaml,proto3" json:"yaml,omitempty"` // contains filtered or unexported fields }
func (*ConfigData) Descriptor
deprecated
func (*ConfigData) Descriptor() ([]byte, []int)
Deprecated: Use ConfigData.ProtoReflect.Descriptor instead.
func (*ConfigData) GetYaml ¶
func (x *ConfigData) GetYaml() []byte
func (*ConfigData) ProtoMessage ¶
func (*ConfigData) ProtoMessage()
func (*ConfigData) ProtoReflect ¶
func (x *ConfigData) ProtoReflect() protoreflect.Message
func (*ConfigData) Reset ¶
func (x *ConfigData) Reset()
func (*ConfigData) String ¶
func (x *ConfigData) String() string
type DeleteQuery ¶
type DeleteQuery struct { User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` FullPath string `protobuf:"bytes,2,opt,name=fullPath,proto3" json:"fullPath,omitempty"` // contains filtered or unexported fields }
func (*DeleteQuery) Descriptor
deprecated
func (*DeleteQuery) Descriptor() ([]byte, []int)
Deprecated: Use DeleteQuery.ProtoReflect.Descriptor instead.
func (*DeleteQuery) GetFullPath ¶
func (x *DeleteQuery) GetFullPath() string
func (*DeleteQuery) GetUser ¶
func (x *DeleteQuery) GetUser() *User
func (*DeleteQuery) ProtoMessage ¶
func (*DeleteQuery) ProtoMessage()
func (*DeleteQuery) ProtoReflect ¶
func (x *DeleteQuery) ProtoReflect() protoreflect.Message
func (*DeleteQuery) Reset ¶
func (x *DeleteQuery) Reset()
func (*DeleteQuery) String ¶
func (x *DeleteQuery) String() string
type Error ¶
type Error struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*Error) Descriptor
deprecated
func (*Error) GetMessage ¶
func (*Error) ProtoMessage ¶
func (*Error) ProtoMessage()
func (*Error) ProtoReflect ¶
func (x *Error) ProtoReflect() protoreflect.Message
type File ¶
type File struct { Storage *GrpcStorage Id int32 // contains filtered or unexported fields }
type FileInfo ¶
type FileInfo struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` FullPath string `protobuf:"bytes,2,opt,name=fullPath,proto3" json:"fullPath,omitempty"` CreatedAt uint64 `protobuf:"varint,3,opt,name=createdAt,proto3" json:"createdAt,omitempty"` UpdatedAt uint64 `protobuf:"varint,4,opt,name=updatedAt,proto3" json:"updatedAt,omitempty"` Size uint64 `protobuf:"varint,5,opt,name=size,proto3" json:"size,omitempty"` Directory bool `protobuf:"varint,6,opt,name=directory,proto3" json:"directory,omitempty"` // contains filtered or unexported fields }
This basically maps to the FileInfo struct
func (*FileInfo) Descriptor
deprecated
func (*FileInfo) GetCreatedAt ¶
func (*FileInfo) GetDirectory ¶
func (*FileInfo) GetFullPath ¶
func (*FileInfo) GetUpdatedAt ¶
func (*FileInfo) ProtoMessage ¶
func (*FileInfo) ProtoMessage()
func (*FileInfo) ProtoReflect ¶
func (x *FileInfo) ProtoReflect() protoreflect.Message
type GrpcStorage ¶
type GrpcStorage struct { Conn *grpc.ClientConn Client StorageProviderClient // contains filtered or unexported fields }
func NewGrpcStorage ¶
func NewGrpcStorage(conn *grpc.ClientConn, config map[interface{}]interface{}) (*GrpcStorage, error)
func (*GrpcStorage) Close ¶
func (s *GrpcStorage) Close() error
func (*GrpcStorage) ListDirectory ¶
type ListDirectoryQuery ¶
type ListDirectoryQuery struct { User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` // contains filtered or unexported fields }
func (*ListDirectoryQuery) Descriptor
deprecated
func (*ListDirectoryQuery) Descriptor() ([]byte, []int)
Deprecated: Use ListDirectoryQuery.ProtoReflect.Descriptor instead.
func (*ListDirectoryQuery) GetPath ¶
func (x *ListDirectoryQuery) GetPath() string
func (*ListDirectoryQuery) GetUser ¶
func (x *ListDirectoryQuery) GetUser() *User
func (*ListDirectoryQuery) ProtoMessage ¶
func (*ListDirectoryQuery) ProtoMessage()
func (*ListDirectoryQuery) ProtoReflect ¶
func (x *ListDirectoryQuery) ProtoReflect() protoreflect.Message
func (*ListDirectoryQuery) Reset ¶
func (x *ListDirectoryQuery) Reset()
func (*ListDirectoryQuery) String ¶
func (x *ListDirectoryQuery) String() string
type MkdirQuery ¶
type MkdirQuery struct { User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` // contains filtered or unexported fields }
func (*MkdirQuery) Descriptor
deprecated
func (*MkdirQuery) Descriptor() ([]byte, []int)
Deprecated: Use MkdirQuery.ProtoReflect.Descriptor instead.
func (*MkdirQuery) GetPath ¶
func (x *MkdirQuery) GetPath() string
func (*MkdirQuery) GetUser ¶
func (x *MkdirQuery) GetUser() *User
func (*MkdirQuery) ProtoMessage ¶
func (*MkdirQuery) ProtoMessage()
func (*MkdirQuery) ProtoReflect ¶
func (x *MkdirQuery) ProtoReflect() protoreflect.Message
func (*MkdirQuery) Reset ¶
func (x *MkdirQuery) Reset()
func (*MkdirQuery) String ¶
func (x *MkdirQuery) String() string
type MoveQuery ¶
type MoveQuery struct { User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` Src string `protobuf:"bytes,2,opt,name=src,proto3" json:"src,omitempty"` Dst string `protobuf:"bytes,3,opt,name=dst,proto3" json:"dst,omitempty"` // contains filtered or unexported fields }
func (*MoveQuery) Descriptor
deprecated
func (*MoveQuery) ProtoMessage ¶
func (*MoveQuery) ProtoMessage()
func (*MoveQuery) ProtoReflect ¶
func (x *MoveQuery) ProtoReflect() protoreflect.Message
type OpenFileQuery ¶
type OpenFileQuery struct { User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` FullPath string `protobuf:"bytes,2,opt,name=fullPath,proto3" json:"fullPath,omitempty"` // contains filtered or unexported fields }
func (*OpenFileQuery) Descriptor
deprecated
func (*OpenFileQuery) Descriptor() ([]byte, []int)
Deprecated: Use OpenFileQuery.ProtoReflect.Descriptor instead.
func (*OpenFileQuery) GetFullPath ¶
func (x *OpenFileQuery) GetFullPath() string
func (*OpenFileQuery) GetUser ¶
func (x *OpenFileQuery) GetUser() *User
func (*OpenFileQuery) ProtoMessage ¶
func (*OpenFileQuery) ProtoMessage()
func (*OpenFileQuery) ProtoReflect ¶
func (x *OpenFileQuery) ProtoReflect() protoreflect.Message
func (*OpenFileQuery) Reset ¶
func (x *OpenFileQuery) Reset()
func (*OpenFileQuery) String ¶
func (x *OpenFileQuery) String() string
type OpenFileReply ¶
type OpenFileReply struct { Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Error *Error `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` // contains filtered or unexported fields }
func (*OpenFileReply) Descriptor
deprecated
func (*OpenFileReply) Descriptor() ([]byte, []int)
Deprecated: Use OpenFileReply.ProtoReflect.Descriptor instead.
func (*OpenFileReply) GetError ¶
func (x *OpenFileReply) GetError() *Error
func (*OpenFileReply) GetId ¶
func (x *OpenFileReply) GetId() int32
func (*OpenFileReply) ProtoMessage ¶
func (*OpenFileReply) ProtoMessage()
func (*OpenFileReply) ProtoReflect ¶
func (x *OpenFileReply) ProtoReflect() protoreflect.Message
func (*OpenFileReply) Reset ¶
func (x *OpenFileReply) Reset()
func (*OpenFileReply) String ¶
func (x *OpenFileReply) String() string
type ReadFileQuery ¶
type ReadFileQuery struct { Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*ReadFileQuery) Descriptor
deprecated
func (*ReadFileQuery) Descriptor() ([]byte, []int)
Deprecated: Use ReadFileQuery.ProtoReflect.Descriptor instead.
func (*ReadFileQuery) GetId ¶
func (x *ReadFileQuery) GetId() int32
func (*ReadFileQuery) ProtoMessage ¶
func (*ReadFileQuery) ProtoMessage()
func (*ReadFileQuery) ProtoReflect ¶
func (x *ReadFileQuery) ProtoReflect() protoreflect.Message
func (*ReadFileQuery) Reset ¶
func (x *ReadFileQuery) Reset()
func (*ReadFileQuery) String ¶
func (x *ReadFileQuery) String() string
type ReadFileReply ¶
type ReadFileReply struct { Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` EOF bool `protobuf:"varint,2,opt,name=EOF,proto3" json:"EOF,omitempty"` Error *Error `protobuf:"bytes,3,opt,name=error,proto3" json:"error,omitempty"` // contains filtered or unexported fields }
func (*ReadFileReply) Descriptor
deprecated
func (*ReadFileReply) Descriptor() ([]byte, []int)
Deprecated: Use ReadFileReply.ProtoReflect.Descriptor instead.
func (*ReadFileReply) GetData ¶
func (x *ReadFileReply) GetData() []byte
func (*ReadFileReply) GetEOF ¶
func (x *ReadFileReply) GetEOF() bool
func (*ReadFileReply) GetError ¶
func (x *ReadFileReply) GetError() *Error
func (*ReadFileReply) ProtoMessage ¶
func (*ReadFileReply) ProtoMessage()
func (*ReadFileReply) ProtoReflect ¶
func (x *ReadFileReply) ProtoReflect() protoreflect.Message
func (*ReadFileReply) Reset ¶
func (x *ReadFileReply) Reset()
func (*ReadFileReply) String ¶
func (x *ReadFileReply) String() string
type StorageProviderClient ¶
type StorageProviderClient interface { Configure(ctx context.Context, in *ConfigData, opts ...grpc.CallOption) (*Error, error) InitUser(ctx context.Context, in *User, opts ...grpc.CallOption) (*Error, error) MkDir(ctx context.Context, in *MkdirQuery, opts ...grpc.CallOption) (*Error, error) Move(ctx context.Context, in *MoveQuery, opts ...grpc.CallOption) (*Error, error) ListDirectory(ctx context.Context, in *ListDirectoryQuery, opts ...grpc.CallOption) (StorageProvider_ListDirectoryClient, error) OpenFile(ctx context.Context, in *OpenFileQuery, opts ...grpc.CallOption) (*OpenFileReply, error) CloseFile(ctx context.Context, in *CloseFileQuery, opts ...grpc.CallOption) (*Error, error) WriteFile(ctx context.Context, in *WriteFileQuery, opts ...grpc.CallOption) (*WriteFileReply, error) ReadFile(ctx context.Context, in *ReadFileQuery, opts ...grpc.CallOption) (StorageProvider_ReadFileClient, error) Delete(ctx context.Context, in *DeleteQuery, opts ...grpc.CallOption) (*Error, error) }
StorageProviderClient is the client API for StorageProvider service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.golang.ir/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewStorageProviderClient ¶
func NewStorageProviderClient(cc grpc.ClientConnInterface) StorageProviderClient
type StorageProviderServer ¶
type StorageProviderServer interface { Configure(context.Context, *ConfigData) (*Error, error) InitUser(context.Context, *User) (*Error, error) MkDir(context.Context, *MkdirQuery) (*Error, error) Move(context.Context, *MoveQuery) (*Error, error) ListDirectory(*ListDirectoryQuery, StorageProvider_ListDirectoryServer) error OpenFile(context.Context, *OpenFileQuery) (*OpenFileReply, error) CloseFile(context.Context, *CloseFileQuery) (*Error, error) WriteFile(context.Context, *WriteFileQuery) (*WriteFileReply, error) ReadFile(*ReadFileQuery, StorageProvider_ReadFileServer) error Delete(context.Context, *DeleteQuery) (*Error, error) // contains filtered or unexported methods }
StorageProviderServer is the server API for StorageProvider service. All implementations must embed UnimplementedStorageProviderServer for forward compatibility
type StorageProvider_ListDirectoryClient ¶
type StorageProvider_ListDirectoryClient interface { Recv() (*FileInfo, error) grpc.ClientStream }
type StorageProvider_ListDirectoryServer ¶
type StorageProvider_ListDirectoryServer interface { Send(*FileInfo) error grpc.ServerStream }
type StorageProvider_ReadFileClient ¶
type StorageProvider_ReadFileClient interface { Recv() (*ReadFileReply, error) grpc.ClientStream }
type StorageProvider_ReadFileServer ¶
type StorageProvider_ReadFileServer interface { Send(*ReadFileReply) error grpc.ServerStream }
type UnimplementedStorageProviderServer ¶
type UnimplementedStorageProviderServer struct { }
UnimplementedStorageProviderServer must be embedded to have forward compatible implementations.
func (UnimplementedStorageProviderServer) CloseFile ¶
func (UnimplementedStorageProviderServer) CloseFile(context.Context, *CloseFileQuery) (*Error, error)
func (UnimplementedStorageProviderServer) Configure ¶
func (UnimplementedStorageProviderServer) Configure(context.Context, *ConfigData) (*Error, error)
func (UnimplementedStorageProviderServer) Delete ¶
func (UnimplementedStorageProviderServer) Delete(context.Context, *DeleteQuery) (*Error, error)
func (UnimplementedStorageProviderServer) ListDirectory ¶
func (UnimplementedStorageProviderServer) ListDirectory(*ListDirectoryQuery, StorageProvider_ListDirectoryServer) error
func (UnimplementedStorageProviderServer) MkDir ¶
func (UnimplementedStorageProviderServer) MkDir(context.Context, *MkdirQuery) (*Error, error)
func (UnimplementedStorageProviderServer) OpenFile ¶
func (UnimplementedStorageProviderServer) OpenFile(context.Context, *OpenFileQuery) (*OpenFileReply, error)
func (UnimplementedStorageProviderServer) ReadFile ¶
func (UnimplementedStorageProviderServer) ReadFile(*ReadFileQuery, StorageProvider_ReadFileServer) error
func (UnimplementedStorageProviderServer) WriteFile ¶
func (UnimplementedStorageProviderServer) WriteFile(context.Context, *WriteFileQuery) (*WriteFileReply, error)
type UnsafeStorageProviderServer ¶
type UnsafeStorageProviderServer interface {
// contains filtered or unexported methods
}
UnsafeStorageProviderServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to StorageProviderServer will result in compilation errors.
type User ¶
type User struct { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
This sort of maps to the User struct, although we only give the id as that should be the only relevant thing.
func (*User) Descriptor
deprecated
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message
type WriteFileQuery ¶
type WriteFileQuery struct { Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*WriteFileQuery) Descriptor
deprecated
func (*WriteFileQuery) Descriptor() ([]byte, []int)
Deprecated: Use WriteFileQuery.ProtoReflect.Descriptor instead.
func (*WriteFileQuery) GetData ¶
func (x *WriteFileQuery) GetData() []byte
func (*WriteFileQuery) GetId ¶
func (x *WriteFileQuery) GetId() int32
func (*WriteFileQuery) ProtoMessage ¶
func (*WriteFileQuery) ProtoMessage()
func (*WriteFileQuery) ProtoReflect ¶
func (x *WriteFileQuery) ProtoReflect() protoreflect.Message
func (*WriteFileQuery) Reset ¶
func (x *WriteFileQuery) Reset()
func (*WriteFileQuery) String ¶
func (x *WriteFileQuery) String() string
type WriteFileReply ¶
type WriteFileReply struct { SizeWritten int32 `protobuf:"varint,1,opt,name=size_written,json=sizeWritten,proto3" json:"size_written,omitempty"` Error *Error `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` // contains filtered or unexported fields }
func (*WriteFileReply) Descriptor
deprecated
func (*WriteFileReply) Descriptor() ([]byte, []int)
Deprecated: Use WriteFileReply.ProtoReflect.Descriptor instead.
func (*WriteFileReply) GetError ¶
func (x *WriteFileReply) GetError() *Error
func (*WriteFileReply) GetSizeWritten ¶
func (x *WriteFileReply) GetSizeWritten() int32
func (*WriteFileReply) ProtoMessage ¶
func (*WriteFileReply) ProtoMessage()
func (*WriteFileReply) ProtoReflect ¶
func (x *WriteFileReply) ProtoReflect() protoreflect.Message
func (*WriteFileReply) Reset ¶
func (x *WriteFileReply) Reset()
func (*WriteFileReply) String ¶
func (x *WriteFileReply) String() string