utils

package
v0.0.0-...-132a92c Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckEndpoint

func CheckEndpoint(network string, endpoint string) error

#checkEndpoint

func FileExist

func FileExist(file string) error

func GetFolderFiles

func GetFolderFiles(folder string) []os.FileInfo

get all files from folder

func InterfaceToBytes

func InterfaceToBytes(key interface{}) (error, []byte)

#InterfaceToBytes: convert a interface{} to a []byte

func IsLocalIPAddress

func IsLocalIPAddress(ip string) error

func LoadJSONFile

func LoadJSONFile(f string, object interface{}) error

LoadJSONFile: function to dump data from the file f to object

func ObjectToJsonByte

func ObjectToJsonByte(object interface{}) (error, []byte)

ObjectToJsonByte: converst any object to a json byte

func ObjectToJsonString

func ObjectToJsonString(object interface{}) (error, string)

ObjectToJsonString: converst any object to a json string

func ObjectToJsonStringPretty

func ObjectToJsonStringPretty(object interface{}) (error, string)

ObjectToJsonString: converst any object to a json string

func WrapCommunicator

func WrapCommunicator(ch interface{})

Types

type Communicator

type Communicator interface {
	Send()
	Receive()
}

type Receive

type Receive interface {
	In() chan<- interface{}
}

type Send

type Send interface {
	Out() <-chan interface{}
	Close()
}

Jump to

Keyboard shortcuts

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