utils

package
v0.0.0-...-725c2af Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2019 License: MPL-2.0 Imports: 3 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckBoltIteration

func CheckBoltIteration(goRoutineBoltIteration int) (bool, error)

CheckBoltIteration checks to see if the current boltIteration matches the go routines boltIteration, if not close the go routines

func CloseDoneChan

func CloseDoneChan()

CloseDoneChan closes the channel

func FilterPayload

func FilterPayload(p *gabs.Container, keys []string) (*gabs.Container, error)

FilterPayload recieves a gabs.Container and checks it against []keys, an array of strings. Any top-level children of the payload that aren't in []keys are removed. Returns the modified gabs.Container

func GetBoltIteration

func GetBoltIteration() int

GetBoltIteration returns the current bolt iteration

func GetDoneChannel

func GetDoneChannel() chan bool

GetDoneChannel returns the done channel, for use in other packages

func GetLocalIP

func GetLocalIP() string

GetLocalIP returns the first non loopback local IP of the host.

func GetLocalIPs

func GetLocalIPs() ([]string, error)

GetLocalIPs returns all local IPs of the host, including loopbacks.

func GetResDoneChan

func GetResDoneChan() chan bool

GetResDoneChan gets the channel

func IncrementBoltIteration

func IncrementBoltIteration()

IncrementBoltIteration increments boltIteration to hold the current number of bolt itterations for closing go routines on reboot

func InitBoltIteration

func InitBoltIteration()

InitBoltIteration initializes the variable that holds the bolt engines current itterations

func InitDoneChan

func InitDoneChan()

InitDoneChan reinnitialized done channel

func NilString

func NilString(val interface{}, ifnil string) string

NilString takes in an interface as val, and if its nil, returns ifnil, otherwise returns the val cast as a string

func SignalResDoneChan

func SignalResDoneChan()

SignalResDoneChan sends the done signal to continue the reboot process

func StringInSlice

func StringInSlice(a string, list []string) bool

StringInSlice takes a string, and slice of strings, and checks if the slice contains it. Returns true if found

Types

This section is empty.

Jump to

Keyboard shortcuts

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