goscope

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2020 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BytesInOneGigabyte = 1073741824
	SecondsInOneMinute = 60
)

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

Check the wanted path is not in the do not log list.

func GetAppName added in v1.2.0

func GetAppName(c *gin.Context)

func GetMimeType added in v1.3.1

func GetMimeType(filename string) string

Get the mime type of a file by its name.

func GetStaticFile added in v1.2.0

func GetStaticFile(c *gin.Context)

func LogList added in v1.2.0

func LogList(c *gin.Context)

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 NoRouteResponseLogger added in v1.7.2

func NoRouteResponseLogger(c *gin.Context)

func RequestList added in v1.2.0

func RequestList(c *gin.Context)

func ResponseLogger

func ResponseLogger(c *gin.Context)

Log an HTTP response to the DB and print to Stdout.

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 SearchLogOptions added in v1.2.0

func SearchLogOptions(c *gin.Context)

func SearchRequest added in v1.1.0

func SearchRequest(c *gin.Context)

func SearchRequestOptions added in v1.2.0

func SearchRequestOptions(c *gin.Context)

func Setup

func Setup(router *gin.Engine, goScopeGroup *gin.RouterGroup)

func ShowDashboard added in v1.1.6

func ShowDashboard(c *gin.Context)

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)

Show system information of the current host.

Types

type BodyLogWriter

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

func (BodyLogWriter) Write

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

HTTP request body object.

type BodyLogWriterResponse added in v1.7.2

type BodyLogWriterResponse struct {
	Blw *BodyLogWriter
	Rdr io.ReadCloser
}

func ObtainBodyLogWriter added in v1.7.2

func ObtainBodyLogWriter(c *gin.Context) BodyLogWriterResponse

type DetailedRequest

type DetailedRequest struct {
	Body      string `json:"body"`
	ClientIP  string `json:"clientIP"`
	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:"userAgent"`
}

func GetDetailedRequest

func GetDetailedRequest(requestUID string) DetailedRequest

Get all details from a request via its UID.

type DetailedResponse

type DetailedResponse struct {
	Body       string `json:"body"`
	ClientIP   string `json:"clientIP"`
	Headers    string `json:"headers"`
	Path       string `json:"path"`
	Size       int    `json:"size"`
	Status     string `json:"status"`
	Time       int    `json:"time"`
	RequestUID string `json:"requestUID"`
	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 GetLogs

func GetLogs(offset int) []ExceptionRecord

Get a summarized list of application logs from the DB.

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 added in v1.1.6

type RecordByURI struct {
	UID string `uri:"id" binding:"required"`
}

type SearchRequestPayload added in v1.1.0

type SearchRequestPayload struct {
	Query  string                 `json:"query"`
	Filter database.RequestFilter `json:"filter"`
}

type SummarizedRequest

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

func GetRequests

func GetRequests(offset int) []SummarizedRequest

func SearchRequests added in v1.1.0

func SearchRequests(search string, filter *database.RequestFilter, offset int) []SummarizedRequest

type SummarizedResponse

type SummarizedResponse struct {
	RequestUID string `json:"requestUID"`
	ClientIP   string `json:"clientIP"`
	Path       string `json:"path"`
	Status     string `json:"status"`
	Time       int    `json:"time"`
	UID        string `json:"uid"`
}

type SystemInformationResponse added in v1.3.8

type SystemInformationResponse struct {
	ApplicationName string                          `json:"applicationName"`
	CPU             SystemInformationResponseCPU    `json:"cpu"`
	Disk            SystemInformationResponseDisk   `json:"disk"`
	Host            SystemInformationResponseHost   `json:"host"`
	Memory          SystemInformationResponseMemory `json:"memory"`
}

type SystemInformationResponseCPU added in v1.3.8

type SystemInformationResponseCPU struct {
	CoreCount string `json:"coreCount"`
	ModelName string `json:"modelName"`
}

type SystemInformationResponseDisk added in v1.3.8

type SystemInformationResponseDisk struct {
	FreeSpace     string `json:"freeSpace"`
	MountPath     string `json:"mountPath"`
	PartitionType string `json:"partitionType"`
	TotalSpace    string `json:"totalSpace"`
}

type SystemInformationResponseHost added in v1.3.8

type SystemInformationResponseHost struct {
	HostOS        string `json:"hostOS"`
	HostPlatform  string `json:"hostPlatform"`
	Hostname      string `json:"hostname"`
	KernelArch    string `json:"kernelArch"`
	KernelVersion string `json:"kernelVersion"`
	Uptime        string `json:"uptime"`
}

type SystemInformationResponseMemory added in v1.3.8

type SystemInformationResponseMemory struct {
	Available string `json:"availableMemory"`
	Total     string `json:"totalMemory"`
	UsedSwap  string `json:"usedSwap"`
}

Jump to

Keyboard shortcuts

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