node

package
v0.0.0-...-d40a6bc Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PstoreAddSelfKeysKey = invoke(iota)
	StartListeningKey
	BootstrapKey

	// daemon
	ExtractApiKey
	HeadMetricsKey
	RunPeerTaggerKey

	SetApiEndpointKey
)

Variables

This section is empty.

Functions

func From

func From(typ interface{}) interface{}

From(*T) -> func(t T) T {return t}

Types

type Option

type Option func(*Settings) error

Option是一个功能选项,可与新函数一起使用 更改节点的构造方式

按顺序应用选项 Option is a functional option which can be used with the New function to change how the node is constructed

Options are applied in sequence

func ApplyIf

func ApplyIf(check func(s *Settings) bool, opts ...Option) Option

func ConfigCommon

func ConfigCommon(cfg *config.Common) Option

Config sets up constructors based on the provided Config

func ConfigFullNode

func ConfigFullNode(c interface{}) Option

func Error

func Error(err error) Option

Error is a special option which returns an error when applied

func FullAPI

func FullAPI(out *api.FullNode) Option

func If

func If(b bool, opts ...Option) Option

func Online

func Online() Option

Online sets up basic libp2p node

func Options

func Options(opts ...Option) Option

Options groups multiple options into one

func Override

func Override(typ, constructor interface{}) Option

Override option changes constructor for a given type

func Repo

func Repo(r repo.Repo) Option

func Unset

func Unset(typ interface{}) Option

type Settings

type Settings struct {
	Online bool // Online option applied
	Config bool // Config option applied
	// contains filtered or unexported fields
}

type StopFunc

type StopFunc func(context.Context) error

func New

func New(ctx context.Context, opts ...Option) (StopFunc, error)

New builds and starts new Star node

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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