Documentation ¶
Index ¶
- Constants
- Variables
- func LogAlert(value interface{})
- func LogCritical(value interface{})
- func LogDebug(value interface{})
- func LogEmergency(value interface{})
- func LogError(value interface{})
- func LogInfo(value interface{})
- func LogNotice(value interface{})
- func LogWarning(value interface{})
- func PrepareMiddleware(d *InitData)
- func PrepareTemplateEngine(d *InitData) *template.Template
- type BodyLogWriter
- type BodyLogWriterResponse
- type Environment
- type InitData
- type PageStateData
- type RecordByURI
- type SearchRequestPayload
Constants ¶
View Source
const ( BytesInOneGigabyte = 1073741824 SecondsInOneMinute = 60 )
Variables ¶
View Source
var DB *sql.DB //nolint:gochecknoglobals
Functions ¶
func LogCritical ¶ added in v3.1.0
func LogCritical(value interface{})
func LogEmergency ¶ added in v3.1.0
func LogEmergency(value interface{})
func LogWarning ¶ added in v3.1.0
func LogWarning(value interface{})
func PrepareMiddleware ¶
func PrepareMiddleware(d *InitData)
PrepareMiddleware is the necessary step to enable GoScope in an application. It will setup the necessary routes and middlewares for GoScope to work.
func PrepareTemplateEngine ¶
Types ¶
type BodyLogWriter ¶
type BodyLogWriter struct { gin.ResponseWriter Body *bytes.Buffer }
type BodyLogWriterResponse ¶
type BodyLogWriterResponse struct { Blw *BodyLogWriter Rdr io.ReadCloser }
type Environment ¶
type Environment struct { // ApplicationID is a string used to identify your application. // This allows having a single go_scope database for several applications. ApplicationID string // ApplicationName is the name to display in the header of the frontend and in API responses. ApplicationName string // ApplicationTimezone is the Go formatted timezone, e.g. Europe/Amsterdam ApplicationTimezone string // GoScopeDatabaseConnection is the string to connect to the desired database GoScopeDatabaseConnection string // GoScopeDatabaseType is the type of DB to connect to, e.g. the connector name, mysql GoScopeDatabaseType string // GoScopeEntriesPerPage is how many logs & requests to show per page GoScopeEntriesPerPage int // HasFrontendDisabled decides if the frontend should be accessible HasFrontendDisabled bool // GoScopeDatabaseMaxOpenConnections is the maximum open connections of the DB pool GoScopeDatabaseMaxOpenConnections int // GoScopeDatabaseMaxIdleConnections is the maximum idle connections of the DB pool GoScopeDatabaseMaxIdleConnections int // GoScopeDatabaseMaxConnLifetime is the maximum connection lifetime of each connection of the DB pool GoScopeDatabaseMaxConnLifetime int // BaseURL determines where in the route group goscope is based on BaseURL string }
Environment is the required application environment variables.
var Config Environment //nolint:gochecknoglobals
Config is the global instance of the application's configuration.
type InitData ¶
type InitData struct { // Router represents the gin.Engine to attach the routes to Router *gin.Engine // RouteGroup represents the gin.RouterGroup to attach the GoScope routes to RouteGroup *gin.RouterGroup // Config represents the required variables to initialize GoScope Config *Environment }
type PageStateData ¶ added in v3.0.1
type PageStateData struct { ApplicationName string `json:"applicationName"` EntriesPerPage int `json:"entriesPerPage"` Data interface{} `json:"data"` BaseURL string `json:"baseURL"` Offset int `json:"offset"` SearchValue string `json:"searchValue"` SearchMode int `json:"searchMode"` AdvancedSearchEnabled bool `json:"advancedSearchEnabled"` SearchEnabled bool `json:"searchEnabled"` }
type RecordByURI ¶
type RecordByURI struct {
UID string `uri:"id" binding:"required"`
}
type SearchRequestPayload ¶
Click to show internal directories.
Click to hide internal directories.