utils

package
v0.0.0-...-7c66ffc Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package utils contins various utility functions and types that doesn't fit anywhere else.

This package shouldn't really exist but...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AtonIPv4

func AtonIPv4(ip net.IP) uint32

AtonIPv4 converts an IPv4 address into a uint32 value

func GetSignalChannel

func GetSignalChannel() chan os.Signal

GetSignalChannel returns the signal channel. This is for testing.

func InitLogs

func InitLogs(service string, params LogParameters)

InitLogs configures logging for a service. This will turn on syslog logs if they are enabled or just a plain text stderr log. If there are any errors while running

func NtoaIPv4

func NtoaIPv4(u uint32) net.IP

NtoaIPv4 convers an uint32 value into the corresponding IPv4 address

func SendInterrupt

func SendInterrupt()

SendInterrupt sends an interrupt signal to the waiting channel

func WaitForSignal

func WaitForSignal()

WaitForSignal waits for a signal to terminate

Types

type LogParameters

type LogParameters struct {
	Level string `param:"desc=Logging level (debug, info, warning, error);default=debug;options=debug,info,warning,error"`
	Type  string `param:"desc=Log type (syslog, plain, plus, fancy);default=plain;options=syslog,plus,fancy,plain"`
}

LogParameters contains the default log parameters

Directories

Path Synopsis
Package audit handles audit logging.
Package audit handles audit logging.
Package grpcutil contains utility functions to create gRPC clients and servers
Package grpcutil contains utility functions to create gRPC clients and servers

Jump to

Keyboard shortcuts

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