Documentation ¶
Index ¶
- Constants
- Variables
- func FromLineOfFile() string
- func GetOptions() bool
- func HandleError(err error, action int) bool
- func HandlePanic(err error)
- func InSlice(slice []string, searchFor string) (found bool)
- func InitLog(traceFileName string, debugHandler io.Writer, infoHandler io.Writer, ...)
- func PadRight(str string, padWith string, length int) string
- func UpdateConfigVal(d Datastore, key, val string) (oldValue string)
- func WriteFile(filename string, source io.Reader) error
- type APIError
- type BasicFormatter
- type Conf
- type Datastore
- type HttpErrorHandler
- type PlainFormatter
- type PlusVFormatter
Constants ¶
View Source
const ( ErrorActionErr = iota ErrorActionWarn ErrorActionDebug ErrorActionInfo )
View Source
const BasicTimeStampFormat = "2006-01-02 15:04:05"
Variables ¶
View Source
var ( Debug *log.Logger Info *log.Logger Error *log.Logger InfoHandler io.Writer ErrorHandler io.Writer )
View Source
var LevelDescriptions = []string{"PANC", "FATL", "ERRO", "WARN", "INFO", "DEBG"}
Functions ¶
func FromLineOfFile ¶
func FromLineOfFile() string
HandlePanic _Never_ returns on error, instead it panics
func GetOptions ¶
func GetOptions() bool
func HandleError ¶
func HandlePanic ¶
func HandlePanic(err error)
HandlePanic _Never_ returns an error, instead it panics
func UpdateConfigVal ¶
UpdateConfigVal returns string representation of old config value
Types ¶
type BasicFormatter ¶
type Conf ¶
type Conf struct { Port string `toml:"port"` LogDebugInfo bool `toml:"log_debug_info"` MaxConcurrentConnections int `toml:"max_concurrent_connections"` MaxNumber int `toml:"max_number"` UseNumberHandler bool `toml:"use_number_handler"` }
var Config Conf
type HttpErrorHandler ¶
type HttpErrorHandler struct { Caller string Response http.ResponseWriter Request *http.Request }
func NewHttpErrorHandle ¶
func NewHttpErrorHandle(caller string, response http.ResponseWriter, request *http.Request) *HttpErrorHandler
func (*HttpErrorHandler) Handle ¶
func (h *HttpErrorHandler) Handle(err error, httpStatus int, action int) bool
HandleError locally, according to the action passed to h.Handle, and then serialized in json and sent to the remote address via http, then returns true. Otherwise, if there is no error, h.Handle returns false
type PlainFormatter ¶
type PlainFormatter struct{}
Click to show internal directories.
Click to hide internal directories.