models

package
v0.0.0-...-17500d5 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthKeys

type AuthKeys struct {
	gorm.Model
	Username string    `gorm:"unique" json:"username"`
	Key      string    `json:"key"`
	Expiry   time.Time `json:"expiry"`
}

type Client

type Client struct {
	gorm.Model
	Type         string  `json:"type"`
	IP           string  `gorm:"unique" json:"ip"`
	Username     *string `json:"username,omitempty"`
	Count        int     `gorm:"default:0" json:"count"`
	Active       *bool   `json:"active,omitempty"`
	DataSent     *int64  `json:"dataSent,omitempty"`
	DataReceived *int64  `json:"dataReceived,omitempty"`
}

func (*Client) BeforeSave

func (c *Client) BeforeSave(tx *gorm.DB) (err error)

func (Client) MarshalJSON

func (c Client) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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