commons

package
v2.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(e error)

func Commit

func Commit(manager Manager) error

func FileBasename

func FileBasename(s string) string

func FileOrFolderExists

func FileOrFolderExists(path string) bool

func FindIndexInArray

func FindIndexInArray(predicate func(val interface{}) bool, array interface{}) (exists bool, index int)

func GetUID

func GetUID() string

func IsInArray

func IsInArray(val interface{}, array interface{}) (exists bool, index int)

func LoadFromDB

func LoadFromDB(manager Manager)

func OpenSaveFile

func OpenSaveFile(manager Manager, osFlag int) (*os.File, error)

func WriteJsonResponse

func WriteJsonResponse(w http.ResponseWriter, body interface{})

func WriteResponse

func WriteResponse(w http.ResponseWriter, statusCode int, message string)

Types

type Manager

type Manager interface {
	Commit() error
	GetSaveFilePath() (fullPath string, dirPath string, fileName string)
	GetConfig() interface{}
}

Jump to

Keyboard shortcuts

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