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)
Index ¶
- Constants
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func CheckExcludedPaths(path string) bool
- func CheckVariablesAreSet()
- func DumpResponse(c *gin.Context, blw *BodyLogWriter, body string)
- func GetAppName(c *gin.Context)
- func GetDB() *sql.DB
- func GetMimeType(filename string) string
- func GetStaticFile(c *gin.Context)
- func LogList(c *gin.Context)
- func MustAsset(name string) []byte
- func RequestList(c *gin.Context)
- func ResponseLogger(c *gin.Context)
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- func SearchLog(c *gin.Context)
- func SearchLogOptions(c *gin.Context)
- func SearchRequest(c *gin.Context)
- func SearchRequestOptions(c *gin.Context)
- func Setup(engine *gin.Engine)
- func ShowDashboard(c *gin.Context)
- func ShowLog(c *gin.Context)
- func ShowRequest(c *gin.Context)
- func ShowSystemInfo(c *gin.Context)
- type BodyLogWriter
- type DetailedRequest
- type DetailedResponse
- type ExceptionRecord
- type LoggerGoScope
- type RecordByURI
- type SearchRequestPayload
- type SummarizedRequest
- type SummarizedResponse
Constants ¶
const ( BytesInOneGigabyte = 1073741824 SecondsInOneMinute = 60 )
const ( LogDashboardMode = iota RequestDashboardMode )
Variables ¶
This section is empty.
Functions ¶
func Asset ¶ added in v1.0.6
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
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
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 ¶
Check the wanted path is not in the do not log list.
func CheckVariablesAreSet ¶ added in v1.0.4
func CheckVariablesAreSet()
Ensure necessary application variables are set.
func DumpResponse ¶
func DumpResponse(c *gin.Context, blw *BodyLogWriter, body string)
func GetAppName ¶ added in v1.2.0
func GetMimeType ¶ added in v1.3.1
Get the mime type of a file by its name.
func GetStaticFile ¶ added in v1.2.0
func MustAsset ¶ added in v1.0.6
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables. nolint: deadcode
func RequestList ¶ added in v1.2.0
func ResponseLogger ¶
Log an HTTP response to the DB and print to Stdout.
func RestoreAsset ¶ added in v1.0.6
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶ added in v1.0.6
RestoreAssets restores an asset under the given directory recursively
func SearchLogOptions ¶ added in v1.2.0
func SearchRequest ¶ added in v1.1.0
func SearchRequestOptions ¶ added in v1.2.0
func ShowDashboard ¶ added in v1.1.6
func ShowRequest ¶
func ShowSystemInfo ¶ added in v1.1.2
Show system information of the current host.
Types ¶
type BodyLogWriter ¶
type BodyLogWriter struct {
gin.ResponseWriter
// contains filtered or unexported fields
}
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 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"`
}
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(searchString string, offset int) []SummarizedRequest