Versions in this module Expand all Collapse all v0 v0.9.0 Sep 26, 2019 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 + var TimestampProvider timestampProvider = NewDefaultTimestampProvider() + 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 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(rootAddr storage.Address) (storage.Address, []byte, error) + func (h *Handler) GetLastPeriod(rootAddr storage.Address) (uint32, error) + func (h *Handler) GetVersion(rootAddr storage.Address) (uint32, error) + func (h *Handler) Load(ctx context.Context, rootAddr storage.Address) (*resource, error) + func (h *Handler) Lookup(ctx context.Context, params *LookupParams) (*resource, error) + func (h *Handler) LookupPrevious(ctx context.Context, params *LookupParams) (*resource, error) + func (h *Handler) New(ctx context.Context, request *Request) error + func (h *Handler) NewUpdateRequest(ctx context.Context, rootAddr storage.Address) (updateRequest *Request, err error) + func (h *Handler) SetStore(store *storage.NetStore) + func (h *Handler) Update(ctx context.Context, r *SignedResourceUpdate) (storage.Address, error) + func (h *Handler) Validate(chunkAddr storage.Address, data []byte) bool + type HandlerParams struct + QueryMaxPeriods uint32 + type LookupParams struct + Limit uint32 + func LookupLatest(rootAddr storage.Address) *LookupParams + func LookupLatestVersionInPeriod(rootAddr storage.Address, period uint32) *LookupParams + func LookupVersion(rootAddr storage.Address, period, version uint32) *LookupParams + func NewLookupParams(rootAddr storage.Address, period, version uint32, limit uint32) *LookupParams + func (r *LookupParams) RootAddr() storage.Address + type Request struct + func NewCreateRequest(metadata *ResourceMetadata) (request *Request, err error) + func NewCreateUpdateRequest(metadata *ResourceMetadata) (*Request, error) + func (r *Request) Frequency() uint64 + func (r *Request) IsNew() bool + func (r *Request) IsUpdate() bool + func (r *Request) MarshalJSON() (rawData []byte, err error) + func (r *Request) Multihash() bool + func (r *Request) Name() string + func (r *Request) Owner() common.Address + func (r *Request) Period() uint32 + func (r *Request) RootAddr() storage.Address + func (r *Request) SetData(data []byte, multihash bool) + func (r *Request) Sign(signer Signer) error + func (r *Request) StartTime() Timestamp + func (r *Request) UnmarshalJSON(rawData []byte) error + func (r *Request) Version() uint32 + type ResourceMetadata struct + Frequency uint64 + Name string + Owner common.Address + StartTime Timestamp + type Signature [signatureLength]byte + type SignedResourceUpdate struct + func (r *SignedResourceUpdate) GetDigest() (result common.Hash, err error) + func (r *SignedResourceUpdate) Multihash() bool + func (r *SignedResourceUpdate) Sign(signer Signer) error + func (r *SignedResourceUpdate) Verify() (err error) + 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 + type UpdateLookup struct + func (u *UpdateLookup) UpdateAddr() (updateAddr storage.Address)