conte

package
v0.0.2-0...-1c7e8a7 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2021 License: Unlicense Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(err error) bool

func Debug

func Debug(a ...interface{})

func Debugc

func Debugc(fn func() string)

func Debugf

func Debugf(format string, a ...interface{})

func Debugs

func Debugs(a interface{})

func Error

func Error(a ...interface{})

func Errorc

func Errorc(fn func() string)

func Errorf

func Errorf(format string, a ...interface{})

func Errors

func Errors(a interface{})

func Fatal

func Fatal(a ...interface{})

func Fatalc

func Fatalc(fn func() string)

func Fatalf

func Fatalf(format string, a ...interface{})

func Fatals

func Fatals(a interface{})

func GetContext

func GetContext(cx *Xt) *chainrpc.Context

func Info

func Info(a ...interface{})

func Infoc

func Infoc(fn func() string)

func Infof

func Infof(format string, a ...interface{})

func Infos

func Infos(a interface{})

func Trace

func Trace(a ...interface{})

func Tracec

func Tracec(fn func() string)

func Tracef

func Tracef(format string, a ...interface{})

func Traces

func Traces(a interface{})

func Warn

func Warn(a ...interface{})

func Warnc

func Warnc(fn func() string)

func Warnf

func Warnf(format string, a ...interface{})

func Warns

func Warns(a interface{})

Types

type Xt

type Xt struct {
	sync.Mutex
	WaitGroup sync.WaitGroup
	KillAll   qu.C
	// App is the heart of the application system, this creates and initialises it.
	App *cli.App
	// AppContext is the urfave/cli app context
	AppContext *cli.Context
	// Config is the pod all-in-one server config
	Config *pod.Config
	// ConfigMap
	ConfigMap map[string]interface{}
	// StateCfg is a reference to the main node state configuration struct
	StateCfg *state.Config
	// ActiveNet is the active net parameters
	ActiveNet *netparams.Params
	// Language libraries
	Language *lang.Lexicon
	// DataDir is the default data dir
	DataDir string
	// Node is the run state of the node
	Node atomic.Bool
	// NodeReady is closed when it is ready then always returns
	NodeReady qu.C
	// NodeKill is the killswitch for the Node
	NodeKill qu.C
	// Wallet is the run state of the wallet
	Wallet atomic.Bool
	// WalletKill is the killswitch for the Wallet
	WalletKill qu.C
	// RPCServer is needed to directly query data
	RPCServer *chainrpc.Server
	// NodeChan relays the chain RPC server to the main
	NodeChan chan *chainrpc.Server
	// WalletServer is needed to query the wallet
	WalletServer *wallet.Wallet
	// WalletChan is a channel used to return the wallet server pointer when it starts
	WalletChan chan *wallet.Wallet
	// ChainClientChan returns the chainclient
	ChainClientReady qu.C
	// ChainClient is the wallet's chain RPC client
	ChainClient *chain.RPCClient
	// RealNode is the main node
	RealNode *chainrpc.Node
	// Hashrate is the current total hashrate from kopach workers taking work from this node
	Hashrate atomic.Uint64
	// Controller is the run state indicator of the controller
	Controller atomic.Bool
	// OtherNodes is the count of nodes connected automatically on the LAN
	OtherNodes atomic.Int32
	// IsGUI indicates if we have the possibility of terminal input
	IsGUI bool
	// contains filtered or unexported fields
}

Xt as in conte.Xt stores all the common state data used in pod

func GetNewContext

func GetNewContext(appName, appLang, subtext string) *Xt

GetNewContext returns a fresh new context

func (*Xt) IsCurrent

func (cx *Xt) IsCurrent() (is bool)

func (*Xt) PrintWaitChangers

func (cx *Xt) PrintWaitChangers() string

func (*Xt) WaitAdd

func (cx *Xt) WaitAdd()

func (*Xt) WaitDone

func (cx *Xt) WaitDone()

func (*Xt) WaitWait

func (cx *Xt) WaitWait()

Jump to

Keyboard shortcuts

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