config

package
v1.0.0-rc5 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultConnMgrGracePeriod = time.Second * 20

DefaultConnMgrGracePeriod is the default value for the connection managers grace period

View Source
const DefaultConnMgrHighWater = 900

DefaultConnMgrHighWater is the default value for the connection managers 'high water' mark

View Source
const DefaultConnMgrLowWater = 600

DefaultConnMgrLowWater is the default value for the connection managers 'low water' mark

Variables

View Source
var DefaultServerFilters = []string{
	"/ip4/10.0.0.0/ipcidr/8",
	"/ip4/100.64.0.0/ipcidr/10",
	"/ip4/169.254.0.0/ipcidr/16",
	"/ip4/172.16.0.0/ipcidr/12",
	"/ip4/192.0.0.0/ipcidr/24",
	"/ip4/192.0.0.0/ipcidr/29",
	"/ip4/192.0.0.8/ipcidr/32",
	"/ip4/192.0.0.170/ipcidr/32",
	"/ip4/192.0.0.171/ipcidr/32",
	"/ip4/192.0.2.0/ipcidr/24",
	"/ip4/192.168.0.0/ipcidr/16",
	"/ip4/198.18.0.0/ipcidr/15",
	"/ip4/198.51.100.0/ipcidr/24",
	"/ip4/203.0.113.0/ipcidr/24",
	"/ip4/240.0.0.0/ipcidr/4",
}

DefaultServerFilters has a list of non-routable IPv4 prefixes according to http://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml

Functions

func InitIpfs

func InitIpfs(identity native.Identity) (*native.Config, error)

func UpdateIpfs

func UpdateIpfs(rep repo.Repo, key string, value interface{}) error

func Write

func Write(repoPath string, conf *Config) error

Write replaces the on-disk version of config with the given one

Types

type API

type API struct {
	HTTPHeaders map[string][]string // HTTP headers to return with the API.
}

API settings

type Account

type Account struct {
	Address string // public key (seed is stored in the _possibly_ encrypted datastore)
	Thread  string // thread id of the default account thread used for sync between account peers
}

Account store public account info

type Addresses

type Addresses struct {
	API     string // address of the local API (RPC)
	CafeAPI string // address of the cafe REST API
	Gateway string // address to listen on for IPFS HTTP object gateway
}

Addresses stores the (string) bind addresses for the node.

type Cafe

type Cafe struct {
	Host   CafeHost
	Client CafeClient
}

Cafe settings

type CafeClient

type CafeClient struct {
	Mobile MobileCafeClient
}

CafeClient settings

type CafeHost

type CafeHost struct {
	Open bool // when true, other peers can register with this node for cafe services
}

TODO: add some more knobs: max num. clients, max client msg age, inbox size, etc.

type Config

type Config struct {
	Account   Account   // local node's account (public info only)
	Addresses Addresses // local node's addresses
	API       API       // local node's API settings
	Logs      Logs      // local node's log settings
	Threads   Threads   // local node's thread settings
	IsMobile  bool      // local node is setup for mobile
	IsServer  bool      // local node is setup for a server w/ a public IP
	Cafe      Cafe      // local node cafe settings
}

Config is used to load textile config files.

func Init

func Init(version string) (*Config, error)

Init returns the default textile config

func Read

func Read(repoPath string) (*Config, error)

Read reads config from disk

type Logs

type Logs struct {
	LogToDisk bool   // when true, sends all logs to rolling files on disk
	LogLevel  string // one of: critical error warning notice info debug
}

Logs settings

type MobileCafeClient

type MobileCafeClient struct {
	// messages w/ size less than limit will be handled by the p2p cafe service,
	// messages w/ size greater than limit will be handled by the mobile OS's background
	// upload service and the cafe HTTP API
	P2PWireLimit int
}

MobileCafeClient settings

type SwarmPorts

type SwarmPorts struct {
	TCP string // TCP address port
	WS  string // WS address port
}

type ThreadDefaults

type ThreadDefaults struct {
	ID string // default thread ID for reads/writes
}

ThreadDefaults settings

type Threads

type Threads struct {
	Defaults ThreadDefaults // default settings
}

Thread settings

Jump to

Keyboard shortcuts

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