Documentation ¶
Index ¶
- Constants
- func IdToByets(n *pb.NeedlePb) []byte
- func LevelDbCrc32Key(n *pb.NeedlePb) (crcBytes []byte)
- func NewNeedle(needleId int64, stackId uint8, file *multipart.FileHeader) (needle *pb.NeedlePb, err error)
- type ByteSize
- type Haystack
- type Store
- func (s *Store) Close()
- func (s *Store) DeleteFile(id int)
- func (s *Store) GetAllFile()
- func (s *Store) GetDataDirPath() string
- func (s *Store) GetFile(id []byte) (n *pb.NeedlePb, err error)
- func (s *Store) GetOneFile(id int) []byte
- func (s *Store) PutFile(file *multipart.FileHeader) (*pb.NeedlePb, error)
- func (s *Store) ReadRpc(in *pb.NeedlePb) error
- func (s *Store) StatusRpc(in *pb.NeedlePb) error
- func (s *Store) WriteRpc(in *pb.NeedlePb) error
Constants ¶
View Source
const (
NeedlePaddingSize int64 = 8
)
View Source
const StackMaxSize = 32 * GB
Variables ¶
This section is empty.
Functions ¶
func LevelDbCrc32Key ¶
Types ¶
type Haystack ¶
func (*Haystack) ReadFileBytes ¶
*
----------------------------- |-headerCrc32 8 bytes first 4 byes is crc32Uint 5th byte is pad-length, 6th 7th 8th bytes are reserved |-magicHeader 8 bytes needle-| |-FileBytes + padding bytes 8 * n bytes |-magicFooter 8 bytes -----------------------------
func (*Haystack) WriteFileHeader ¶
type Store ¶
type Store struct { IpPort string Stacks []*Haystack StackCount int StackMaxSize ByteSize DB *leveldb.DB // contains filtered or unexported fields }
func (*Store) DeleteFile ¶
func (*Store) GetAllFile ¶
func (s *Store) GetAllFile()
func (*Store) GetDataDirPath ¶
func (*Store) GetOneFile ¶
Click to show internal directories.
Click to hide internal directories.