request

package
v0.0.0-...-d8a4e70 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Slug    string `json:"slug" form:"slug" validate:"required|notExists:apps,slug"`
	Channel string `json:"channel" form:"channel" validate:"required"`
}

type AppSlug

type AppSlug struct {
	Slug string `json:"slug" form:"slug" validate:"required"`
}

type AppUpdateShow

type AppUpdateShow struct {
	Slug string `json:"slug" form:"slug" validate:"required|exists:apps,slug"`
	Show bool   `json:"show" form:"show"`
}

type BackupCreate

type BackupCreate struct {
	Type   string `json:"type" form:"type" validate:"required|in:website,mysql,postgres,redis,panel"`
	Target string `json:"target" form:"target" validate:"required"`
	Path   string `json:"path" form:"path"`
}

type BackupFile

type BackupFile struct {
	Type string `json:"type" form:"type" validate:"required|in:website,mysql,postgres,redis,panel"`
	File string `json:"file" form:"file" validate:"required"`
}

type BackupList

type BackupList struct {
	Type string `json:"type" form:"type" validate:"required|in:path,website,mysql,postgres,redis,panel"`
}

type BackupRestore

type BackupRestore struct {
	Type   string `json:"type" form:"type" validate:"required|in:website,mysql,postgres,redis,panel"`
	File   string `json:"file" form:"file" validate:"required"`
	Target string `json:"target" form:"target" validate:"required"`
}

type CertAccountCreate

type CertAccountCreate struct {
	CA          string `form:"ca" json:"ca" validate:"required|in:googlecn,google,letsencrypt,buypass,zerossl,sslcom"`
	Email       string `form:"email" json:"email" validate:"required"`
	Kid         string `form:"kid" json:"kid"`
	HmacEncoded string `form:"hmac_encoded" json:"hmac_encoded"`
	KeyType     string `form:"key_type" json:"key_type" validate:"required|in:P256,P384,2048,3072,4096"`
}

type CertAccountUpdate

type CertAccountUpdate struct {
	ID          uint   `form:"id" json:"id" validate:"required|exists:cert_accounts,id"`
	CA          string `form:"ca" json:"ca" validate:"required|in:googlecn,google,letsencrypt,buypass,zerossl,sslcom"`
	Email       string `form:"email" json:"email" validate:"required"`
	Kid         string `form:"kid" json:"kid"`
	HmacEncoded string `form:"hmac_encoded" json:"hmac_encoded"`
	KeyType     string `form:"key_type" json:"key_type" validate:"required|in:P256,P384,2048,3072,4096"`
}

type CertCreate

type CertCreate struct {
	Type      string   `form:"type" json:"type" validate:"required|in:P256,P384,2048,3072,4096"`
	Domains   []string `form:"domains" json:"domains" validate:"required|isSlice"`
	AutoRenew bool     `form:"auto_renew" json:"auto_renew"`
	AccountID uint     `form:"account_id" json:"account_id"`
	DNSID     uint     `form:"dns_id" json:"dns_id"`
	WebsiteID uint     `form:"website_id" json:"website_id"`
}

type CertDNSCreate

type CertDNSCreate struct {
	Type string        `form:"type" json:"type" validate:"required"`
	Name string        `form:"name" json:"name" validate:"required"`
	Data acme.DNSParam `form:"data" json:"data" validate:"required"`
}

type CertDNSUpdate

type CertDNSUpdate struct {
	ID   uint          `form:"id" json:"id" validate:"required|exists:cert_dns,id"`
	Type string        `form:"type" json:"type" validate:"required"`
	Name string        `form:"name" json:"name" validate:"required"`
	Data acme.DNSParam `form:"data" json:"data" validate:"required"`
}

type CertDeploy

type CertDeploy struct {
	ID        uint `form:"id" json:"id" validate:"required|exists:certs,id"`
	WebsiteID uint `form:"website_id" json:"website_id" validate:"required|exists:websites,id"`
}

type CertUpdate

type CertUpdate struct {
	ID        uint     `form:"id" json:"id" validate:"required|exists:certs,id"`
	Type      string   `form:"type" json:"type" validate:"required|in:P256,P384,2048,3072,4096"`
	Domains   []string `form:"domains" json:"domains" validate:"required|isSlice"`
	Cert      string   `form:"cert" json:"cert"`
	Key       string   `form:"key" json:"key"`
	AutoRenew bool     `form:"auto_renew" json:"auto_renew"`
	AccountID uint     `form:"account_id" json:"account_id"`
	DNSID     uint     `form:"dns_id" json:"dns_id"`
	WebsiteID uint     `form:"website_id" json:"website_id"`
}

type CertUpload

type CertUpload struct {
	Cert string `form:"cert" json:"cert" validate:"required"`
	Key  string `form:"key" json:"key" validate:"required"`
}

type ContainerCreate

type ContainerCreate struct {
	Name            string                           `form:"name" json:"name" validate:"required"`
	Image           string                           `form:"image" json:"image" validate:"required"`
	Ports           []types.ContainerPort            `form:"ports" json:"ports"`
	Network         string                           `form:"network" json:"network"`
	Volumes         []types.ContainerContainerVolume `form:"volumes" json:"volumes"`
	Labels          []types.KV                       `form:"labels" json:"labels"`
	Env             []types.KV                       `form:"env" json:"env"`
	Entrypoint      []string                         `form:"entrypoint" json:"entrypoint"`
	Command         []string                         `form:"command" json:"command"`
	RestartPolicy   string                           `form:"restart_policy" json:"restart_policy"`
	AutoRemove      bool                             `form:"auto_remove" json:"auto_remove"`
	Privileged      bool                             `form:"privileged" json:"privileged"`
	OpenStdin       bool                             `form:"openStdin" json:"open_stdin"`
	PublishAllPorts bool                             `form:"publish_all_ports" json:"publish_all_ports"`
	Tty             bool                             `form:"tty" json:"tty"`
	CPUShares       int64                            `form:"cpu_shares" json:"cpu_shares"`
	CPUs            int64                            `form:"cpus" json:"cpus"`
	Memory          int64                            `form:"memory" json:"memory"`
}

type ContainerID

type ContainerID struct {
	ID string `json:"id" form:"id" validate:"required"`
}

type ContainerImageID

type ContainerImageID struct {
	ID string `json:"id" form:"id"`
}

type ContainerImagePull

type ContainerImagePull struct {
	Name     string `form:"name" json:"name" validate:"required"`
	Auth     bool   `form:"auth" json:"auth"`
	Username string `form:"username" json:"username" validate:"requiredIf:Auth,true"`
	Password string `form:"password" json:"password" validate:"requiredIf:Auth,true"`
}

type ContainerNetworkCreate

type ContainerNetworkCreate struct {
	Name    string                          `form:"name" json:"name" validate:"required"`
	Driver  string                          `form:"driver" json:"driver" validate:"required|in:bridge,host,overlay,macvlan,ipvlan,none"`
	Ipv4    types.ContainerContainerNetwork `form:"ipv4" json:"ipv4"`
	Ipv6    types.ContainerContainerNetwork `form:"ipv6" json:"ipv6"`
	Labels  []types.KV                      `form:"labels" json:"labels"`
	Options []types.KV                      `form:"options" json:"options"`
}

type ContainerNetworkID

type ContainerNetworkID struct {
	ID string `json:"id" form:"id" validate:"required"`
}

type ContainerRename

type ContainerRename struct {
	ID   string `form:"id" json:"id" validate:"required"`
	Name string `form:"name" json:"name" validate:"required"`
}

type ContainerVolumeCreate

type ContainerVolumeCreate struct {
	Name    string     `form:"name" json:"name" validate:"required"`
	Driver  string     `form:"driver" json:"driver" validate:"required|in:local"`
	Labels  []types.KV `form:"labels" json:"labels"`
	Options []types.KV `form:"options" json:"options"`
}

type ContainerVolumeID

type ContainerVolumeID struct {
	ID string `json:"id" form:"id" validate:"required"`
}

type CronCreate

type CronCreate struct {
	Name       string `form:"name" json:"name" validate:"required|notExists:crons,name"`
	Type       string `form:"type" json:"type" validate:"required"`
	Time       string `form:"time" json:"time" validate:"required|cron"`
	Script     string `form:"script" json:"script"`
	BackupType string `form:"backup_type" json:"backup_type" validate:"requiredIf:Type,backup"`
	BackupPath string `form:"backup_path" json:"backup_path"`
	Target     string `form:"target" json:"target" validate:"required"`
	Save       int    `form:"save" json:"save" validate:"required"`
}

type CronStatus

type CronStatus struct {
	ID     uint `form:"id" json:"id" validate:"required|exists:crons,id"`
	Status bool `form:"status" json:"status"`
}

type CronUpdate

type CronUpdate struct {
	ID     uint   `form:"id" json:"id" validate:"required|exists:crons,id"`
	Name   string `form:"name" json:"name" validate:"required"`
	Time   string `form:"time" json:"time" validate:"required|cron"`
	Script string `form:"script" json:"script" validate:"required"`
}

type DashboardCurrent

type DashboardCurrent struct {
	Nets  []string `json:"nets" form:"nets"`
	Disks []string `json:"disks" form:"disks"`
}

type DatabaseComment

type DatabaseComment struct {
	ServerID uint   `form:"server_id" json:"server_id" validate:"required|exists:database_servers,id"`
	Name     string `form:"name" json:"name" validate:"required"`
	Comment  string `form:"comment" json:"comment"`
}

type DatabaseCreate

type DatabaseCreate struct {
	ServerID   uint   `form:"server_id" json:"server_id" validate:"required|exists:database_servers,id"`
	Name       string `form:"name" json:"name" validate:"required"`
	CreateUser bool   `form:"create_user" json:"create_user"`
	Username   string `form:"username" json:"username" validate:"requiredIf:CreateUser,true"`
	Password   string `form:"password" json:"password" validate:"requiredIf:CreateUser,true"`
	Host       string `form:"host" json:"host"`
	Comment    string `form:"comment" json:"comment"`
}

type DatabaseDelete

type DatabaseDelete struct {
	ServerID uint   `form:"server_id" json:"server_id" validate:"required|exists:database_servers,id"`
	Name     string `form:"name" json:"name" validate:"required"`
}

type DatabaseServerCreate

type DatabaseServerCreate struct {
	Name     string `form:"name" json:"name" validate:"required|notExists:database_servers,name"`
	Type     string `form:"type" json:"type" validate:"required|in:mysql,postgresql,redis"`
	Host     string `form:"host" json:"host" validate:"required"`
	Port     uint   `form:"port" json:"port" validate:"required|min:1|max:65535"`
	Username string `form:"username" json:"username"`
	Password string `form:"password" json:"password"`
	Remark   string `form:"remark" json:"remark"`
}

type DatabaseServerUpdate

type DatabaseServerUpdate struct {
	ID       uint   `form:"id" json:"id" validate:"required|exists:database_servers,id"`
	Name     string `form:"name" json:"name" validate:"required"`
	Host     string `form:"host" json:"host" validate:"required"`
	Port     uint   `form:"port" json:"port" validate:"required|min:1|max:65535"`
	Username string `form:"username" json:"username"`
	Password string `form:"password" json:"password"`
	Remark   string `form:"remark" json:"remark"`
}

type DatabaseServerUpdateRemark

type DatabaseServerUpdateRemark struct {
	ID     uint   `form:"id" json:"id" validate:"required|exists:database_servers,id"`
	Remark string `form:"remark" json:"remark"`
}

type DatabaseUserCreate

type DatabaseUserCreate struct {
	ServerID   uint     `form:"server_id" json:"server_id" validate:"required|exists:database_servers,id"`
	Username   string   `form:"username" json:"username" validate:"required"`
	Password   string   `form:"password" json:"password" validate:"required"`
	Host       string   `form:"host" json:"host"`
	Privileges []string `form:"privileges" json:"privileges"`
	Remark     string   `form:"remark" json:"remark"`
}

type DatabaseUserUpdate

type DatabaseUserUpdate struct {
	ID         uint     `form:"id" json:"id" validate:"required|exists:database_users,id"`
	Password   string   `form:"password" json:"password"`
	Privileges []string `form:"privileges" json:"privileges"`
	Remark     string   `form:"remark" json:"remark"`
}

type DatabaseUserUpdateRemark

type DatabaseUserUpdateRemark struct {
	ID     uint   `form:"id" json:"id" validate:"required|exists:database_users,id"`
	Remark string `form:"remark" json:"remark"`
}

type FileCompress

type FileCompress struct {
	Dir   string   `form:"dir" json:"dir" validate:"required|isUnixPath"`
	Paths []string `form:"paths" json:"paths" validate:"required|isSlice"`
	File  string   `form:"file" json:"file" validate:"required|isUnixPath"`
}

type FileControl

type FileControl struct {
	Source string `form:"source" json:"source" validate:"required|isUnixPath"`
	Target string `form:"target" json:"target" validate:"required|isUnixPath"`
	Force  bool   `form:"force" json:"force"`
}

type FileCreate

type FileCreate struct {
	Dir  bool   `json:"dir" form:"dir"`
	Path string `json:"path" form:"path" validate:"required|isUnixPath"`
}

type FileList

type FileList struct {
	Path string `json:"path" form:"path" validate:"required|isUnixPath"`
	Sort string `json:"sort" form:"sort"`
}

type FilePath

type FilePath struct {
	Path string `json:"path" form:"path" validate:"required|isUnixPath"`
}

type FilePermission

type FilePermission struct {
	Path  string `form:"path" json:"path" validate:"required|isUnixPath"`
	Mode  string `form:"mode" json:"mode" validate:"required"`
	Owner string `form:"owner" json:"owner" validate:"required"`
	Group string `form:"group" json:"group" validate:"required"`
}

type FileRemoteDownload

type FileRemoteDownload struct {
	Path string `form:"path" json:"path" validate:"required|isUnixPath"`
	URL  string `form:"url" json:"url" validate:"required|isFullURL"`
}

type FileSave

type FileSave struct {
	Path    string `form:"path" json:"path" validate:"required|isUnixPath"`
	Content string `form:"content" json:"content"`
}

type FileSearch

type FileSearch struct {
	Path    string `form:"path" json:"path" validate:"required|isUnixPath"`
	Keyword string `form:"keyword" json:"keyword" validate:"required"`
	Sub     bool   `form:"sub" json:"sub"`
}

func (*FileSearch) Prepare

func (r *FileSearch) Prepare(req *http.Request) error

type FileUnCompress

type FileUnCompress struct {
	File string `form:"file" json:"file" validate:"required|isUnixPath"`
	Path string `form:"path" json:"path" validate:"required|isUnixPath"`
}

type FirewallForward

type FirewallForward struct {
	Protocol   string `json:"protocol" validate:"required|in:tcp,udp,tcp/udp"`
	Port       uint   `json:"port" validate:"required|min:1|max:65535"`
	TargetIP   string `json:"target_ip" validate:"required"`
	TargetPort uint   `json:"target_port" validate:"required|min:1|max:65535"`
}

type FirewallIPRule

type FirewallIPRule struct {
	Family    string `json:"family" validate:"required|in:ipv4,ipv6"`
	Protocol  string `json:"protocol" validate:"required|in:tcp,udp,tcp/udp"`
	Address   string `json:"address"`
	Strategy  string `json:"strategy" validate:"required|in:accept,drop,reject"`
	Direction string `json:"direction" validate:"required|in:in,out"`
}

type FirewallRule

type FirewallRule struct {
	Type      string `json:"type"`
	Family    string `json:"family" validate:"required|in:ipv4,ipv6"`
	PortStart uint   `json:"port_start" validate:"required|min:1|max:65535"`
	PortEnd   uint   `json:"port_end" validate:"required|min:1|max:65535"`
	Protocol  string `json:"protocol" validate:"required|in:tcp,udp,tcp/udp"`
	Address   string `json:"address"`
	Strategy  string `json:"strategy" validate:"required|in:accept,drop,reject"`
	Direction string `json:"direction" validate:"required|in:in,out"`
}

type FirewallStatus

type FirewallStatus struct {
	Status bool `json:"status" form:"status"`
}

type ID

type ID struct {
	ID uint `json:"id" form:"id" query:"id" validate:"required|min:1"`
}

type MonitorList

type MonitorList struct {
	Start int64 `json:"start"`
	End   int64 `json:"end"`
}

type MonitorSetting

type MonitorSetting struct {
	Enabled bool `json:"enabled"`
	Days    uint `json:"days"`
}

type Paginate

type Paginate struct {
	Page  uint `json:"page" form:"page" query:"page" validate:"required|min:1"`
	Limit uint `json:"limit" form:"limit" query:"limit" validate:"required|min:1|max:10000"`
}

func (*Paginate) Messages

func (r *Paginate) Messages(_ *http.Request) map[string]string

func (*Paginate) Prepare

func (r *Paginate) Prepare(_ *http.Request) error

type PanelSetting

type PanelSetting struct {
	Name        string `json:"name" validate:"required"`
	Locale      string `json:"locale" validate:"required"`
	Entrance    string `json:"entrance" validate:"required"`
	OfflineMode bool   `json:"offline_mode"`
	WebsitePath string `json:"website_path" validate:"required"`
	BackupPath  string `json:"backup_path" validate:"required"`
	Username    string `json:"username" validate:"required"`
	Password    string `json:"password" validate:"password"`
	Email       string `json:"email" validate:"required"`
	Port        uint   `json:"port" validate:"required|min:1|max:65535"`
	HTTPS       bool   `json:"https"`
	Cert        string `json:"cert" validate:"required"`
	Key         string `json:"key" validate:"required"`
}

type ProcessKill

type ProcessKill struct {
	PID int32 `json:"pid" validate:"required"`
}

type SSHCreate

type SSHCreate struct {
	Name       string `json:"name" form:"name"`
	Host       string `json:"host" form:"host" validate:"required"`
	Port       uint   `json:"port" form:"port" validate:"required|min:1|max:65535"`
	AuthMethod string `json:"auth_method" form:"auth_method" validate:"required|in:password,publickey"`
	User       string `json:"user" form:"user" validate:"requiredIf:AuthMethod,password"`
	Password   string `json:"password" form:"password" validate:"requiredIf:AuthMethod,password"`
	Key        string `json:"key" form:"key" validate:"requiredIf:AuthMethod,publickey"`
	Remark     string `json:"remark" form:"remark"`
}

type SSHUpdate

type SSHUpdate struct {
	ID         uint   `form:"id" json:"id" validate:"required|exists:sshes,id"`
	Name       string `json:"name" form:"name"`
	Host       string `json:"host" form:"host" validate:"required"`
	Port       uint   `json:"port" form:"port" validate:"required|min:1|max:65535"`
	AuthMethod string `json:"auth_method" form:"auth_method" validate:"required|in:password,publickey"`
	User       string `json:"user" form:"user" validate:"requiredIf:AuthMethod,password"`
	Password   string `json:"password" form:"password" validate:"requiredIf:AuthMethod,password"`
	Key        string `json:"key" form:"key" validate:"requiredIf:AuthMethod,publickey"`
	Remark     string `json:"remark" form:"remark"`
}

type SafeUpdatePingStatus

type SafeUpdatePingStatus struct {
	Status bool `json:"status" form:"status"`
}

type SafeUpdateSSH

type SafeUpdateSSH struct {
	Port   uint `json:"port" form:"port"  validate:"required|min:1|max:65535"`
	Status bool `json:"status" form:"status"`
}

type SystemctlService

type SystemctlService struct {
	Service string `json:"service" validate:"required"`
}

type UserLogin

type UserLogin struct {
	Username  string `json:"username" form:"username" validate:"required"`
	Password  string `json:"password" form:"password" validate:"required"`
	SafeLogin bool   `json:"safe_login" form:"safe_login"`
}

type WebsiteCreate

type WebsiteCreate struct {
	Name       string   `form:"name" json:"name" validate:"required|notExists:websites,name"`
	Listens    []string `form:"listens" json:"listens" validate:"required|isSlice"`
	Domains    []string `form:"domains" json:"domains" validate:"required|isSlice"`
	Path       string   `form:"path" json:"path"`
	PHP        int      `form:"php" json:"php"`
	DB         bool     `form:"db" json:"db"`
	DBType     string   `form:"db_type" json:"db_type" validate:"requiredIf:DB,true"`
	DBName     string   `form:"db_name" json:"db_name" validate:"requiredIf:DB,true"`
	DBUser     string   `form:"db_user" json:"db_user" validate:"requiredIf:DB,true"`
	DBPassword string   `form:"db_password" json:"db_password" validate:"requiredIf:DB,true"`
	Remark     string   `form:"remark" json:"remark"`
}

type WebsiteDefaultConfig

type WebsiteDefaultConfig struct {
	Index string `json:"index" form:"index" validate:"required"`
	Stop  string `json:"stop" form:"stop" validate:"required"`
}

type WebsiteDelete

type WebsiteDelete struct {
	ID   uint `form:"id" json:"id" validate:"required|exists:websites,id"`
	Path bool `form:"path" json:"path"`
	DB   bool `form:"db" json:"db"`
}

type WebsiteUpdate

type WebsiteUpdate struct {
	ID                uint                  `form:"id" json:"id" validate:"required|exists:websites,id"`
	Listens           []types.WebsiteListen `form:"listens" json:"listens" validate:"required|isSlice"`
	Domains           []string              `form:"domains" json:"domains" validate:"required|isSlice"`
	HTTPS             bool                  `form:"https" json:"https"`
	OCSP              bool                  `form:"ocsp" json:"ocsp"`
	HSTS              bool                  `form:"hsts" json:"hsts"`
	HTTPRedirect      bool                  `form:"http_redirect" json:"http_redirect"`
	OpenBasedir       bool                  `form:"open_basedir" json:"open_basedir"`
	Index             []string              `form:"index" json:"index" validate:"required|isSlice"`
	Path              string                `form:"path" json:"path" validate:"required"` // 网站目录
	Root              string                `form:"root" json:"root" validate:"required"` // 运行目录
	Raw               string                `form:"raw" json:"raw"`
	Rewrite           string                `form:"rewrite" json:"rewrite"`
	PHP               int                   `form:"php" json:"php"`
	SSLCertificate    string                `form:"ssl_certificate" json:"ssl_certificate" validate:"requiredIf:HTTPS,true"`
	SSLCertificateKey string                `form:"ssl_certificate_key" json:"ssl_certificate_key" validate:"requiredIf:HTTPS,true"`
}

type WebsiteUpdateRemark

type WebsiteUpdateRemark struct {
	ID     uint   `form:"id" json:"id" validate:"required|exists:websites,id"`
	Remark string `form:"remark" json:"remark"`
}

type WebsiteUpdateStatus

type WebsiteUpdateStatus struct {
	ID     uint `json:"id" form:"id" validate:"required|exists:websites,id"`
	Status bool `json:"status" form:"status"`
}

type WithAuthorize

type WithAuthorize interface {
	Authorize(r *http.Request) error
}

type WithFilters

type WithFilters interface {
	Filters(r *http.Request) map[string]string
}

type WithMessages

type WithMessages interface {
	Messages(r *http.Request) map[string]string
}

type WithPrepare

type WithPrepare interface {
	Prepare(r *http.Request) error
}

type WithRules

type WithRules interface {
	Rules(r *http.Request) map[string]string
}

Jump to

Keyboard shortcuts

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