Versions in this module Expand all Collapse all v1 v1.4.1 Feb 27, 2023 Changes in this version + const CHUNK_AVAILABLE + const CHUNK_DELETED + const CHUNK_INCOMPLETE + const CHUNK_RECOVERING + const CHUNK_TOBEBUFFERED + const OP_COMMIT + const OP_DEL + const OP_GET + const OP_MIGRATION + const OP_RECOVER + const OP_RECOVERY + const OP_SET + const OP_WARMUP + var AWSRegion = os.Getenv("AWS_REGION") + var AWSServiceTimeout = 10000 * time.Millisecond + var DownloadConcurrency = 10 + var ErrDeleted = errors.New("key deleted") + var ErrIncomplete = errors.New("key incomplete") + var ErrNotFound = errors.New("key not found") + var ErrProxyClosing = errors.New("proxy closed") + var UploadConcurrency = 5 + func AWSSession() *awsSession.Session + type CalibratePriority int + type Chunk struct + Accessed time.Time + Available uint64 + Backup bool + Body []byte + Bucket string + BuffIdx int + Id string + Key string + Note string + Notifier sync.WaitGroup + Size uint64 + Status uint32 + Term uint64 + func NewChunk(key string, id string, body []byte) *Chunk + func (c *Chunk) Access() []byte + func (c *Chunk) AddRecovered(bytes uint64) bool + func (c *Chunk) Delete(reason string) + func (c *Chunk) EndRecover(status uint32) + func (c *Chunk) IsAvailable() bool + func (c *Chunk) IsBuffered(includeTBD bool) bool + func (c *Chunk) IsDeleted() bool + func (c *Chunk) IsIncomplete() bool + func (c *Chunk) IsRecovering() bool + func (c *Chunk) NotifyRecovered() + func (c *Chunk) Op() uint32 + func (c *Chunk) PrepareRecover() bool + func (c *Chunk) StartRecover() + func (c *Chunk) WaitRecovered() + type CommitOption struct + BytesUploaded uint64 + Checked bool + Full bool + Snapshotted bool + StorageSignalFlags uint32 + func (opts *CommitOption) Flags() uint32 + type Lineage interface + ClearBackup func() + Commit func() (*CommitOption, error) + IsConsistent func(*LineageMeta) (bool, error) + Recover func(*LineageMeta) (bool, <-chan error) + Status func(bool) (confirmed uint64, status LineageStatus) + Validate func(*LineageMeta) (LineageValidationResult, error) + type LineageMeta struct + BackupId int + BackupTotal int + Consistent bool + MaxChunkSize uint64 + Tips url.Values + Type LineageMetaType + func LineageMetaFromProtocol(meta *protocol.Meta) (lm *LineageMeta, err error) + func (meta *LineageMeta) ServingKey() string + type LineageMetaType int + const LineageMetaTypeBackup + const LineageMetaTypeDelegate + const LineageMetaTypeMain + func (t LineageMetaType) String() string + type LineageOp struct + Accessed time.Time + BIdx int + Bucket string + Id string + Key string + Op uint32 + Size uint64 + type LineageStatus []*protocol.Meta + func (s LineageStatus) ProtocolStatus() protocol.Status + func (s LineageStatus) ShortStatus() *protocol.ShortMeta + type LineageTerm struct + Buffered int + DiffRank float64 + Hash string + Ops []LineageOp + RawOps []byte + Size uint64 + Term uint64 + Updates uint64 + func LineageTermFromMeta(meta *LineageMeta) *LineageTerm + type LineageValidationResult int + const LineageValidationConsistent + const LineageValidationConsistentWithHistoryTerm + const LineageValidationInconsistent + func LineageValidationResultFromConsistent(consistent bool) LineageValidationResult + func (ret LineageValidationResult) IsConsistent() bool + type Loggable interface + ConfigLogger func(int, bool) + type OpRet struct + func OpDelayedSuccess() *OpRet + func OpError(err error) *OpRet + func OpErrorWithMessage(err error, msg string) *OpRet + func OpSuccess() *OpRet + func (ret *OpRet) Done(err ...error) + func (ret *OpRet) Error() error + func (ret *OpRet) IsDelayed() bool + func (ret *OpRet) IsDone() bool + func (ret *OpRet) Message() string + func (ret *OpRet) Wait() error + type OpWrapper struct + Accessed bool + Body []byte + Chunk *Chunk + OpIdx int + Persisted bool + Sized bool + type PersistentStorage interface + ConfigS3 func(string, string) + SetRecovery func(string, string, uint64, int) *OpRet + StartTracker func() + StopTracker func() error + type ServerStats interface + RTT func() time.Duration + type Storage interface + Del func(string, string) *OpRet + Get func(string) (string, []byte, *OpRet) + GetStream func(string) (string, resp.AllReadCloser, *OpRet) + Id func() uint64 + Keys func() <-chan string + Len func() int + Meta func() StorageMeta + Set func(string, string, []byte) *OpRet + SetStream func(string, string, resp.AllReadCloser) *OpRet + type StorageMeta interface + Calibrate func() + Capacity func() uint64 + Effective func() uint64 + Reserved func() uint64 + Size func() uint64 + System func() uint64 + Waterline func() uint64