unpublished

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store implements storage for unpublished operation.

func New

func New(provider storage.Provider, unpublishedOperationLifespan time.Duration,
	expiryService *expiry.Service, metrics metricsProvider,
) (*Store, error)

New returns a new instance of an unpublished operation store. This method will also register the unpublished operation store with the given expiry service which will then take care of deleting expired data automatically. Note that it's the caller's responsibility to start the expiry service. unpublishedOperationLifespan defines how long unpublished operations can stay in the store before being flagged for deletion.

func (*Store) Delete

func (s *Store) Delete(op *operation.AnchoredOperation) error

Delete will delete unpublished operation for suffix.

func (*Store) DeleteAll

func (s *Store) DeleteAll(ops []*operation.AnchoredOperation) error

DeleteAll deletes all operations for suffixes.

func (*Store) Get

func (s *Store) Get(suffix string) ([]*operation.AnchoredOperation, error)

Get retrieves unpublished operations by suffix.

func (*Store) Put

func (s *Store) Put(op *operation.AnchoredOperation) error

Put saves an unpublished operation. If it already exists it will be overwritten.

Jump to

Keyboard shortcuts

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