base

package
v0.0.0-...-7d0d6c4 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatError

func FormatError(title string, logtarget string, err interface{}) (errmsg string)

Types

type ErrorInfo

type ErrorInfo struct {
	URL    string
	ErrMsg string
	Num    uint64
}

type HideDirFS

type HideDirFS struct {
	FileSystem http.FileSystem
}

func (HideDirFS) Open

func (fs HideDirFS) Open(name string) (http.File, error)

type HttpCodeInfo

type HttpCodeInfo struct {
	URL  string
	Code int
	Num  uint64
}

type MJwt

type MJwt struct {
	Domain       string
	Expire       int64
	Name         string
	SignKey      []byte
	CookieMaxAge int64
	// contains filtered or unexported fields
}

json web token

func NewJwt

func NewJwt(domain string, expire int64, tokenName string, signKey []byte, maxAge int64) *MJwt

func (*MJwt) CleanCookie

func (j *MJwt) CleanCookie(rw http.ResponseWriter)

func (*MJwt) GenerateSeesionToken

func (j *MJwt) GenerateSeesionToken(rw http.ResponseWriter, mapClaims jwt.MapClaims)

func (*MJwt) GenerateToken

func (j *MJwt) GenerateToken(rw http.ResponseWriter, mapClaims jwt.MapClaims)

func (*MJwt) VerifyToken

func (j *MJwt) VerifyToken(r *http.Request, v *map[string]interface{}) bool

type RequestInfo

type RequestInfo struct {
	URL  string
	Code int
	Num  uint64
}

type State

type State struct {
	ServerStartTime         time.Time
	EnableDetailRequestData bool
	TotalRequestCount       uint64

	IntervalRequestData *Store
	DetailRequstURLData *Store
	TotalErrorCount     uint64
	IntervalErrorData   *Store
	DetailErrorPageData *Store
	DetailErrorData     *Store
	DetailHTTPCodeData  *Store
	// contains filtered or unexported fields
}
var GlobalState *State

func (*State) AddErrorCount

func (s *State) AddErrorCount(page string, err error, num uint64) uint64

func (*State) AddHTTPCodeData

func (s *State) AddHTTPCodeData(page string, code int, num uint64)

func (*State) AddRequestCount

func (s *State) AddRequestCount(page string, code int, num uint64) uint64

func (*State) QueryIntervalErrorData

func (s *State) QueryIntervalErrorData(key string) uint64

func (*State) QueryIntervalRequstData

func (s *State) QueryIntervalRequstData(key string) uint64

func (*State) ShowData

func (s *State) ShowData(dataType string) string

type Store

type Store struct {
	sync.Map
}

func NewStore

func NewStore() *Store

func (*Store) All

func (s *Store) All() map[string]interface{}

func (*Store) Exists

func (s *Store) Exists(key interface{}) bool

func (*Store) GetUint64

func (s *Store) GetUint64(key interface{}) (uint64, bool)

func (*Store) Len

func (s *Store) Len() uint

Jump to

Keyboard shortcuts

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