datastore

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2021 License: Apache-2.0, MIT, Apache-2.0, + 1 more Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPostgreSQLDatastore

func NewPostgreSQLDatastore(ctx context.Context, connstr string, createDB bool) (*pgds.Datastore, error)

NewPostgreSQLDatastore creates a new pgds.Datastore that talks to a PostgreSQL database

func NewProxy

func NewProxy(ctx context.Context, ds datastore.Batching, getRouting GetRoutingFunc, opts Options) datastore.Batching

NewProxy returns a new proxy to a datastore that adds hooks to perform hydra things

Types

type AddProviderFunc

type AddProviderFunc func(ctx context.Context, c cid.Cid, id peer.ID)

AddProviderFunc adds a provider for a given CID to the datastore

type GetRoutingFunc

type GetRoutingFunc func(cid.Cid) (routing.Routing, AddProviderFunc, error)

GetRoutingFunc is a function that returns an appropriate routing module given a CID

type Options

type Options struct {
	// total number of find provider queries we should queue
	FindProvidersQueueSize int
	// number of providers to find when a provider record does not exist in the store
	FindProvidersCount int
	// number of find provider requests we will concurrently process
	FindProvidersConcurrency int
	// maximum time a find providers call is allowed to take
	FindProvidersTimeout time.Duration
	// period after a find failure that another find request for the same key will be discarded
	FindProvidersFailureBackoff time.Duration
}

Options are options for the Hydra datastore

Jump to

Keyboard shortcuts

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