config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DatabasePath           string = "/tb/storage/databases/"
	DefaultP2PListenFormat string = "/ip4/0.0.0.0/tcp/%d"
	DefaultHTTPListen      string = "0.0.0.0:443"
	DefaultCAFileName      string = "/tb/priv/fullchain.pem"
	DefaultKeyFileName     string = "/tb/priv/privkey.pem"
)
View Source
var WaitForSwamDuration = 10 * time.Second

Functions

func NewLiteNode

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

func NewNode

func NewNode(ctx context.Context, config *Protocol, databaseName 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"`
	Services  string           `yaml:"services"`
	Generated string           `yaml:"generated"`
}

type DomainsWhiteList

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

type Plugin

type Plugin string

type Plugins

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

type ProtoCommandIface

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

type Protocol

type Protocol struct {
	Root      string
	Shape     string
	Branch    string
	Protocols []string

	Peers           []string
	P2PListen       []string
	P2PAnnounce     []string
	Ports           map[string]int // TODO: use a struct
	Location        *seerIface.Location
	NetworkUrl      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 (*Protocol) Validate

func (config *Protocol) Validate() 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       map[string]int
	Location    *seerIface.Location `yaml:"location,omitempty"`
	Peers       []string            `yaml:",omitempty"`
	HttpListen  string              `yaml:"http-listen,omitempty"`
	NetworkUrl  string              `yaml:"network-url"`
	Domains     Domains             `yaml:"domains"`
	Plugins
}

Jump to

Keyboard shortcuts

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