client

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const InterResolveTimeout = 10 * time.Second

TODO: add this as a config option

Variables

View Source
var (
	MultiAddrMatcher = regexp.MustCompile(
		"^/ip4/([.0-9]+)/(tcp|udp)/\\d+(/quic-v1|/quic)?/p2p/\\w+$",
	)
	Localhost = "127.0.0.1"
)
View Source
var ErrNoAddrFound = errors.New("No addrs found")

Functions

This section is empty.

Types

type Config

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

func (*Config) Apply

func (cfg *Config) Apply(opts ...Option) error

type IpfsClientNode

type IpfsClientNode struct {
	*shell.Shell
	// contains filtered or unexported fields
}

func NewClient

func NewClient(opts ...Option) (*IpfsClientNode, error)

func (*IpfsClientNode) FindProviders

func (ipfs *IpfsClientNode) FindProviders(cid CidInfo) ([]shell.PeerInfo, error)

func (*IpfsClientNode) Provide

func (ipfs *IpfsClientNode) Provide(cid CidInfo) ([]shell.PeerInfo, error)

func (*IpfsClientNode) SuitableAddresses

func (ipfs *IpfsClientNode) SuitableAddresses() (*peer.AddrInfo, error)

type Option

type Option func(*Config) error

func Api

func Api(url string) Option

func Bootstrap

func Bootstrap(nodes ...string) Option

func Mode

func Mode(mode recs.IpfsMode) Option

Jump to

Keyboard shortcuts

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