shared

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// BluetoothDevice is a default Bluetooth device instance.
	BluetoothDevice ble.Device
)
View Source
var LevelDB *leveldb.DB

LevelDB is an instance of the LevelDB client for managing persistent cache.

View Source
var Logger = logging.MustGetLogger("sensorsys")

Logger is an instance of the shared logger tool.

Functions

func CloseCore

func CloseCore()

CloseCore performs core dependencies close sequence.

func Execute

func Execute(fn func() error, msg string)

Execute executes `fn` function and in case of error logs it. Use `msg` to specify details of error to wrap by.

func InitCore

func InitCore()

InitCore performs core dependencies initialization sequence.

func MustExecute

func MustExecute(fn func() error, msg string)

MustExecute executes `fn` function and in case of error logs it, followed by a call to os.Exit(1). Use `msg` to specify details of error to wrap by.

func MustUnmarshalFromConfig

func MustUnmarshalFromConfig(key string, v interface{})

MustUnmarshalFromConfig retrieves config block by given `key` and decodes it into given structure `v`. In case of unmarshalling error occurrence it will log fatal error.

func NtoI2cBusName

func NtoI2cBusName(n int) string

NtoI2cBusName returns I2C bus name based on specified `n` number.

func NtoPinName

func NtoPinName(pin int) string

NtoPinName returns GPIO pin name based on specified `pin` number.

func UnmarshalFromConfig

func UnmarshalFromConfig(key string, v interface{}) error

UnmarshalFromConfig retrieves config block by given `key` and decodes it into given structure `v`.

Types

This section is empty.

Jump to

Keyboard shortcuts

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