panda: github.com/katzenpost/panda/server Index | Files

package server

import "github.com/katzenpost/panda/server"

Index

Package Files

panda.go storage.go

Constants

const (
    // PandaStorageVersion is the version of our on disk format.
    PandaStorageVersion = 0
)

Variables

var ErrNoSURBRequest = errors.New("Request received without SURB")

ErrNoSURBRequest is the error returned when no SURB accompanies a query.

type Panda Uses

type Panda struct {
    // contains filtered or unexported fields
}

Panda is the PANDA server type.

func New Uses

func New(log *logging.Logger, fileStore string, dwellDuration time.Duration, writeBackInterval time.Duration) (*Panda, error)

New constructs a new Panda server instance

func (*Panda) OnRequest Uses

func (k *Panda) OnRequest(id uint64, payload []byte, hasSURB bool) ([]byte, error)

OnRequest services a client request and returns the reply.

type PandaPosting Uses

type PandaPosting struct {
    sync.Mutex

    Dirty    bool
    UnixTime int64
    A, B     []byte
}

PandaPosting is the data structure stored on Panda server with each client interaction.

func (*PandaPosting) Expired Uses

func (p *PandaPosting) Expired(expiration time.Duration) bool

Expired returns true if the posting is older than the specified expiration duration.

type PandaStorage Uses

type PandaStorage struct {
    worker.Worker
    // contains filtered or unexported fields
}

PandaStorage handles the on disk persistence for the PANDA server.

func NewPandaStorage Uses

func NewPandaStorage(fileStore string, dwellDuration time.Duration, writeBackInterval time.Duration) (*PandaStorage, error)

NewPandaStorage creates an in memory store for Panda postings

func (*PandaStorage) Get Uses

func (s *PandaStorage) Get(tag *[common.PandaTagLength]byte) (*PandaPosting, error)

Get returns a posting from the data store that is referenced by the given tag.

func (*PandaStorage) Put Uses

func (s *PandaStorage) Put(tag *[common.PandaTagLength]byte, posting *PandaPosting) error

Put stores a posting in the data store such that it is referenced by the given tag.

func (*PandaStorage) Replace Uses

func (s *PandaStorage) Replace(tag *[common.PandaTagLength]byte, posting *PandaPosting) error

Replace replaces the stored posting.

func (*PandaStorage) Shutdown Uses

func (s *PandaStorage) Shutdown()

Shutdown stops the worker thread and sync the db.

func (*PandaStorage) Vacuum Uses

func (s *PandaStorage) Vacuum() error

Vacuum removes the postings that have expired.

Package server imports 13 packages (graph). Updated 2019-09-16. Refresh now. Tools for package owners.