utils

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

JSON fascade for abstraction of json marshalling and unmarhalling

Functions

func AppendFile

func AppendFile(absPath string, data []byte) bool

AppendFile appens data given absolute path to a file, creates it if it does not exist

func CountFiles

func CountFiles(absPath string) int

CountFiles returns number of items in directory

func EventPath

func EventPath(root, name string, version int) string

EventPath returns filepath for given event

func EventsPath

func EventsPath(root, name string) string

EventsPath returns filepath for events

func Exists

func Exists(absPath string) bool

Exists returns true if absolute path exists

func ListDirectory

func ListDirectory(absPath string, ascending bool) []string

ListDirectory returns sorted slice of item names in given absolute path default sorting is ascending

func MetadataPath

func MetadataPath(root, name string) string

MetadataPath returns filepath for given metadata

func NotifyServiceReady

func NotifyServiceReady()

NotifyServiceReady notify underlying os that service is ready

func NotifyServiceStopping

func NotifyServiceStopping()

NotifyServiceStopping notify underlying os that service is stopping

func ReadFileFully

func ReadFileFully(absPath string) (bool, []byte)

ReadFileFully reads whole file given absolute path

func RootPath

func RootPath(root string) string

RootPath returns filepath for accounts

func SnapshotPath

func SnapshotPath(root, name string, version int) string

SnapshotPath returns filepath for given snapshot

func SnapshotsPath

func SnapshotsPath(root, name string) string

SnapshotsPath returns filepath for snapshots

func TouchFile

func TouchFile(absPath string) bool

TouchFile creates files given absolute path if file does not already exist

func UpdateFile

func UpdateFile(absPath string, data []byte) bool

UpdateFile rewrite file with data given absolute path to a file if that file exist

func WriteFile

func WriteFile(absPath string, data []byte) bool

WriteFile writes data given absolute path to a file if that file does not already exists

Types

type LogFormat

type LogFormat struct {
}

LogFormat is a custom logging formater for logrus

func (*LogFormat) Format

func (f *LogFormat) Format(entry *log.Entry) ([]byte, error)

Format processed each log entry and produces formatted log line

Jump to

Keyboard shortcuts

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