Home Download Docs Code Community
import "perkeep/pkg/blobserver/stats"
Overview
Index

Overview ▾

Package stats contains an in-memory StatReceiver that only stores sizes of received blobs but not their contents.

Index

type Receiver
    func (sr *Receiver) EnumerateBlobs(ctx context.Context, dest chan<- blob.SizedRef, after string, limit int) error
    func (sr *Receiver) NumBlobs() int
    func (sr *Receiver) ReceiveBlob(ctx context.Context, br blob.Ref, source io.Reader) (sb blob.SizedRef, err error)
    func (sr *Receiver) ReceiveRef(br blob.Ref, size int64) (sb blob.SizedRef, err error)
    func (sr *Receiver) RemoveBlobs(ctx context.Context, blobs []blob.Ref) error
    func (sr *Receiver) Sizes() []int
    func (sr *Receiver) StatBlobs(ctx context.Context, blobs []blob.Ref, fn func(blob.SizedRef) error) error
    func (sr *Receiver) SumBlobSize() int64

Package files

statreceiver.go

type Receiver

type Receiver struct {
    sync.Mutex // guards Have
    Have       map[blob.Ref]int64
}

Receiver is a dummy blobserver.StatReceiver that doesn't store anything; it just collects statistics.

TODO: we have another copy of this same type in pk-put/files.go. move them to a common place? well, the pk-put one is probably going away at some point.

func (*Receiver) EnumerateBlobs

func (sr *Receiver) EnumerateBlobs(ctx context.Context, dest chan<- blob.SizedRef, after string, limit int) error

func (*Receiver) NumBlobs

func (sr *Receiver) NumBlobs() int

func (*Receiver) ReceiveBlob

func (sr *Receiver) ReceiveBlob(ctx context.Context, br blob.Ref, source io.Reader) (sb blob.SizedRef, err error)

func (*Receiver) ReceiveRef

func (sr *Receiver) ReceiveRef(br blob.Ref, size int64) (sb blob.SizedRef, err error)

func (*Receiver) RemoveBlobs

func (sr *Receiver) RemoveBlobs(ctx context.Context, blobs []blob.Ref) error

func (*Receiver) Sizes

func (sr *Receiver) Sizes() []int

Sizes returns the sorted blob sizes.

func (*Receiver) StatBlobs

func (sr *Receiver) StatBlobs(ctx context.Context, blobs []blob.Ref, fn func(blob.SizedRef) error) error

func (*Receiver) SumBlobSize

func (sr *Receiver) SumBlobSize() int64
Website layout inspired by memcached.
Content by the authors.