utils

package
v0.0.0-...-759ca40 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileChecksum

func FileChecksum(p string) [32]byte

func FileDataChecksum

func FileDataChecksum(s []byte) [32]byte

func FileExist

func FileExist(f string) bool

func FileIsDir

func FileIsDir(p string) bool

func FileMimeType

func FileMimeType(path string) (ret string)

Types

type Log

type Log struct {
	Logger *log.Logger
	OutFD  *os.File
}

func NewLog

func NewLog(out io.Writer) *Log

func (*Log) Access

func (L *Log) Access(r *http.Request)

func (*Log) Error

func (L *Log) Error(s string, args ...interface{})

func (*Log) Fatal

func (L *Log) Fatal(s string, args ...interface{})

func (*Log) Info

func (L *Log) Info(s string, args ...interface{})

func (*Log) Panic

func (L *Log) Panic(s string, args ...interface{})

type LogRequest

type LogRequest struct {
	RemoteAddr    string `json:"remote_addr"`
	RemoteUA      string `json:"remote_ua"`
	RequestMethod string `json:"request_method"`
	RequestProto  string `json:"request_proto"`
	RequestURI    string `json:"request_uri"`
}

func ToLogRequest

func ToLogRequest(r *http.Request) *LogRequest

Jump to

Keyboard shortcuts

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