model

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate

func Migrate(db *gorm.DB) error

func TxAddLogEntries

func TxAddLogEntries(db *gorm.DB, entries []*LogEntry) error

Types

type LogEntry

type LogEntry struct {
	ID        uint      `gorm:"primary_key"`
	Timestamp time.Time `gorm:"index;not null;type:timestamp"`
	App       string    `gorm:"index;not null;type:varchar(16)"`
	Level     string    `gorm:"index;not null;type:varchar(16)"`

	// Optionals
	UserID    uint64 `gorm:"index"`
	SessionID string `gorm:"index;type:char(36)"` // UUID
	Method    string `gorm:"index;type:varchar(48)"`
	Error     string `gorm:"index;type:varchar(256)"`

	Message string `gorm:"type:varchar(256)"`
	Data    string `gorm:"type:json"`
}

type LogInfo added in v0.1.0

type LogInfo struct {
	Warnings int
	Errors   int
	Panics   int
}

func LogsInfo added in v0.1.0

func LogsInfo(db *gorm.DB) (LogInfo, error)

Jump to

Keyboard shortcuts

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