util

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: May 29, 2020 License: GPL-3.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckError

func CheckError(err error, logger *logrus.Entry)

CheckError check if error is not nil and panic

func GetContextLogger

func GetContextLogger(filename string, unitName string) *logrus.Entry

GetContextLogger get a logger instance contextualized by service name

func GetMyID

func GetMyID() uuid.UUID

GetMyID get device mesh Id

func InitLogger

func InitLogger()

InitLogger initialize logger service

Types

type Config

type Config struct {
	Discover *DiscoverConfig
	Mesh     *MeshConfig
	Streamer *StreamerConfig
}

Config store the application

func InitConfig

func InitConfig() *Config

InitConfig load config from flags

type DiscoverConfig

type DiscoverConfig struct {
	Port int
}

DiscoverConfig peer discovering config

type MeshConfig

type MeshConfig struct {
	AutoAccept bool
}

MeshConfig mesh network config

type ServiceBag

type ServiceBag struct {
	DeviceID uuid.UUID
	Config   *Config
}

ServiceBag various global object injected to services

func GetServiceBag

func GetServiceBag() *ServiceBag

GetServiceBag get servicebag singleton

type StreamerConfig

type StreamerConfig struct {
	AutoStart   bool
	PlaylistDir string
}

StreamerConfig streamer config

Jump to

Keyboard shortcuts

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