event

package
v0.0.0-...-13b120a Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	// contains filtered or unexported fields
}

func New

func New(db *sqlx.DB) Event

func (*Event) GetEventLogWithLimit

func (e *Event) GetEventLogWithLimit(limit int) ([]EventLogMessage, error)

GetEventLogWithLimit will fetch a list of event messages with a count limit

func (*Event) GetEventLogWithLimitRequest

func (e *Event) GetEventLogWithLimitRequest(r *http.Request) ([]EventLogMessage, error)

GetEventLogWithLimitRequest parses a GET request that contains the variable "count" and fetching a list of event messages with that given count.

func (*Event) LogEvent

func (e *Event) LogEvent(category string, message string, v ...interface{})

NewEvent stores an event message to the database

type EventLogMessage

type EventLogMessage struct {
	ID        int        `db:"id" json:"id"`
	Category  string     `db:"category" json:"category"`
	Message   string     `db:"message" json:"message"`
	EventTime *time.Time `db:"event_time" json:"event_time"`
}

Jump to

Keyboard shortcuts

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