goscope

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Copyright © 2020 Pro Warehouse B.V. All Rights Reserved

Copyright © 2020 Pro Warehouse B.V. All Rights Reserved

Copyright © 2020 Pro Warehouse B.V. All Rights Reserved

Copyright © 2020 Pro Warehouse B.V. All Rights Reserved

Copyright © 2020 Pro Warehouse B.V. All Rights Reserved

Copyright © 2020 Pro Warehouse B.V. All Rights Reserved

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 ReplaceVariablesInTemplate

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

func ResponseLogger

func ResponseLogger(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 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

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 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"`
}

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