config

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const ErrIncorrectKeyType = cerr.Error("incorrect private key type")

ErrIncorrectKeyType is returned when the private key is not of the correct type

View Source
const ErrNilConfig = cerr.Error("unknown nil config")

ErrNilConfig is returned when a config is expected but none is given

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host Host `json:"host,omitempty"`
}

Config is a struct to hold the config options

func Load

func Load(confLoc, listens, rpcListen, peers string) (Config, error)

Load reads the passed config file location and parses it into a config struct.

type Host

type Host struct {
	// PrivPEM is the host's private key location in PKCS#8, ASN.1 DER PEM format
	PrivPEM string `json:"privPEM,omitempty"`
	// Priv is the parsed, host's private key
	Priv lcrypto.PrivKey
	// Listen are addresses on which to listen
	Listens []string `json:"listens,omitempty"`
	// RPCAddress is the address to listen on for RPC
	RPCAddress string `json:"rcpAddress,omitempty"`
	// Peers are peers to be bootstrapped (e.g. /ip4/127.0.0.1/tcp/63785/ipfs/QmWjz6xb8v9K4KnYEwP5Yk75k5mMBCehzWFLCvvQpYxF3d)
	// note: peers are expected to be in IPFS format
	Peers []string `json:"peers,omitempty"`
	// Transports are the transport protocols which the host is to use (e.g. "tcp", "ws", etc)
	Transports []string `json:"transports,omitempty"`
	// Muxers are the transport muxers (e.g. yamux, mplex, etc.)
	Muxers [][]string `json:"muxers,omitempty"`
	// Security specifies the security to use
	Security string `json:"security,omitempty"`
	// OmitRelay disables the relay
	OmitRelay bool `json:"omitRelay,omitempty"`
	// OmitConnectionManager disables the connection manager
	OmitConnectionManager bool `json:"omitConnectionManager,omitempty"`
	// OmitNatPortMap disables the nat port map
	OmitNATPortMap bool `json:"omitNATPortMap,omitempty"`
	// OmitRPCServer disables the rpc server
	OmitRPCServer bool `json:"omitRPCServer,omitempty"`
	// OmitDiscoveryService disables the discovery service
	OmitDiscoveryService bool `json:"omitDiscoveryService,omitempty"`
	// OmitBootstrapPeers disables bootstrapping of peers
	OmitBootstrapPeers bool `json:"omitBootstrapPeers,omitempty"`
	// OmitRouting disables ipfs routing (e.g. dht);
	// note: DHT is the only router supported, for now...
	OmitRouting bool `json:"omitRouting,omitempty"`
	// LogerLocation points to the log file. One will be create if not exists. Default is std out.
	LoggerLocation string `json:"loggerLocation,omitempty"`
}

Host contains configs for the host

Jump to

Keyboard shortcuts

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