config

package
v0.3.10 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License: Apache-2.0 Imports: 5 Imported by: 4

Documentation

Index

Constants

View Source
const (
	CharacterName_Client = "client"
	CharacterName_Bucket = "bucket"
	CharacterName_Deoss  = "deoss"
)

default service name

View Source
const (
	DevnetProtocolPrefix  = "/kldr-devnet"
	TestnetProtocolPrefix = "/kldr-testnet"
	MainnetProtocolPrefix = "/kldr-mainnet"
)

cess network protocol prefix

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Rpc            []string
	Bootnodes      []string
	Mnemonic       string
	Name           string
	Workspace      string
	ProtocolPrefix string
	P2pPort        int
	Timeout        time.Duration
}

Config describes a set of settings for a client

func (*Config) Apply

func (cfg *Config) Apply(opts ...Option) error

Apply applies the given options to the config, returning the first error encountered (if any).

func (*Config) NewSDK

func (cfg *Config) NewSDK(ctx context.Context, serviceName string) (sdk.SDK, error)

NewSDK constructs a new client from the Config.

This function consumes the config. Do not reuse it (really!).

type Option

type Option func(cfg *Config) error

Option is a client config option that can be given to the client constructor

Jump to

Keyboard shortcuts

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