model

package
v1.5.11 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditEvent

type AuditEvent struct {
	Id        uint64          `json:"id" gorm:"primaryKey;autoIncrement"`
	DateTime  int64           `json:"dateTime" gorm:"index"`
	Actor     string          `json:"actor" gorm:"index"`
	Event     string          `json:"event" gorm:"index"`
	Resource  string          `json:"resource"`
	Severity  string          `json:"severity" gorm:"index"`
	IP        string          `json:"ip"`
	UserAgent string          `json:"userAgent"`
	Details   json.RawMessage `json:"details"`
}

type Changes

type Changes struct {
	Id       uint64          `json:"id" gorm:"primaryKey;autoIncrement"`
	DateTime int64           `json:"dateTime"`
	Actor    string          `json:"actor"`
	Key      string          `json:"key"`
	Action   string          `json:"action"`
	Obj      json.RawMessage `json:"obj"`
}

type Client

type Client struct {
	Id          uint            `json:"id" form:"id" gorm:"primaryKey;autoIncrement"`
	Enable      bool            `json:"enable" form:"enable"`
	Name        string          `json:"name" form:"name"`
	SubSecret   string          `json:"subSecret,omitempty" form:"subSecret" gorm:"index"`
	Config      json.RawMessage `json:"config,omitempty" form:"config"`
	Inbounds    json.RawMessage `json:"inbounds" form:"inbounds"`
	Links       json.RawMessage `json:"links,omitempty" form:"links"`
	Volume      int64           `json:"volume" form:"volume"`
	Expiry      int64           `json:"expiry" form:"expiry"`
	Down        int64           `json:"down" form:"down"`
	Up          int64           `json:"up" form:"up"`
	Desc        string          `json:"desc" form:"desc"`
	Group       string          `json:"group" form:"group"`
	LimitIP     int             `json:"limitIp" form:"limitIp" gorm:"default:0;not null"`
	IPLimitMode string          `json:"ipLimitMode" form:"ipLimitMode" gorm:"default:monitor;not null"`
	LastOnline  int64           `json:"lastOnline" form:"lastOnline" gorm:"default:0;not null"`
	LastIPCount int             `json:"lastIpCount" form:"lastIpCount" gorm:"default:0;not null"`

	// Delay start and periodic reset
	DelayStart bool  `json:"delayStart" form:"delayStart" gorm:"default:false;not null"`
	AutoReset  bool  `json:"autoReset" form:"autoReset" gorm:"default:false;not null"`
	ResetDays  int   `json:"resetDays" form:"resetDays" gorm:"default:0;not null"`
	NextReset  int64 `json:"nextReset" form:"nextReset" gorm:"default:0;not null"`
	TotalUp    int64 `json:"totalUp" form:"totalUp" gorm:"default:0;not null"`
	TotalDown  int64 `json:"totalDown" form:"totalDown" gorm:"default:0;not null"`
}

type ClientIP

type ClientIP struct {
	Id         uint64 `json:"id" gorm:"primaryKey;autoIncrement"`
	ClientName string `json:"clientName" gorm:"index:idx_client_ips_client_hash,unique"`
	// IP column kept empty for new rows; populated only on legacy backfill. ip_hash is the canonical lookup key.
	IP        string  `json:"ip"`
	IPHash    string  `json:"ipHash,omitempty" gorm:"index:idx_client_ips_client_hash,unique"`
	IPDisplay *string `json:"ipDisplay,omitempty"`
	FirstSeen int64   `json:"firstSeen"`
	LastSeen  int64   `json:"lastSeen" gorm:"index"`
}

type Endpoint

type Endpoint struct {
	Id      uint            `json:"id" form:"id" gorm:"primaryKey;autoIncrement"`
	Type    string          `json:"type" form:"type"`
	Tag     string          `json:"tag" form:"tag" gorm:"unique"`
	Options json.RawMessage `json:"-" form:"-"`
	Ext     json.RawMessage `json:"ext" form:"ext"`
}

func (Endpoint) MarshalJSON

func (o Endpoint) MarshalJSON() ([]byte, error)

MarshalJSON customizes marshalling

func (*Endpoint) UnmarshalJSON

func (o *Endpoint) UnmarshalJSON(data []byte) error

type Inbound

type Inbound struct {
	Id   uint   `json:"id" form:"id" gorm:"primaryKey;autoIncrement"`
	Type string `json:"type" form:"type"`
	Tag  string `json:"tag" form:"tag" gorm:"unique"`

	// Foreign key to tls table
	TlsId uint `json:"tls_id" form:"tls_id"`
	Tls   *Tls `json:"tls" form:"tls" gorm:"foreignKey:TlsId;references:Id"`

	Addrs   json.RawMessage `json:"addrs" form:"addrs"`
	OutJson json.RawMessage `json:"out_json" form:"out_json"`
	Options json.RawMessage `json:"-" form:"-"`
}

func (Inbound) MarshalFull

func (i Inbound) MarshalFull() (*map[string]interface{}, error)

func (Inbound) MarshalJSON

func (i Inbound) MarshalJSON() ([]byte, error)

MarshalJSON customizes marshalling

func (*Inbound) UnmarshalJSON

func (i *Inbound) UnmarshalJSON(data []byte) error

type Outbound

type Outbound struct {
	Id      uint            `json:"id" form:"id" gorm:"primaryKey;autoIncrement"`
	Type    string          `json:"type" form:"type"`
	Tag     string          `json:"tag" form:"tag" gorm:"unique"`
	Options json.RawMessage `json:"-" form:"-"`
}

func (Outbound) MarshalJSON

func (o Outbound) MarshalJSON() ([]byte, error)

MarshalJSON customizes marshalling

func (*Outbound) UnmarshalJSON

func (o *Outbound) UnmarshalJSON(data []byte) error

type Service

type Service struct {
	Id   uint   `json:"id" form:"id" gorm:"primaryKey;autoIncrement"`
	Type string `json:"type" form:"type"`
	Tag  string `json:"tag" form:"tag" gorm:"unique"`

	// Foreign key to tls table
	TlsId uint `json:"tls_id" form:"tls_id"`
	Tls   *Tls `json:"tls" form:"tls" gorm:"foreignKey:TlsId;references:Id"`

	Options json.RawMessage `json:"-" form:"-"`
}

func (Service) MarshalFull

func (i Service) MarshalFull() (*map[string]interface{}, error)

func (Service) MarshalJSON

func (i Service) MarshalJSON() ([]byte, error)

MarshalJSON customizes marshalling

func (*Service) UnmarshalJSON

func (i *Service) UnmarshalJSON(data []byte) error

type Setting

type Setting struct {
	Id    uint   `json:"id" form:"id" gorm:"primaryKey;autoIncrement"`
	Key   string `json:"key" form:"key"`
	Value string `json:"value" form:"value"`
}

type Stats

type Stats struct {
	Id        uint64 `json:"id" gorm:"primaryKey;autoIncrement"`
	DateTime  int64  `json:"dateTime"`
	Resource  string `json:"resource"`
	Tag       string `json:"tag"`
	Direction bool   `json:"direction"`
	Traffic   int64  `json:"traffic"`
}

type Tls

type Tls struct {
	Id     uint            `json:"id" form:"id" gorm:"primaryKey;autoIncrement"`
	Name   string          `json:"name" form:"name"`
	Server json.RawMessage `json:"server" form:"server"`
	Client json.RawMessage `json:"client" form:"client"`
}

type Tokens

type Tokens struct {
	Id          uint   `json:"id" form:"id" gorm:"primaryKey;autoIncrement"`
	Desc        string `json:"desc" form:"desc"`
	Token       string `json:"-" form:"token"`
	TokenHash   string `json:"-" gorm:"index"`
	TokenPrefix string `json:"tokenPrefix"`
	Scope       string `json:"scope" gorm:"default:admin;not null"`
	Enabled     bool   `json:"enabled" gorm:"default:true;not null"`
	Expiry      int64  `json:"expiry" form:"expiry"`
	CreatedAt   int64  `json:"createdAt"`
	UpdatedAt   int64  `json:"updatedAt"`
	LastUsedAt  int64  `json:"lastUsedAt"`
	LastUsedIP  string `json:"lastUsedIp"`
	UserId      uint   `json:"userId" form:"userId"`
	User        *User  `json:"user" gorm:"foreignKey:UserId;references:Id"`
}

type User

type User struct {
	Id                 uint   `json:"id" form:"id" gorm:"primaryKey;autoIncrement"`
	Username           string `json:"username" form:"username"`
	Password           string `json:"password" form:"password"`
	LastLogins         string `json:"lastLogin"`
	ForcePasswordReset bool   `json:"forcePasswordReset" form:"forcePasswordReset" gorm:"column:force_password_reset;default:false;not null"`
}

Jump to

Keyboard shortcuts

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