models

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Task

type Task struct {
	ID               uint                   `json:"id" gorm:"primaryKey"`
	WebhookID        uint                   `json:"webhook_id" gorm:"not null" validate:"required"`
	Name             string                 `json:"name" gorm:"size:255"`
	Service          string                 `json:"service" gorm:"size:255" validate:"required"`
	ServiceParams    map[string]interface{} `json:"service_params" gorm:"-"`
	ServiceParamsRaw string                 `json:"-"` // Database field
	CreatedAt        time.Time              `json:"created_at" gorm:"autoCreateTime"`
	UpdatedAt        time.Time              `json:"updated_at" gorm:"autoUpdateTime"`
}

func (*Task) AfterFind added in v1.1.0

func (t *Task) AfterFind(tx *gorm.DB) (err error)

func (*Task) BeforeSave added in v1.1.0

func (t *Task) BeforeSave(tx *gorm.DB) (err error)

type UpdaetValue

type UpdaetValue struct {
	IPv4 netip.Addr `json:"ipv4"`
	IPv6 netip.Addr `json:"ipv6"`
}

type UpdateResult

type UpdateResult struct {
	Success bool   `json:"success"`
	Domain  string `json:"domain"`
	Record  string `json:"record"`
}

type User

type User struct {
	ID        uint      `json:"id" gorm:"primaryKey"`
	Username  string    `json:"username" gorm:"unique;size:255" validate:"required"`
	Password  string    `json:"password,omitempty" gorm:"size:255" validate:"required"`
	Email     string    `json:"email" gorm:"size:255" validate:"omitempty,email"`
	CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"`
	UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"`
}

func (User) MarshalJSON

func (u User) MarshalJSON() ([]byte, error)

type Webhook

type Webhook struct {
	ID        uint      `json:"id" gorm:"primaryKey"`
	UserID    uint      `json:"user_id" gorm:"not null" validate:"required"`
	Name      string    `json:"name" gorm:"size:255"`
	Token     string    `json:"token" gorm:"size:255"`
	IPv4      string    `json:"ipv4" gorm:"size:255"`
	IPv6      string    `json:"ipv6" gorm:"size:255"`
	CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"`
	UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"`
}

Jump to

Keyboard shortcuts

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