Documentation ¶
Index ¶
- func ReadMetadata(primaryFile, secondaryFile fs.File, metadata *Metadata) (err error)
- func WriteMetadata(primaryFile, secondaryFile fs.File, metadata *Metadata) error
- type Config
- type FreeBlockList
- type Metadata
- type Server
- func (srv *Server) Close() error
- func (srv *Server) Get(ctx context.Context, in *proto.GetRequest) (out *proto.GetReply, err error)
- func (srv *Server) Open() (err error)
- func (srv *Server) Put(ctx context.Context, in *proto.PutRequest) (out *proto.PutReply, err error)
- func (srv *Server) Remove(ctx context.Context, in *proto.RemoveRequest) (out *proto.RemoveReply, err error)
- func (srv *Server) Stat(ctx context.Context, in *proto.StatRequest) (out *proto.StatReply, err error)
- func (srv *Server) Walk(in *proto.WalkRequest, stream proto.CAS_WalkServer) (err error)
- type UsedBlock
- type UsedBlockList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadMetadata ¶
Types ¶
type FreeBlockList ¶
type FreeBlockList []uint32
func (FreeBlockList) Len ¶
func (x FreeBlockList) Len() int
func (FreeBlockList) Less ¶
func (x FreeBlockList) Less(i, j int) bool
func (FreeBlockList) Swap ¶
func (x FreeBlockList) Swap(i, j int)
type Metadata ¶
type Metadata struct { Mutex sync.RWMutex MinUnused uint32 Used UsedBlockList Free FreeBlockList BackupData []byte }
type Server ¶
type Server struct { Mutex sync.Mutex Metadata Metadata BlocksTotal uint32 ACL auth.ACL Auther auth.Auther FS fs.FileSystem MetadataFile fs.File BackupFile fs.File DataFile fs.BlockFile }
func (*Server) Remove ¶
func (srv *Server) Remove(ctx context.Context, in *proto.RemoveRequest) (out *proto.RemoveReply, err error)
func (*Server) Walk ¶
func (srv *Server) Walk(in *proto.WalkRequest, stream proto.CAS_WalkServer) (err error)
type UsedBlockList ¶
type UsedBlockList []UsedBlock
func (UsedBlockList) Len ¶
func (x UsedBlockList) Len() int
func (UsedBlockList) Less ¶
func (x UsedBlockList) Less(i, j int) bool
func (UsedBlockList) Swap ¶
func (x UsedBlockList) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.