goscope

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2020 License: MIT Imports: 29 Imported by: 0

Documentation

Overview

License: MIT Authors:

  • Josep Bigorra (averageflow)

License: MIT Authors:

  • Josep Bigorra (averageflow)

License: MIT Authors:

  • Josep Bigorra (averageflow)

License: MIT Authors:

  • Josep Bigorra (averageflow)

License: MIT Authors:

  • Josep Bigorra (averageflow)

Index

Constants

View Source
const (
	BytesInOneGigabyte = 1073741824
)

Variables

This section is empty.

Functions

func Asset added in v1.0.6

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir added in v1.0.6

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetInfo added in v1.0.6

func AssetInfo(name string) (os.FileInfo, error)

AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetNames added in v1.0.6

func AssetNames() []string

AssetNames returns the names of the assets. nolint: deadcode

func CheckExcludedPaths

func CheckExcludedPaths(path string) bool

func CheckVariablesAreSet added in v1.0.4

func CheckVariablesAreSet()

func Dashboard

func Dashboard(c *gin.Context)

func DumpResponse

func DumpResponse(c *gin.Context, blw *BodyLogWriter, body string)

func GetDB added in v1.0.4

func GetDB() *sql.DB

func GetLogs

func GetLogs(c *gin.Context)

func GetRequests

func GetRequests(c *gin.Context)

func LogDashboard

func LogDashboard(c *gin.Context)

func MinifyCss added in v1.0.6

func MinifyCss(uncompressed string) string

func MinifyHtml added in v1.0.6

func MinifyHtml(uncompressed string) string

func MinifyJs added in v1.0.6

func MinifyJs(uncompressed string) string

func MustAsset added in v1.0.6

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables. nolint: deadcode

func ReplaceVariablesInTemplate

func ReplaceVariablesInTemplate(rawTemplate string, variables map[string]string) string

func ResponseLogger

func ResponseLogger(c *gin.Context)

func RestoreAsset added in v1.0.6

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets added in v1.0.6

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively

func SearchLog added in v1.1.0

func SearchLog(c *gin.Context)

func SearchRequest added in v1.1.0

func SearchRequest(c *gin.Context)

func Setup

func Setup(engine *gin.Engine)

func ShowGoScopePage

func ShowGoScopePage(c *gin.Context, rawTemplate string, variables map[string]string)

func ShowLog

func ShowLog(c *gin.Context)

func ShowRequest

func ShowRequest(c *gin.Context)

func ShowSystemInfo added in v1.1.2

func ShowSystemInfo(c *gin.Context)

func UnixTimeToHuman added in v1.0.4

func UnixTimeToHuman(rawTime int) string

Types

type BodyLogWriter

type BodyLogWriter struct {
	gin.ResponseWriter
	// contains filtered or unexported fields
}

func (BodyLogWriter) Write

func (w BodyLogWriter) Write(b []byte) (int, error)

type DetailedRequest

type DetailedRequest struct {
	Body      string `json:"body"`
	ClientIp  string `json:"client_ip"`
	Headers   string `json:"headers"`
	Host      string `json:"host"`
	Method    string `json:"method"`
	Path      string `json:"path"`
	Referrer  string `json:"referrer"`
	Time      int    `json:"time"`
	Uid       string `json:"uid"`
	Url       string `json:"url"`
	UserAgent string `json:""`
}

func GetDetailedRequest

func GetDetailedRequest(requestUid string) DetailedRequest

type DetailedResponse

type DetailedResponse struct {
	Body       string `json:"body"`
	ClientIp   string `json:"client_ip"`
	Headers    string `json:"headers"`
	Path       string `json:"path"`
	Size       int    `json:"size"`
	Status     string `json:"status"`
	Time       int    `json:"time"`
	RequestUid string `json:"request_uid"`
	Uid        string `json:"uid"`
}

func GetDetailedResponse

func GetDetailedResponse(requestUid string) DetailedResponse

type ExceptionRecord

type ExceptionRecord struct {
	Error string `json:"error"`
	Time  int    `json:"time"`
	Uid   string `json:"uid"`
}

func GetDetailedLog

func GetDetailedLog(requestUid string) ExceptionRecord

func SearchLogs added in v1.1.0

func SearchLogs(searchString string, offset int) []ExceptionRecord

type LoggerGoScope

type LoggerGoScope struct {
	RoutingEngine *gin.Engine
}

func (LoggerGoScope) Write

func (logger LoggerGoScope) Write(p []byte) (n int, err error)

type RecordByUri

type RecordByUri struct {
	Uid string `uri:"id" binding:"required"`
}

type SearchRequestPayload added in v1.1.0

type SearchRequestPayload struct {
	Query string `json:"query"`
}

type SummarizedRequest

type SummarizedRequest struct {
	Method         string `json:"method"`
	Path           string `json:"path"`
	Time           int    `json:"time"`
	Uid            string `json:"uid"`
	ResponseStatus int    `json:"response_status"`
}

func SearchRequests added in v1.1.0

func SearchRequests(searchString string, offset int) []SummarizedRequest

type SummarizedResponse

type SummarizedResponse struct {
	RequestUid string `json:"request_uid"`
	ClientIp   string `json:"client_ip"`
	Path       string `json:"path"`
	Status     string `json:"status"`
	Time       int    `json:"time"`
	Uid        string `json:"uid"`
}

Jump to

Keyboard shortcuts

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