client

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2023 License: Apache-2.0, MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is an http client for the indexer finder API,

func New

func New(baseURL string, options ...Option) (*Client, error)

New creates a new admin HTTP client.

func (*Client) Allow

func (c *Client) Allow(ctx context.Context, peerID peer.ID) error

Allow configures the indexer to allow the peer to publish messages and provide content.

func (*Client) Assign

func (c *Client) Assign(ctx context.Context, peerID peer.ID) error

Assign assigns a publish to an indexer, when the indexer is configured to work with an assigner service.

func (*Client) Block

func (c *Client) Block(ctx context.Context, peerID peer.ID) error

Block configures indexer to block the peer from publishing messages and providing content.

func (*Client) Freeze

func (c *Client) Freeze(ctx context.Context) error

func (*Client) GetPendingSyncs

func (c *Client) GetPendingSyncs(ctx context.Context) ([]string, error)

func (*Client) Handoff

func (c *Client) Handoff(ctx context.Context, publisherID, frozenID peer.ID, frozenURL string) error

func (*Client) ImportFromCidList

func (c *Client) ImportFromCidList(ctx context.Context, fileName string, provID peer.ID, contextID, metadata []byte) error

ImportFromCidList process entries from a cidlist and imprts it into the indexer.

func (*Client) ImportFromManifest

func (c *Client) ImportFromManifest(ctx context.Context, fileName string, provID peer.ID, contextID, metadata []byte) error

ImportFromManifest processes entries from manifest and imports them into the indexer.

func (*Client) ImportProviders

func (c *Client) ImportProviders(ctx context.Context, fromURL *url.URL) error

ImportProviders

func (*Client) ListAssignedPeers

func (c *Client) ListAssignedPeers(ctx context.Context) (map[peer.ID]peer.ID, error)

ListAssignedPeers gets a list of explicitly allowed peers, if indexer is configured to work with an assigner service.

func (*Client) ListLogSubSystems

func (c *Client) ListLogSubSystems(ctx context.Context) ([]string, error)

func (*Client) ListPreferredPeers

func (c *Client) ListPreferredPeers(ctx context.Context) ([]peer.ID, error)

ListPreferredPeers gets a list of unassigned peers that the indexer has previously retrieved advertisements from.

func (*Client) ReloadConfig

func (c *Client) ReloadConfig(ctx context.Context) error

ReloadConfig reloads reloadable parts of the configuration file.

func (*Client) SetLogLevels

func (c *Client) SetLogLevels(ctx context.Context, sysLvl map[string]string) error

func (*Client) Status

func (c *Client) Status(ctx context.Context) (*model.Status, error)

func (*Client) Sync

func (c *Client) Sync(ctx context.Context, peerID peer.ID, peerAddr multiaddr.Multiaddr, depth int64, resync bool) error

Sync with a data peer up to the latest ID.

func (*Client) Unassign

func (c *Client) Unassign(ctx context.Context, peerID peer.ID) error

Unassign unassigns a publish from an indexer, when the indexer is configured to work with an assigner service.

type Option

type Option func(*config) error

Option is a function that sets a value in a config.

func WithClient

func WithClient(c *http.Client) Option

WithClient allows creation of the http client using an underlying network round tripper / client.

Jump to

Keyboard shortcuts

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