options

package
v0.0.0-...-80c7550 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultBootstrapPeers = []string{}

DefaultBootstrapPeers collection of peers to use as bootstrap by default

Functions

This section is empty.

Types

type Option

type Option func(s *Settings) error

Option represents a single init option

func BlockSize

func BlockSize(blockSize int64) Option

BlockSize set the block site of this node

func BootstrapPeers

func BootstrapPeers(peers []string) Option

BootstrapPeers option

func BootstrapPeersAppend

func BootstrapPeersAppend(peers []string) Option

BootstrapPeersAppend option

func Context

func Context(ctx context.Context) Option

Context option

func GCInterval

func GCInterval(interval time.Duration) Option

GCInterval interval which the garbage collector should run

func Identity

func Identity(id identity.Identity) Option

Identity set the node identity

func IdentityFromReader

func IdentityFromReader(r io.Reader) Option

IdentityFromReader set the node identity from a reader

func Port

func Port(port uint) Option

Port option

func RelayOnly

func RelayOnly(relayOnly bool) Option

RelayOnly option

func ReprovideInterval

func ReprovideInterval(interval time.Duration) Option

ReprovideInterval interval which blocks are republished to the network

func Root

func Root(root string) Option

Root set base location

type Settings

type Settings struct {
	Context        context.Context
	Port           uint
	BootstrapPeers []string
	RelayOnly      bool

	BlockSize int64

	Root string

	ReprovideInterval time.Duration

	GCInterval time.Duration

	Identity identity.Identity
}

Settings init settings

func (*Settings) SetDefaults

func (s *Settings) SetDefaults() error

SetDefaults set the default values

Jump to

Keyboard shortcuts

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