utils

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownLogLevel = errors.New("unknown log level (known: debug, info, warn, error)")
View Source
var ErrUnknownNetwork = errors.New("unknown network (known: mainnet, goerli, goerli2, integration)")

Functions

func DataDir

func DataDir(operatingSystem, userDataDir, homeDir string) string

func DefaultDataDir

func DefaultDataDir() (string, error)

func HexToFelt added in v0.2.1

func HexToFelt(t *testing.T, hex string) *felt.Felt

Types

type LogLevel

type LogLevel int
const (
	DEBUG LogLevel = iota
	INFO
	WARN
	ERROR
)

func (*LogLevel) Set added in v0.2.1

func (l *LogLevel) Set(s string) error

func (LogLevel) String

func (l LogLevel) String() string

func (*LogLevel) Type added in v0.2.1

func (l *LogLevel) Type() string

func (*LogLevel) UnmarshalText added in v0.2.1

func (l *LogLevel) UnmarshalText(text []byte) error

type Logger

type Logger interface {
	SimpleLogger
	pebble.Logger
}

type Network

type Network int
const (
	MAINNET Network = iota
	GOERLI
	GOERLI2
	INTEGRATION
)

func (Network) ChainID added in v0.2.1

func (n Network) ChainID() *felt.Felt

func (*Network) Set added in v0.2.1

func (n *Network) Set(s string) error

func (Network) String

func (n Network) String() string

func (*Network) Type added in v0.2.1

func (n *Network) Type() string

func (Network) URL

func (n Network) URL() string

func (*Network) UnmarshalText added in v0.2.1

func (n *Network) UnmarshalText(text []byte) error

type SimpleLogger

type SimpleLogger interface {
	Debugw(msg string, keysAndValues ...any)
	Infow(msg string, keysAndValues ...any)
	Warnw(msg string, keysAndValues ...any)
	Errorw(msg string, keysAndValues ...any)
}

type ZapLogger

type ZapLogger struct {
	*zap.SugaredLogger
}

func NewNopZapLogger

func NewNopZapLogger() *ZapLogger

func NewZapLogger

func NewZapLogger(logLevel LogLevel, colour bool) (*ZapLogger, error)

func (*ZapLogger) Warningf

func (l *ZapLogger) Warningf(msg string, args ...any)

Jump to

Keyboard shortcuts

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