linkstore

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: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Opt

type Opt func(opts *options)

Opt is a link store option.

func WithPendingRecordLifespan

func WithPendingRecordLifespan(value time.Duration) Opt

WithPendingRecordLifespan sets the lifespan of an anchor reference in PENDING state, after which it will be deleted.

type Store

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

Store is implements an anchor link store.

func New

func New(provider storage.Provider, expiryService dataExpiryService, opts ...Opt) (*Store, error)

New creates a new anchor link store.

func (s *Store) DeleteLinks(links []*url.URL) error

DeleteLinks deletes the given hash links.

func (s *Store) DeletePendingLinks(links []*url.URL) error

DeletePendingLinks deletes the given hash links if they are in PENDING status.

func (s *Store) GetLinks(anchorHash string) ([]*url.URL, error)

GetLinks returns the links for the given anchor hash.

func (s *Store) GetProcessedAndPendingLinks(anchorHash string) ([]*url.URL, error)

GetProcessedAndPendingLinks returns the links for the given anchor hash, including all pending links.

func (*Store) HandleExpiredKeys

func (s *Store) HandleExpiredKeys(keys ...string) ([]string, error)

HandleExpiredKeys is invoked by the data expiration handler.

func (s *Store) PutLinks(links []*url.URL) error

PutLinks stores the given hash links.

func (s *Store) PutPendingLinks(links []*url.URL) error

PutPendingLinks stores the given hash links with the status of PENDING. These links are yet to be processed. Once they are processed, their status will be updated to processed.

Jump to

Keyboard shortcuts

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