goscope

package
v3.1.1 Latest Latest
Warning

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

Go to latest
Published: May 12, 2021 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BytesInOneGigabyte = 1073741824
	SecondsInOneMinute = 60
)

Variables

View Source
var DB *sql.DB //nolint:gochecknoglobals

Functions

func LogAlert added in v3.1.0

func LogAlert(value interface{})

func LogCritical added in v3.1.0

func LogCritical(value interface{})

func LogDebug added in v3.1.0

func LogDebug(value interface{})

func LogEmergency added in v3.1.0

func LogEmergency(value interface{})

func LogError added in v3.1.0

func LogError(value interface{})

func LogInfo added in v3.1.0

func LogInfo(value interface{})

func LogNotice added in v3.1.0

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

func PrepareTemplateEngine(d *InitData) *template.Template

Types

type BodyLogWriter

type BodyLogWriter struct {
	gin.ResponseWriter
	Body *bytes.Buffer
}

func (BodyLogWriter) Write

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

HTTP request body object.

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

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

Jump to

Keyboard shortcuts

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