config

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultRoot            = "/tb"
	DefaultP2PListenFormat = "/ip4/0.0.0.0/tcp/%d"
	DefaultHTTPListen      = "0.0.0.0:443"
)
View Source
var WaitForSwamDuration = 10 * time.Second

Functions

func NewLiteNode

func NewLiteNode(ctx context.Context, config *Node, storagePath string) (peer.Node, error)

func NewNode

func NewNode(ctx context.Context, config *Node, storagePath string) (peer.Node, error)

Types

type ConfigBuilder

type ConfigBuilder struct {
	// generic
	DefaultP2PListenPort int
	DevP2PListenFormat   string

	// http
	DevHttpListenPort int
}

type DVKey

type DVKey struct {
	Private string `yaml:"private"`
	Public  string `yaml:"public"`
}

type DomainValidation

type DomainValidation struct {
	PrivateKey []byte
	PublicKey  []byte
}

type Domains

type Domains struct {
	Key       DVKey            `yaml:"key"`
	Whitelist DomainsWhiteList `yaml:"whitelist"`
	Generated string           `yaml:"generated"`
}

type DomainsWhiteList

type DomainsWhiteList struct {
	Postfix []string
	Regex   []string
}

type Node added in v1.0.5

type Node struct {
	Root      string
	Shape     string
	Protocols []string

	Peers           []string
	P2PListen       []string
	P2PAnnounce     []string
	Ports           map[string]int // TODO: use a struct
	Location        *seerIface.Location
	NetworkFqdn     string
	HttpListen      string
	GeneratedDomain string
	ServicesDomain  string

	Node       peer.Node
	PrivateKey []byte
	Databases  kvdb.Factory

	ClientNode peer.Node

	SwarmKey []byte

	Http http.Service

	EnableHTTPS bool
	Verbose     bool
	DevMode     bool

	Plugins
	DomainValidation DomainValidation
}

func (*Node) Validate added in v1.0.5

func (config *Node) Validate() error

type Plugin

type Plugin string

type Plugins

type Plugins struct {
	Plugins []Plugin `yaml:",omitempty"`
}

type Ports added in v1.0.5

type Ports struct {
	Main int `yaml:"main"`
	Lite int `yaml:"lite,omitempty"`
	Ipfs int `yaml:"ipfs,omitempty"`
}

func (Ports) ToMap added in v1.0.5

func (p Ports) ToMap() map[string]int

type ProtoCommandIface

type ProtoCommandIface interface {
	New(context.Context, *Node) (serviceIface.Service, error)
}

type Source

type Source struct {
	Privatekey  string
	Swarmkey    string
	Protocols   []string            `yaml:",omitempty"`
	P2PListen   []string            `yaml:"p2p-listen"`
	P2PAnnounce []string            `yaml:"p2p-announce"`
	Ports       Ports               `yaml:"ports"`
	Location    *seerIface.Location `yaml:"location,omitempty"`
	Peers       []string            `yaml:",omitempty"`
	NetworkFqdn string              `yaml:"network-fqdn"`
	Domains     Domains             `yaml:"domains"`
	Plugins
}

Jump to

Keyboard shortcuts

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