util

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2022 License: MIT Imports: 24 Imported by: 35

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeAddrsEdge added in v1.1.0

func ComputeAddrsEdge(as []PeerAddr) uint64

func ComputeHeadsEdge added in v1.1.0

func ComputeHeadsEdge(hs []LogHead) uint64

func DefaultBoostrapPeers

func DefaultBoostrapPeers() []peer.AddrInfo

func FreeLocalAddr added in v0.1.13

func FreeLocalAddr() ma.Multiaddr

func GenerateRandomBytes added in v0.1.22

func GenerateRandomBytes(n int) []byte

func InstanceFromJSON added in v0.1.13

func InstanceFromJSON(b []byte, i interface{})

func JSONFromInstance added in v0.1.13

func JSONFromInstance(i interface{}) []byte

func LevelFromDebugFlag added in v1.1.0

func LevelFromDebugFlag(debug bool) logging.LogLevel

LevelFromDebugFlag returns the debug or info log level.

func MakeToken added in v1.1.0

func MakeToken(n int) string

func MustParseAddr added in v0.1.6

func MustParseAddr(str string) ma.Multiaddr

func NewBadgerDatastore added in v1.1.0

func NewBadgerDatastore(dirPath, name string, lowMem bool) (kt.TxnDatastoreExtended, error)

NewBadgerDatastore returns a badger based datastore.

func ParseBootstrapPeers

func ParseBootstrapPeers(addrs []string) ([]peer.AddrInfo, error)

func SchemaFromInstance added in v0.1.13

func SchemaFromInstance(i interface{}, expandedStruct bool) *jsonschema.Schema

func SchemaFromSchemaString added in v0.1.13

func SchemaFromSchemaString(s string) *jsonschema.Schema

func SetJSONID added in v0.1.13

func SetJSONID(id core.InstanceID, json []byte) []byte

func SetJSONProperty added in v0.1.13

func SetJSONProperty(name string, value interface{}, json []byte) []byte

func SetLogLevels

func SetLogLevels(systems map[string]logging.LogLevel) error

SetLogLevels sets levels for the given systems.

func SetupDefaultLoggingConfig

func SetupDefaultLoggingConfig(file string) error

SetupDefaultLoggingConfig sets up a standard logging configuration.

func StopGRPCServer added in v1.1.0

func StopGRPCServer(server *grpc.Server)

func TCPAddrFromMultiAddr

func TCPAddrFromMultiAddr(maddr ma.Multiaddr) (addr string, err error)

Types

type LogHead added in v1.1.0

type LogHead struct {
	LogID peer.ID
	Head  thread.Head
}

type PeerAddr added in v1.1.0

type PeerAddr struct {
	PeerID peer.ID
	Addr   ma.Multiaddr
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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