log

package
v1.0.40 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorLogMessageType = "error"
	AuditLogMessageType = "audit"
	SignInMessageType   = "signin"

	AuditLoginAction      = "login"
	AuditNavigationAction = "navigation"
	AuditUpdateAction     = "update"
	AuditDeleteAction     = "delete"
	AuditLogoutAction     = "logout"
)
View Source
const EmptyRequestObjectErrorMessage = "no request object was set to get %s"

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditItem

type AuditItem struct {
	Cod              string `json:"cod"`
	Id               string `json:"id"`
	Token            string `json:"token"`
	Login            string `json:"login"`
	ServiceName      string `json:"serviceName"`
	File             string `json:"file"`
	Ip               string `json:"ip"`
	UserAgent        string `json:"userAgent"`
	Action           string `json:"action"`
	Referer          string `json:"referer"`
	Route            string `json:"route"`
	StateBefore      string `json:"stateBefore"`
	StateAfter       string `json:"stateAfter"`
	CustomParameters string `json:"customParameters"`
	Type             string `json:"type"`
}

func NewAuditItem

func NewAuditItem() *AuditItem

func (*AuditItem) SetCod

func (a *AuditItem) SetCod(cod string) *AuditItem

func (*AuditItem) SetId

func (a *AuditItem) SetId(id string) *AuditItem

func (*AuditItem) SetLogin

func (a *AuditItem) SetLogin(login string) *AuditItem

func (*AuditItem) SetToken

func (a *AuditItem) SetToken(token string) *AuditItem

type AuditLogger

type AuditLogger struct {
	Config  gqueue.Config
	Request http.Request
}

func NewAuditLogger

func NewAuditLogger(c gqueue.Config) *AuditLogger

func (*AuditLogger) SendAuditLog

func (a *AuditLogger) SendAuditLog(item AuditItem) error

func (*AuditLogger) SetRequest

func (a *AuditLogger) SetRequest(r *http.Request)

Jump to

Keyboard shortcuts

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