Documentation ¶
Index ¶
- Constants
- func GenerateTLSKeyPair(at string) error
- func GetCertFileFingerprint(at string) (string, error)
- func GetCertFingerprint(cert *x509.Certificate) (string, error)
- func GetPeerFingerprint(ctx context.Context) (string, error)
- func RegisterStorageServer(s *grpc.Server, srv StorageServer)
- type DirectoryEnt
- func (*DirectoryEnt) Descriptor() ([]byte, []int)
- func (m *DirectoryEnt) GetPath() string
- func (m *DirectoryEnt) GetSize() int64
- func (*DirectoryEnt) ProtoMessage()
- func (m *DirectoryEnt) Reset()
- func (m *DirectoryEnt) String() string
- func (m *DirectoryEnt) XXX_DiscardUnknown()
- func (m *DirectoryEnt) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *DirectoryEnt) XXX_Merge(src proto.Message)
- func (m *DirectoryEnt) XXX_Size() int
- func (m *DirectoryEnt) XXX_Unmarshal(b []byte) error
- type DirectoryList
- func (*DirectoryList) Descriptor() ([]byte, []int)
- func (m *DirectoryList) GetResults() []*DirectoryEnt
- func (*DirectoryList) ProtoMessage()
- func (m *DirectoryList) Reset()
- func (m *DirectoryList) String() string
- func (m *DirectoryList) XXX_DiscardUnknown()
- func (m *DirectoryList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *DirectoryList) XXX_Merge(src proto.Message)
- func (m *DirectoryList) XXX_Size() int
- func (m *DirectoryList) XXX_Unmarshal(b []byte) error
- type Empty
- func (*Empty) Descriptor() ([]byte, []int)
- func (*Empty) ProtoMessage()
- func (m *Empty) Reset()
- func (m *Empty) String() string
- func (m *Empty) XXX_DiscardUnknown()
- func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Empty) XXX_Merge(src proto.Message)
- func (m *Empty) XXX_Size() int
- func (m *Empty) XXX_Unmarshal(b []byte) error
- type File
- type FileStorageClient
- type FileStorageServer
- func (fss *FileStorageServer) ListDirectory(ctx context.Context, req *Empty) (*DirectoryList, error)
- func (fss *FileStorageServer) ReadAt(ctx context.Context, req *ReadAtRequest) (*ReadChunk, error)
- func (fss *FileStorageServer) Stat(ctx context.Context, req *StatRequest) (*StatResponse, error)
- func (fss *FileStorageServer) WriteAll(srv Storage_WriteAllServer) error
- type ReadAtRequest
- func (*ReadAtRequest) Descriptor() ([]byte, []int)
- func (m *ReadAtRequest) GetPath() string
- func (m *ReadAtRequest) GetSize() uint64
- func (m *ReadAtRequest) GetStartOffset() uint64
- func (*ReadAtRequest) ProtoMessage()
- func (m *ReadAtRequest) Reset()
- func (m *ReadAtRequest) String() string
- func (m *ReadAtRequest) XXX_DiscardUnknown()
- func (m *ReadAtRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ReadAtRequest) XXX_Merge(src proto.Message)
- func (m *ReadAtRequest) XXX_Size() int
- func (m *ReadAtRequest) XXX_Unmarshal(b []byte) error
- type ReadChunk
- func (*ReadChunk) Descriptor() ([]byte, []int)
- func (m *ReadChunk) GetData() []byte
- func (*ReadChunk) ProtoMessage()
- func (m *ReadChunk) Reset()
- func (m *ReadChunk) String() string
- func (m *ReadChunk) XXX_DiscardUnknown()
- func (m *ReadChunk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ReadChunk) XXX_Merge(src proto.Message)
- func (m *ReadChunk) XXX_Size() int
- func (m *ReadChunk) XXX_Unmarshal(b []byte) error
- type StatRequest
- func (*StatRequest) Descriptor() ([]byte, []int)
- func (m *StatRequest) GetPath() string
- func (*StatRequest) ProtoMessage()
- func (m *StatRequest) Reset()
- func (m *StatRequest) String() string
- func (m *StatRequest) XXX_DiscardUnknown()
- func (m *StatRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *StatRequest) XXX_Merge(src proto.Message)
- func (m *StatRequest) XXX_Size() int
- func (m *StatRequest) XXX_Unmarshal(b []byte) error
- type StatResponse
- func (*StatResponse) Descriptor() ([]byte, []int)
- func (m *StatResponse) GetFileIsDirectory() bool
- func (m *StatResponse) GetFileModTime() *timestamp.Timestamp
- func (m *StatResponse) GetFileMode() uint32
- func (m *StatResponse) GetFileName() string
- func (m *StatResponse) GetFileSize() int64
- func (s *StatResponse) IsDir() bool
- func (s *StatResponse) ModTime() time.Time
- func (s *StatResponse) Mode() os.FileMode
- func (s *StatResponse) Name() string
- func (*StatResponse) ProtoMessage()
- func (m *StatResponse) Reset()
- func (s *StatResponse) Size() int64
- func (m *StatResponse) String() string
- func (s *StatResponse) Sys() interface{}
- func (m *StatResponse) XXX_DiscardUnknown()
- func (m *StatResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *StatResponse) XXX_Merge(src proto.Message)
- func (m *StatResponse) XXX_Size() int
- func (m *StatResponse) XXX_Unmarshal(b []byte) error
- type StorageClient
- type StorageServer
- type Storage_WriteAllClient
- type Storage_WriteAllServer
- type UnimplementedStorageServer
- func (*UnimplementedStorageServer) ListDirectory(ctx context.Context, req *Empty) (*DirectoryList, error)
- func (*UnimplementedStorageServer) ReadAt(ctx context.Context, req *ReadAtRequest) (*ReadChunk, error)
- func (*UnimplementedStorageServer) Stat(ctx context.Context, req *StatRequest) (*StatResponse, error)
- func (*UnimplementedStorageServer) WriteAll(srv Storage_WriteAllServer) error
- type WritePiece
- func (*WritePiece) Descriptor() ([]byte, []int)
- func (m *WritePiece) GetData() []byte
- func (m *WritePiece) GetFileName() string
- func (m *WritePiece) GetPieceContent() isWritePiece_PieceContent
- func (*WritePiece) ProtoMessage()
- func (m *WritePiece) Reset()
- func (m *WritePiece) String() string
- func (m *WritePiece) XXX_DiscardUnknown()
- func (m *WritePiece) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *WritePiece) XXX_Merge(src proto.Message)
- func (*WritePiece) XXX_OneofWrappers() []interface{}
- func (m *WritePiece) XXX_Size() int
- func (m *WritePiece) XXX_Unmarshal(b []byte) error
- type WritePiece_Data
- type WritePiece_FileName
Constants ¶
View Source
const (
// 3 megabytes
MaxChunkSize = 3e+6
)
Variables ¶
This section is empty.
Functions ¶
func GenerateTLSKeyPair ¶
func GetCertFileFingerprint ¶
func GetCertFingerprint ¶
func GetCertFingerprint(cert *x509.Certificate) (string, error)
func RegisterStorageServer ¶
func RegisterStorageServer(s *grpc.Server, srv StorageServer)
Types ¶
type DirectoryEnt ¶
type DirectoryEnt struct { Path string `protobuf:"bytes,1,opt,name=Path,proto3" json:"Path,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 (*DirectoryEnt) Descriptor ¶
func (*DirectoryEnt) Descriptor() ([]byte, []int)
func (*DirectoryEnt) GetPath ¶
func (m *DirectoryEnt) GetPath() string
func (*DirectoryEnt) GetSize ¶
func (m *DirectoryEnt) GetSize() int64
func (*DirectoryEnt) ProtoMessage ¶
func (*DirectoryEnt) ProtoMessage()
func (*DirectoryEnt) Reset ¶
func (m *DirectoryEnt) Reset()
func (*DirectoryEnt) String ¶
func (m *DirectoryEnt) String() string
func (*DirectoryEnt) XXX_DiscardUnknown ¶
func (m *DirectoryEnt) XXX_DiscardUnknown()
func (*DirectoryEnt) XXX_Marshal ¶
func (m *DirectoryEnt) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*DirectoryEnt) XXX_Merge ¶
func (m *DirectoryEnt) XXX_Merge(src proto.Message)
func (*DirectoryEnt) XXX_Size ¶
func (m *DirectoryEnt) XXX_Size() int
func (*DirectoryEnt) XXX_Unmarshal ¶
func (m *DirectoryEnt) XXX_Unmarshal(b []byte) error
type DirectoryList ¶
type DirectoryList struct { Results []*DirectoryEnt `protobuf:"bytes,1,rep,name=Results,proto3" json:"Results,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*DirectoryList) Descriptor ¶
func (*DirectoryList) Descriptor() ([]byte, []int)
func (*DirectoryList) GetResults ¶
func (m *DirectoryList) GetResults() []*DirectoryEnt
func (*DirectoryList) ProtoMessage ¶
func (*DirectoryList) ProtoMessage()
func (*DirectoryList) Reset ¶
func (m *DirectoryList) Reset()
func (*DirectoryList) String ¶
func (m *DirectoryList) String() string
func (*DirectoryList) XXX_DiscardUnknown ¶
func (m *DirectoryList) XXX_DiscardUnknown()
func (*DirectoryList) XXX_Marshal ¶
func (m *DirectoryList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*DirectoryList) XXX_Merge ¶
func (m *DirectoryList) XXX_Merge(src proto.Message)
func (*DirectoryList) XXX_Size ¶
func (m *DirectoryList) XXX_Size() int
func (*DirectoryList) XXX_Unmarshal ¶
func (m *DirectoryList) XXX_Unmarshal(b []byte) error
type Empty ¶
type Empty struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Empty) Descriptor ¶
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
func (*Empty) XXX_DiscardUnknown ¶
func (m *Empty) XXX_DiscardUnknown()
func (*Empty) XXX_Marshal ¶
func (*Empty) XXX_Unmarshal ¶
type FileStorageClient ¶
type FileStorageClient struct {
StorageClient
}
type FileStorageServer ¶
FileStorageServer can be embedded to have forward compatible implementations.
func (*FileStorageServer) ListDirectory ¶
func (fss *FileStorageServer) ListDirectory(ctx context.Context, req *Empty) (*DirectoryList, error)
func (*FileStorageServer) ReadAt ¶
func (fss *FileStorageServer) ReadAt(ctx context.Context, req *ReadAtRequest) (*ReadChunk, error)
func (*FileStorageServer) Stat ¶
func (fss *FileStorageServer) Stat(ctx context.Context, req *StatRequest) (*StatResponse, error)
func (*FileStorageServer) WriteAll ¶
func (fss *FileStorageServer) WriteAll(srv Storage_WriteAllServer) error
type ReadAtRequest ¶
type ReadAtRequest struct { Path string `protobuf:"bytes,1,opt,name=Path,proto3" json:"Path,omitempty"` StartOffset uint64 `protobuf:"varint,2,opt,name=StartOffset,proto3" json:"StartOffset,omitempty"` Size uint64 `protobuf:"varint,3,opt,name=Size,proto3" json:"Size,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ReadAtRequest) Descriptor ¶
func (*ReadAtRequest) Descriptor() ([]byte, []int)
func (*ReadAtRequest) GetPath ¶
func (m *ReadAtRequest) GetPath() string
func (*ReadAtRequest) GetSize ¶
func (m *ReadAtRequest) GetSize() uint64
func (*ReadAtRequest) GetStartOffset ¶
func (m *ReadAtRequest) GetStartOffset() uint64
func (*ReadAtRequest) ProtoMessage ¶
func (*ReadAtRequest) ProtoMessage()
func (*ReadAtRequest) Reset ¶
func (m *ReadAtRequest) Reset()
func (*ReadAtRequest) String ¶
func (m *ReadAtRequest) String() string
func (*ReadAtRequest) XXX_DiscardUnknown ¶
func (m *ReadAtRequest) XXX_DiscardUnknown()
func (*ReadAtRequest) XXX_Marshal ¶
func (m *ReadAtRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ReadAtRequest) XXX_Merge ¶
func (m *ReadAtRequest) XXX_Merge(src proto.Message)
func (*ReadAtRequest) XXX_Size ¶
func (m *ReadAtRequest) XXX_Size() int
func (*ReadAtRequest) XXX_Unmarshal ¶
func (m *ReadAtRequest) XXX_Unmarshal(b []byte) error
type ReadChunk ¶
type ReadChunk struct { Data []byte `protobuf:"bytes,1,opt,name=Data,proto3" json:"Data,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ReadChunk) Descriptor ¶
func (*ReadChunk) ProtoMessage ¶
func (*ReadChunk) ProtoMessage()
func (*ReadChunk) XXX_DiscardUnknown ¶
func (m *ReadChunk) XXX_DiscardUnknown()
func (*ReadChunk) XXX_Marshal ¶
func (*ReadChunk) XXX_Unmarshal ¶
type StatRequest ¶
type StatRequest struct { Path string `protobuf:"bytes,1,opt,name=Path,proto3" json:"Path,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*StatRequest) Descriptor ¶
func (*StatRequest) Descriptor() ([]byte, []int)
func (*StatRequest) GetPath ¶
func (m *StatRequest) GetPath() string
func (*StatRequest) ProtoMessage ¶
func (*StatRequest) ProtoMessage()
func (*StatRequest) Reset ¶
func (m *StatRequest) Reset()
func (*StatRequest) String ¶
func (m *StatRequest) String() string
func (*StatRequest) XXX_DiscardUnknown ¶
func (m *StatRequest) XXX_DiscardUnknown()
func (*StatRequest) XXX_Marshal ¶
func (m *StatRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*StatRequest) XXX_Merge ¶
func (m *StatRequest) XXX_Merge(src proto.Message)
func (*StatRequest) XXX_Size ¶
func (m *StatRequest) XXX_Size() int
func (*StatRequest) XXX_Unmarshal ¶
func (m *StatRequest) XXX_Unmarshal(b []byte) error
type StatResponse ¶
type StatResponse struct { FileName string `protobuf:"bytes,1,opt,name=FileName,proto3" json:"FileName,omitempty"` FileSize int64 `protobuf:"varint,2,opt,name=FileSize,proto3" json:"FileSize,omitempty"` FileMode uint32 `protobuf:"varint,3,opt,name=FileMode,proto3" json:"FileMode,omitempty"` FileModTime *timestamp.Timestamp `protobuf:"bytes,4,opt,name=FileModTime,proto3" json:"FileModTime,omitempty"` FileIsDirectory bool `protobuf:"varint,5,opt,name=FileIsDirectory,proto3" json:"FileIsDirectory,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*StatResponse) Descriptor ¶
func (*StatResponse) Descriptor() ([]byte, []int)
func (*StatResponse) GetFileIsDirectory ¶
func (m *StatResponse) GetFileIsDirectory() bool
func (*StatResponse) GetFileModTime ¶
func (m *StatResponse) GetFileModTime() *timestamp.Timestamp
func (*StatResponse) GetFileMode ¶
func (m *StatResponse) GetFileMode() uint32
func (*StatResponse) GetFileName ¶
func (m *StatResponse) GetFileName() string
func (*StatResponse) GetFileSize ¶
func (m *StatResponse) GetFileSize() int64
func (*StatResponse) IsDir ¶
func (s *StatResponse) IsDir() bool
func (*StatResponse) ModTime ¶
func (s *StatResponse) ModTime() time.Time
func (*StatResponse) Mode ¶
func (s *StatResponse) Mode() os.FileMode
func (*StatResponse) Name ¶
func (s *StatResponse) Name() string
func (*StatResponse) ProtoMessage ¶
func (*StatResponse) ProtoMessage()
func (*StatResponse) Reset ¶
func (m *StatResponse) Reset()
func (*StatResponse) Size ¶
func (s *StatResponse) Size() int64
func (*StatResponse) String ¶
func (m *StatResponse) String() string
func (*StatResponse) Sys ¶
func (s *StatResponse) Sys() interface{}
func (*StatResponse) XXX_DiscardUnknown ¶
func (m *StatResponse) XXX_DiscardUnknown()
func (*StatResponse) XXX_Marshal ¶
func (m *StatResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*StatResponse) XXX_Merge ¶
func (m *StatResponse) XXX_Merge(src proto.Message)
func (*StatResponse) XXX_Size ¶
func (m *StatResponse) XXX_Size() int
func (*StatResponse) XXX_Unmarshal ¶
func (m *StatResponse) XXX_Unmarshal(b []byte) error
type StorageClient ¶
type StorageClient interface { Stat(ctx context.Context, in *StatRequest, opts ...grpc.CallOption) (*StatResponse, error) WriteAll(ctx context.Context, opts ...grpc.CallOption) (Storage_WriteAllClient, error) ReadAt(ctx context.Context, in *ReadAtRequest, opts ...grpc.CallOption) (*ReadChunk, error) ListDirectory(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*DirectoryList, 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 { Stat(context.Context, *StatRequest) (*StatResponse, error) WriteAll(Storage_WriteAllServer) error ReadAt(context.Context, *ReadAtRequest) (*ReadChunk, error) ListDirectory(context.Context, *Empty) (*DirectoryList, error) }
StorageServer is the server API for Storage service.
type Storage_WriteAllClient ¶
type Storage_WriteAllClient interface { Send(*WritePiece) error CloseAndRecv() (*Empty, error) grpc.ClientStream }
type Storage_WriteAllServer ¶
type Storage_WriteAllServer interface { SendAndClose(*Empty) error Recv() (*WritePiece, error) grpc.ServerStream }
type UnimplementedStorageServer ¶
type UnimplementedStorageServer struct { }
UnimplementedStorageServer can be embedded to have forward compatible implementations.
func (*UnimplementedStorageServer) ListDirectory ¶
func (*UnimplementedStorageServer) ListDirectory(ctx context.Context, req *Empty) (*DirectoryList, error)
func (*UnimplementedStorageServer) ReadAt ¶
func (*UnimplementedStorageServer) ReadAt(ctx context.Context, req *ReadAtRequest) (*ReadChunk, error)
func (*UnimplementedStorageServer) Stat ¶
func (*UnimplementedStorageServer) Stat(ctx context.Context, req *StatRequest) (*StatResponse, error)
func (*UnimplementedStorageServer) WriteAll ¶
func (*UnimplementedStorageServer) WriteAll(srv Storage_WriteAllServer) error
type WritePiece ¶
type WritePiece struct { // Types that are valid to be assigned to PieceContent: // *WritePiece_FileName // *WritePiece_Data PieceContent isWritePiece_PieceContent `protobuf_oneof:"PieceContent"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*WritePiece) Descriptor ¶
func (*WritePiece) Descriptor() ([]byte, []int)
func (*WritePiece) GetData ¶
func (m *WritePiece) GetData() []byte
func (*WritePiece) GetFileName ¶
func (m *WritePiece) GetFileName() string
func (*WritePiece) GetPieceContent ¶
func (m *WritePiece) GetPieceContent() isWritePiece_PieceContent
func (*WritePiece) ProtoMessage ¶
func (*WritePiece) ProtoMessage()
func (*WritePiece) Reset ¶
func (m *WritePiece) Reset()
func (*WritePiece) String ¶
func (m *WritePiece) String() string
func (*WritePiece) XXX_DiscardUnknown ¶
func (m *WritePiece) XXX_DiscardUnknown()
func (*WritePiece) XXX_Marshal ¶
func (m *WritePiece) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*WritePiece) XXX_Merge ¶
func (m *WritePiece) XXX_Merge(src proto.Message)
func (*WritePiece) XXX_OneofWrappers ¶
func (*WritePiece) XXX_OneofWrappers() []interface{}
XXX_OneofWrappers is for the internal use of the proto package.
func (*WritePiece) XXX_Size ¶
func (m *WritePiece) XXX_Size() int
func (*WritePiece) XXX_Unmarshal ¶
func (m *WritePiece) XXX_Unmarshal(b []byte) error
type WritePiece_Data ¶
type WritePiece_Data struct {
Data []byte `protobuf:"bytes,2,opt,name=Data,proto3,oneof"`
}
type WritePiece_FileName ¶
type WritePiece_FileName struct {
FileName string `protobuf:"bytes,1,opt,name=FileName,proto3,oneof"`
}
Click to show internal directories.
Click to hide internal directories.