common

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2020 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NetBoostrapper

type NetBoostrapper interface {
	app.Net
	GetIpfsLite() *ipfslite.Peer
	Bootstrap(addrs []peer.AddrInfo)
}

DefaultNetwork is a boostrapable default Net with sane defaults.

func DefaultNetwork

func DefaultNetwork(repoPath string, opts ...NetOption) (NetBoostrapper, error)

type NetConfig

type NetConfig struct {
	HostAddr          ma.Multiaddr
	ConnManager       cconnmgr.ConnManager
	Debug             bool
	GRPCServerOptions []grpc.ServerOption
	GRPCDialOptions   []grpc.DialOption
	PubSub            bool
}

type NetOption

type NetOption func(c *NetConfig) error

func WithConnectionManager

func WithConnectionManager(cm cconnmgr.ConnManager) NetOption

func WithNetDebug

func WithNetDebug(enabled bool) NetOption

func WithNetGRPCDialOptions

func WithNetGRPCDialOptions(opts ...grpc.DialOption) NetOption

func WithNetGRPCServerOptions

func WithNetGRPCServerOptions(opts ...grpc.ServerOption) NetOption

func WithNetHostAddr

func WithNetHostAddr(addr ma.Multiaddr) NetOption

func WithNetPubSub

func WithNetPubSub(enabled bool) NetOption

Jump to

Keyboard shortcuts

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