config

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: BSD-3-Clause Imports: 12 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 Bundle added in v1.1.1

type Bundle struct {
	Origin BundleOrigin `yaml:"origin"`
	Source
}

type BundleOrigin added in v1.1.1

type BundleOrigin struct {
	Shape     string    `yaml:"shape"`
	Host      string    `yaml:"host"`
	Creation  time.Time `yaml:"time"`
	Version   *string   `yaml:"version,omitempty"`
	Protected bool      `yaml:"protected,omitempty"`
}

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"`
	Aliases   []string `yaml:"aliases"`
	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
	GeneratedDomain string
	AliasDomains    []string

	HttpListen string

	AliasDomainsRegExp    []*regexp.Regexp
	GeneratedDomainRegExp *regexp.Regexp
	ProtocolsDomainRegExp *regexp.Regexp

	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:"plugins,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              `yaml:"privatekey"`
	Swarmkey    string              `yaml:"swarmkey"`
	Protocols   []string            `yaml:"protocols,omitempty"`
	P2PListen   []string            `yaml:"p2p-listen"`
	P2PAnnounce []string            `yaml:"p2p-announce"`
	Ports       Ports               `yaml:"ports"`
	Location    *seerIface.Location `yaml:"location,omitempty"`
	Peers       []string            `yaml:"peers,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