system

package
v1.0.0-pre Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

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

func NewController

func NewController() *Controller

func (*Controller) RegisterRoute

func (c *Controller) RegisterRoute(group *gin.RouterGroup)

type Record

type Record struct {
	ID        uuid.UUID `json:"id" gorm:"primary_key;type:uuid;"`
	UserID    string    `json:"userId" gorm:"not null;default:'unknown'"`
	Path      string    `json:"path" gorm:"not null;"`
	Method    string    `json:"method" gorm:"not null;"`
	Code      string    `json:"code" gorm:"not null;"`
	ClientIP  string    `json:"clientIp" gorm:"not null;"`
	UserAgent string    `json:"userAgent" gorm:"not null;"`
	Cost      int64     `json:"cost" gorm:"not null;"`
	IsApi     bool      `json:"-"`

	database.BaseModel
}

func (*Record) BeforeCreate

func (r *Record) BeforeCreate(tx *gorm.DB) error

func (*Record) TableName

func (r *Record) TableName() string

type Service

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

func GetService

func GetService() *Service

func (*Service) GetStatistic

func (s *Service) GetStatistic() ([]*Statistic, error)

func (*Service) GetVersionInfo added in v0.0.3

func (s *Service) GetVersionInfo() *Version

func (*Service) Initialize

func (s *Service) Initialize() error

func (*Service) InsertRecord

func (s *Service) InsertRecord(record *Record) error

type Statistic

type Statistic struct {
	Name  string `json:"name"`
	Count string `json:"count"`
	Path  string `json:"path"`
	Icon  string `json:"icon"`
}

type Version added in v0.0.3

type Version struct {
	Version       string `json:"version"`
	LatestVersion string `json:"latestVersion"`
	LatestInfo    string `json:"latestInfo"`
	LatestUrl     string `json:"latestUrl"`
}

Jump to

Keyboard shortcuts

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