Documentation ¶
Index ¶
- Constants
- Variables
- func Copy(dst io.Writer, src io.Reader) (written int64, err error)
- func NewPackedUnpacker(root string) (*packedUnpacker, error)
- func OssRemoveFiles(ctx context.Context, b oss.Bucket, rid int64) error
- type CacheDB
- type DB
- type LargeObject
- type MetadataDB
- func (d *MetadataDB) BatchEncodeCommit(ctx context.Context, commits []*object.Commit) error
- func (d *MetadataDB) BatchEncodeFragments(ctx context.Context, fss []*object.Fragments) error
- func (d *MetadataDB) BatchEncodeTags(ctx context.Context, tags []*object.Tag) error
- func (d *MetadataDB) BatchEncodeTree(ctx context.Context, trees []*object.Tree) error
- func (d *MetadataDB) DecodeCommit(ctx context.Context, oid plumbing.Hash, b object.Backend) (*object.Commit, error)
- func (d *MetadataDB) DecodeTree(ctx context.Context, oid plumbing.Hash, b object.Backend) (*object.Tree, error)
- func (d *MetadataDB) Encode(ctx context.Context, oid plumbing.Hash, e object.Encoder) error
- func (d *MetadataDB) EncodeCommit(ctx context.Context, cc *object.Commit) error
- func (d *MetadataDB) EncodeTree(ctx context.Context, t *object.Tree) error
- func (d *MetadataDB) Fragments(ctx context.Context, oid plumbing.Hash, b object.Backend) (*object.Fragments, error)
- func (d *MetadataDB) Object(ctx context.Context, oid plumbing.Hash, b object.Backend) (any, error)
- func (d *MetadataDB) Tag(ctx context.Context, oid plumbing.Hash, b object.Backend) (*object.Tag, error)
- type ODB
- func (o *ODB) Batch(ctx context.Context, oids []plumbing.Hash, batchLimit int) error
- func (o *ODB) BatchCommits(ctx context.Context, oids []plumbing.Hash) error
- func (o *ODB) BatchObjects(ctx context.Context, oids []plumbing.Hash) error
- func (o *ODB) BatchTrees(ctx context.Context, oids []plumbing.Hash) error
- func (o *ODB) Blob(ctx context.Context, oid plumbing.Hash) (b *object.Blob, err error)
- func (o *ODB) Close() error
- func (o *ODB) Commit(ctx context.Context, oid plumbing.Hash) (cc *object.Commit, err error)
- func (o *ODB) Encode(ctx context.Context, e object.Encoder) (oid plumbing.Hash, err error)
- func (o *ODB) EncodeFast(ctx context.Context, e object.Encoder) (oid plumbing.Hash, err error)
- func (o *ODB) Fragments(ctx context.Context, oid plumbing.Hash) (*object.Fragments, error)
- func (o *ODB) HashFast(ctx context.Context, r io.Reader, size int64) (oid plumbing.Hash, err error)
- func (o *ODB) HashTo(ctx context.Context, r io.Reader, size int64) (oid plumbing.Hash, err error)
- func (o *ODB) IsBinaryFast(ctx context.Context, oid plumbing.Hash) (bool, error)
- func (o *ODB) NewUnpacker(entries uint32, metadata bool) (*backend.Unpacker, error)
- func (o *ODB) Objects(ctx context.Context, oid plumbing.Hash) (a any, err error)
- func (o *ODB) Open(ctx context.Context, oid plumbing.Hash, start int64) (sr backend.SizeReader, err error)
- func (o *ODB) ParseRev(ctx context.Context, oid plumbing.Hash) (a any, err error)
- func (o *ODB) ParseRevExhaustive(ctx context.Context, oid plumbing.Hash) (*object.Commit, error)
- func (o *ODB) Push(ctx context.Context, oid plumbing.Hash) error
- func (o *ODB) Reload() error
- func (o *ODB) Sharing(ctx context.Context, oid plumbing.Hash, expiresAt int64) (*Representation, error)
- func (o *ODB) Stat(ctx context.Context, oid plumbing.Hash) (*oss.Stat, error)
- func (o *ODB) Tag(ctx context.Context, oid plumbing.Hash) (*object.Tag, error)
- func (o *ODB) Tree(ctx context.Context, oid plumbing.Hash) (t *object.Tree, err error)
- func (o *ODB) Unpack(ctx context.Context, r io.Reader, ss *OStats, validator Validator) (*Objects, error)
- func (o *ODB) WriteDirect(ctx context.Context, oid plumbing.Hash, r io.Reader, size int64) (int64, error)
- type OStats
- type Objects
- type QuarantineDB
- func (q *QuarantineDB) Close() error
- func (q *QuarantineDB) Commit(ctx context.Context, oid plumbing.Hash) (cc *object.Commit, err error)
- func (q *QuarantineDB) Exists(ctx context.Context, oid plumbing.Hash, meta bool) error
- func (q *QuarantineDB) Fragments(ctx context.Context, oid plumbing.Hash) (ff *object.Fragments, err error)
- func (q *QuarantineDB) ParseRev(ctx context.Context, oid plumbing.Hash) (cc *object.Commit, isolated bool, err error)
- func (q *QuarantineDB) Tag(ctx context.Context, oid plumbing.Hash) (tag *object.Tag, err error)
- func (q *QuarantineDB) Tree(ctx context.Context, oid plumbing.Hash) (t *object.Tree, err error)
- type Representation
- type StatObjectsResult
- type Unpacker
- type Unpackers
- type Validator
Constants ¶
View Source
const (
LargeSize = 5 << 20 // 5M
)
View Source
const (
MiByte int64 = 1048576
)
Variables ¶
View Source
var (
ErrUncacheableObject = errors.New("uncacheable object")
)
Functions ¶
func NewPackedUnpacker ¶
root: /home/zeta/repositories/001/10001.zeta/incoming/quarantine-1111/metadata
Types ¶
type CacheDB ¶
type CacheDB interface { Object(ctx context.Context, rid int64, oid plumbing.Hash) (any, error) Commit(ctx context.Context, rid int64, oid plumbing.Hash) (*object.Commit, error) Tree(ctx context.Context, rid int64, oid plumbing.Hash) (*object.Tree, error) Fragments(ctx context.Context, rid int64, oid plumbing.Hash) (*object.Fragments, error) Tag(ctx context.Context, rid int64, oid plumbing.Hash) (*object.Tag, error) Store(ctx context.Context, rid int64, a any) error Mark(rid int64, oid plumbing.Hash) Exist(rid int64, oid plumbing.Hash) bool }
type DB ¶
type DB interface { Commit(ctx context.Context, oid plumbing.Hash) (cc *object.Commit, err error) Tree(ctx context.Context, oid plumbing.Hash) (t *object.Tree, err error) Fragments(ctx context.Context, oid plumbing.Hash) (*object.Fragments, error) Tag(ctx context.Context, oid plumbing.Hash) (*object.Tag, error) Objects(ctx context.Context, oid plumbing.Hash) (a any, err error) Open(ctx context.Context, oid plumbing.Hash, start int64) (sr backend.SizeReader, err error) Blob(ctx context.Context, oid plumbing.Hash) (b *object.Blob, err error) Push(ctx context.Context, oid plumbing.Hash) error // Push object to OSS WriteDirect(ctx context.Context, oid plumbing.Hash, r io.Reader, size int64) (int64, error) Stat(ctx context.Context, oid plumbing.Hash) (*oss.Stat, error) Sharing(ctx context.Context, oid plumbing.Hash, expiresAt int64) (*Representation, error) }
type LargeObject ¶
type MetadataDB ¶
func NewMetadataDB ¶
func NewMetadataDB(db *sql.DB, rid int64) *MetadataDB
func (*MetadataDB) BatchEncodeCommit ¶
BatchEncodeCommit: batch encode commit to DB
func (*MetadataDB) BatchEncodeFragments ¶
func (*MetadataDB) BatchEncodeTags ¶
func (*MetadataDB) BatchEncodeTree ¶
func (*MetadataDB) DecodeCommit ¶
func (*MetadataDB) DecodeTree ¶
func (*MetadataDB) EncodeCommit ¶
EncodeCommit: encode commit to DB
func (*MetadataDB) EncodeTree ¶
type ODB ¶
type ODB struct {
// contains filtered or unexported fields
}
func (*ODB) BatchCommits ¶
func (*ODB) BatchObjects ¶
func (*ODB) EncodeFast ¶
EncodeFast: Store the object and update the Hash value of the object
func (*ODB) IsBinaryFast ¶
func (*ODB) NewUnpacker ¶
func (*ODB) ParseRevExhaustive ¶
type QuarantineDB ¶
type QuarantineDB struct {
// contains filtered or unexported fields
}
func NewQuarantineDB ¶
func NewQuarantineDB(o *ODB, quarantineDir string) (*QuarantineDB, error)
func (*QuarantineDB) Close ¶
func (q *QuarantineDB) Close() error
type Representation ¶
type StatObjectsResult ¶
type StatObjectsResult struct { Larges []*LargeObject `json:"larges,omitempty"` Objects int `json:"count"` Size int64 `json:"size"` }
func StatObjects ¶
Click to show internal directories.
Click to hide internal directories.