api

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2017 License: MIT Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BcastGetReply

type BcastGetReply struct {
	FromID string
	Ki     *KeyInv
	Err    string
}

func (*BcastGetReply) DecodeMsg

func (z *BcastGetReply) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*BcastGetReply) EncodeMsg

func (z *BcastGetReply) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*BcastGetReply) MarshalMsg

func (z *BcastGetReply) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*BcastGetReply) Msgsize

func (z *BcastGetReply) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*BcastGetReply) UnmarshalMsg

func (z *BcastGetReply) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type BcastGetRequest

type BcastGetRequest struct {
	FromID string

	// Key specifies the key to query and return the value of.
	Key []byte

	// Who should be left empty to get all replies.
	// Otherwise only the peer whose name matches will reply.
	Who string

	// IncludeValue when false returns the timestamp and size without
	// the whole (big) value.
	IncludeValue bool

	ReplyGrpcHost  string
	ReplyGrpcXPort int
	ReplyGrpcIPort int
}

func (*BcastGetRequest) DecodeMsg

func (z *BcastGetRequest) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*BcastGetRequest) EncodeMsg

func (z *BcastGetRequest) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*BcastGetRequest) MarshalMsg

func (z *BcastGetRequest) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*BcastGetRequest) Msgsize

func (z *BcastGetRequest) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*BcastGetRequest) UnmarshalMsg

func (z *BcastGetRequest) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type BcastSetReply

type BcastSetReply struct {
	Err string
}

func (*BcastSetReply) DecodeMsg

func (z *BcastSetReply) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (BcastSetReply) EncodeMsg

func (z BcastSetReply) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (BcastSetReply) MarshalMsg

func (z BcastSetReply) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (BcastSetReply) Msgsize

func (z BcastSetReply) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*BcastSetReply) UnmarshalMsg

func (z *BcastSetReply) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type BcastSetRequest

type BcastSetRequest struct {
	FromID string
	Ki     *KeyInv
}

func (*BcastSetRequest) DecodeMsg

func (z *BcastSetRequest) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*BcastSetRequest) EncodeMsg

func (z *BcastSetRequest) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*BcastSetRequest) MarshalMsg

func (z *BcastSetRequest) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*BcastSetRequest) Msgsize

func (z *BcastSetRequest) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*BcastSetRequest) UnmarshalMsg

func (z *BcastSetRequest) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type KeyInv

type KeyInv struct {
	Key     []byte
	Who     string
	When    time.Time
	Size    int64
	Blake2b []byte
	Val     []byte
}

KeyInv supplies the keys and their peer location (Who) and their timestamps (When) while optionally (but not necessarily) providing their data Val.

The includeValue flag in the calls below determines if we return the Val on Get calls. Val must always be provided on Set.

func (*KeyInv) DecodeMsg

func (z *KeyInv) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*KeyInv) EncodeMsg

func (z *KeyInv) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*KeyInv) MarshalMsg

func (z *KeyInv) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*KeyInv) Msgsize

func (z *KeyInv) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*KeyInv) String

func (ki *KeyInv) String() string

func (*KeyInv) UnmarshalMsg

func (z *KeyInv) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type LocalGetSet

type LocalGetSet interface {
	LocalGet(key []byte, includeValue bool) (ki *KeyInv, err error)
	LocalSet(ki *KeyInv) error
}

type Peerface

type Peerface interface {
	LocalGetSet
	BcastGet(key []byte, includeValue bool, timeout time.Duration, who string) (kis []*KeyInv, err error)
	GetLatest(key []byte, includeValue bool) (ki *KeyInv, err error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL