memspool: Index | Files

package server

import ""


Package Files



const (
    SpoolStorageVersion = 0

func HandleSpoolRequest Uses

func HandleSpoolRequest(spoolMap *MemSpoolMap, request *common.SpoolRequest, log *logging.Logger) *common.SpoolResponse

type MemSpool Uses

type MemSpool struct {
    // contains filtered or unexported fields

func NewMemSpool Uses

func NewMemSpool(publicKey *eddsa.PublicKey) *MemSpool

func (*MemSpool) Append Uses

func (s *MemSpool) Append(message []byte)

func (*MemSpool) Get Uses

func (s *MemSpool) Get(messageID uint32) ([]byte, bool, error)

Get returns a message payload from the spool given a valid message ID. Second return value is the Dirty bool which is set to true if the message has not been written to disk. If returning an error then the Dirty return value is false.

func (*MemSpool) PublicKey Uses

func (s *MemSpool) PublicKey() *eddsa.PublicKey

func (*MemSpool) Put Uses

func (s *MemSpool) Put(messageID uint32, message []byte, dirty bool)

type MemSpoolMap Uses

type MemSpoolMap struct {
    // contains filtered or unexported fields

func NewMemSpoolMap Uses

func NewMemSpoolMap(fileStore string, log *logging.Logger) (*MemSpoolMap, error)

func (*MemSpoolMap) AppendToSpool Uses

func (m *MemSpoolMap) AppendToSpool(spoolID [common.SpoolIDSize]byte, message []byte) error

func (*MemSpoolMap) CreateSpool Uses

func (m *MemSpoolMap) CreateSpool(publicKey *eddsa.PublicKey, signature []byte) (*[common.SpoolIDSize]byte, error)

CreateSpool creates a new spool and returns a spool ID or an error.

func (*MemSpoolMap) PurgeSpool Uses

func (m *MemSpoolMap) PurgeSpool(spoolID [common.SpoolIDSize]byte, signature []byte) error

PurgeSpool delete the spool associated with the given spool ID. Returns nil on success or an error.

func (*MemSpoolMap) ReadFromSpool Uses

func (m *MemSpoolMap) ReadFromSpool(spoolID [common.SpoolIDSize]byte, signature []byte, messageID uint32) ([]byte, error)

func (*MemSpoolMap) Shutdown Uses

func (m *MemSpoolMap) Shutdown()

type SpoolEntry Uses

type SpoolEntry struct {
    Payload []byte
    Dirty   bool

Package server imports 12 packages (graph). Updated 2019-12-14. Refresh now. Tools for package owners.