Documentation ¶
Index ¶
- func SplitVolumeID(id string) (uint64, needle.Id, error)
- type FilePool
- type NumberFile
- type Option
- type Server
- func (s *Server) Close() error
- func (s *Server) CreateVolume() (*Volume, error)
- func (s *Server) DeleteChunk(ctx context.Context, in *volume_pb.ChunkID) (*emptypb.Empty, error)
- func (s *Server) GetChunk(in *volume_pb.ChunkID, stream volume_pb.VolumeService_GetChunkServer) error
- func (s *Server) PutChunk(stream volume_pb.VolumeService_PutChunkServer) error
- func (s *Server) Run(port int) error
- func (s *Server) SendHeartbeat()
- type Volume
- func (v *Volume) Close() error
- func (v *Volume) Delete(id needle.Id) error
- func (v *Volume) Magic() []byte
- func (v *Volume) Read(id needle.Id, writer io.Writer) error
- func (v *Volume) Size() uint64
- func (v *Volume) Write(reader io.Reader) (string, error)
- func (v *Volume) WriteMagic(magic []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FilePool ¶
type FilePool struct {
// contains filtered or unexported fields
}
func NewFilePool ¶
type NumberFile ¶
type NumberFile struct { Path string // contains filtered or unexported fields }
func NewNumberFile ¶
func NewNumberFile(path string) *NumberFile
func (*NumberFile) ReadNumber ¶
func (nf *NumberFile) ReadNumber() (uint64, error)
func (*NumberFile) WriteNumber ¶
func (nf *NumberFile) WriteNumber(num uint64) error
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithLocalIP ¶
type Server ¶
type Server struct { volume_pb.UnimplementedVolumeServiceServer // contains filtered or unexported fields }
func (*Server) CreateVolume ¶
func (*Server) DeleteChunk ¶
func (*Server) PutChunk ¶
func (s *Server) PutChunk(stream volume_pb.VolumeService_PutChunkServer) error
func (*Server) SendHeartbeat ¶
func (s *Server) SendHeartbeat()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.