Versions in this module Expand all Collapse all v0 v0.3.7 Oct 11, 2018 Changes in this version + const ErrCnt + const ErrCorruptData + const ErrDataOverflow + const ErrIO + const ErrInit + const ErrInvalidSignature + const ErrInvalidValue + const ErrNotFound + const ErrNotSynced + const ErrNothingToReturn + const ErrPeriodDepth + const ErrUnauthorized + const MaxUpdateDataLength + const ProtocolVersion + const TopicLength + var ErrTopicTooLong = fmt.Errorf("Topic is too long. Max length is %d", TopicLength) + var TimestampProvider timestampProvider = NewDefaultTimestampProvider() + func Hex(bin binarySerializer) string + func NewError(code int, s string) error + func NewErrorf(code int, format string, args ...interface{}) error + type DefaultTimestampProvider struct + func NewDefaultTimestampProvider() *DefaultTimestampProvider + func (dtp *DefaultTimestampProvider) Now() Timestamp + type Error struct + func (e *Error) Code() int + func (e *Error) Error() string + type Feed struct + Topic Topic + User common.Address + func (f *Feed) AppendValues(values Values) + func (f *Feed) FromValues(values Values) (err error) + func (f *Feed) Hex() string + type GenericSigner struct + PrivKey *ecdsa.PrivateKey + func NewGenericSigner(privKey *ecdsa.PrivateKey) *GenericSigner + func (s *GenericSigner) Address() common.Address + func (s *GenericSigner) Sign(data common.Hash) (signature Signature, err error) + type Handler struct + HashSize int + func NewHandler(params *HandlerParams) *Handler + func (h *Handler) GetContent(feed *Feed) (storage.Address, []byte, error) + func (h *Handler) Lookup(ctx context.Context, query *Query) (*cacheEntry, error) + func (h *Handler) NewRequest(ctx context.Context, feed *Feed) (request *Request, err error) + func (h *Handler) SetStore(store *storage.NetStore) + func (h *Handler) Update(ctx context.Context, r *Request) (updateAddr storage.Address, err error) + func (h *Handler) Validate(chunkAddr storage.Address, data []byte) bool + type HandlerParams struct + type Header struct + Padding [headerLength - 1]uint8 + Version uint8 + type ID struct + func (u *ID) Addr() (updateAddr storage.Address) + func (u *ID) AppendValues(values Values) + func (u *ID) FromValues(values Values) error + type Query struct + Hint lookup.Epoch + TimeLimit uint64 + func NewQuery(feed *Feed, time uint64, hint lookup.Epoch) *Query + func NewQueryLatest(feed *Feed, hint lookup.Epoch) *Query + func (q *Query) AppendValues(values Values) + func (q *Query) FromValues(values Values) error + type Request struct + Signature *Signature + func NewFirstRequest(topic Topic) *Request + func (r *Request) AppendValues(values Values) []byte + func (r *Request) FromValues(values Values, data []byte) error + func (r *Request) GetDigest() (result common.Hash, err error) + func (r *Request) IsUpdate() bool + func (r *Request) MarshalJSON() (rawData []byte, err error) + func (r *Request) SetData(data []byte) + func (r *Request) Sign(signer Signer) error + func (r *Request) UnmarshalJSON(rawData []byte) error + func (r *Request) Verify() (err error) + type Signature [signatureLength]byte + type Signer interface + Address func() common.Address + Sign func(common.Hash) (Signature, error) + type TestHandler struct + func NewTestHandler(datadir string, params *HandlerParams) (*TestHandler, error) + func (t *TestHandler) Close() + type Timestamp struct + Time uint64 + func (t *Timestamp) MarshalJSON() ([]byte, error) + func (t *Timestamp) UnmarshalJSON(data []byte) error + type Topic [TopicLength]byte + func NewTopic(name string, relatedContent []byte) (topic Topic, err error) + func (t *Topic) FromHex(hex string) error + func (t *Topic) Hex() string + func (t *Topic) MarshalJSON() ([]byte, error) + func (t *Topic) Name(relatedContent []byte) string + func (t *Topic) UnmarshalJSON(data []byte) error + type Update struct + Header Header + func (r *Update) AppendValues(values Values) []byte + func (r *Update) FromValues(values Values, data []byte) error + type Values interface + Get func(key string) string + Set func(key, value string)