types

package
v0.0.0-...-b515019 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KVToMap

func KVToMap(kvs []KV) map[string]string

KVToMap 将 key-value 切片转换为 map

func KVToSlice

func KVToSlice(kvs []KV) []string

KVToSlice 将 key-value 切片转换为 key=value 切片

Types

type App

type App struct {
	Slug  string             `json:"slug"` // 应用标识
	Route func(r chi.Router) `json:"-"`    // 路由
}

App 应用元数据结构

type AppCenter

type AppCenter struct {
	Icon        string `json:"icon"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Slug        string `json:"slug"`
	Channels    []struct {
		Slug      string `json:"slug"`
		Name      string `json:"name"`
		Panel     string `json:"panel"`
		Install   string `json:"-"`
		Uninstall string `json:"-"`
		Update    string `json:"-"`
		Subs      []struct {
			Log     string `json:"log"`
			Version string `json:"version"`
		} `json:"subs"`
	} `json:"channels"`
	Installed        bool   `json:"installed"`
	InstalledChannel string `json:"installed_channel"`
	InstalledVersion string `json:"installed_version"`
	UpdateExist      bool   `json:"update_exist"`
	Show             bool   `json:"show"`
}

AppCenter 应用中心结构

type BackupFile

type BackupFile struct {
	Name string    `json:"name"`
	Path string    `json:"path"`
	Size string    `json:"size"`
	Time time.Time `json:"time"`
}

type CPU

type CPU struct {
	Percent []string `json:"percent"`
}

type CertList

type CertList struct {
	ID         uint      `json:"id"`
	AccountID  uint      `json:"account_id"`
	WebsiteID  uint      `json:"website_id"`
	DNSID      uint      `json:"dns_id"`
	Type       string    `json:"type"`
	Domains    []string  `json:"domains"`
	AutoRenew  bool      `json:"auto_renew"`
	Cert       string    `json:"cert"`
	Key        string    `json:"key"`
	NotBefore  time.Time `json:"not_before"`
	NotAfter   time.Time `json:"not_after"`
	Issuer     string    `json:"issuer"`
	OCSPServer []string  `json:"ocsp_server"`
	DNSNames   []string  `json:"dns_names"`
	CreatedAt  time.Time `json:"created_at"`
	UpdatedAt  time.Time `json:"updated_at"`
}

type Container

type Container struct {
	ID        string          `json:"id"`
	Name      string          `json:"name"`
	Image     string          `json:"image"`
	ImageID   string          `json:"image_id"`
	Command   string          `json:"command"`
	State     string          `json:"state"`
	Status    string          `json:"status"`
	CreatedAt time.Time       `json:"created_at"`
	Ports     []ContainerPort `json:"ports"`
	Labels    []KV            `json:"labels"`
}

type ContainerContainerNetwork

type ContainerContainerNetwork struct {
	Enabled bool   `form:"enabled" json:"enabled"`
	Gateway string `form:"gateway" json:"gateway"`
	IPRange string `form:"ip_range" json:"ip_range"`
	Subnet  string `form:"subnet" json:"subnet"`
}

type ContainerContainerVolume

type ContainerContainerVolume struct {
	Host      string `form:"host" json:"host"`
	Container string `form:"container" json:"container"`
	Mode      string `form:"mode" json:"mode"`
}

type ContainerImage

type ContainerImage struct {
	ID          string    `json:"id"`
	Containers  int64     `json:"containers"`
	RepoTags    []string  `json:"repo_tags"`
	RepoDigests []string  `json:"repo_digests"`
	Size        string    `json:"size"`
	Labels      []KV      `json:"labels"`
	CreatedAt   time.Time `json:"created_at"`
}

type ContainerNetwork

type ContainerNetwork struct {
	ID         string               `json:"id"`
	Name       string               `json:"name"`
	Driver     string               `json:"driver"`
	IPv6       bool                 `json:"ipv6"`
	Internal   bool                 `json:"internal"`
	Attachable bool                 `json:"attachable"`
	Ingress    bool                 `json:"ingress"`
	Scope      string               `json:"scope"`
	CreatedAt  time.Time            `json:"created_at"`
	IPAM       ContainerNetworkIPAM `json:"ipam"`
	Options    []KV                 `json:"options"`
	Labels     []KV                 `json:"labels"`
}

type ContainerNetworkIPAM

type ContainerNetworkIPAM struct {
	Driver  string                       `json:"driver"`
	Options []KV                         `json:"options"`
	Config  []ContainerNetworkIPAMConfig `json:"config"`
}

ContainerNetworkIPAM represents IP Address Management

type ContainerNetworkIPAMConfig

type ContainerNetworkIPAMConfig struct {
	Subnet     string            `json:"subnet"`
	IPRange    string            `json:"ip_range"`
	Gateway    string            `json:"gateway"`
	AuxAddress map[string]string `json:"aux_address"`
}

ContainerNetworkIPAMConfig represents IPAM configurations

type ContainerPort

type ContainerPort struct {
	ContainerStart uint   `form:"container_start" json:"container_start"`
	ContainerEnd   uint   `form:"container_end" json:"container_end"`
	Host           string `form:"host" json:"host"`
	HostStart      uint   `form:"host_start" json:"host_start"`
	HostEnd        uint   `form:"host_end" json:"host_end"`
	Protocol       string `form:"protocol" json:"protocol"`
}

type ContainerVolume

type ContainerVolume struct {
	Name       string    `json:"name"`
	Driver     string    `json:"driver"`
	Scope      string    `json:"scope"`
	MountPoint string    `json:"mount_point"`
	CreatedAt  time.Time `json:"created_at"`
	Labels     []KV      `json:"labels"`
	Options    []KV      `json:"options"`
	RefCount   int64     `json:"ref_count"`
	Size       string    `json:"size"`
}

type CurrentInfo

type CurrentInfo struct {
	Cpus      []cpu.InfoStat         `json:"cpus"`
	Percent   float64                `json:"percent"`  // 总使用率
	Percents  []float64              `json:"percents"` // 每个核心使用率
	Load      *load.AvgStat          `json:"load"`
	Host      *host.InfoStat         `json:"host"`
	Mem       *mem.VirtualMemoryStat `json:"mem"`
	Swap      *mem.SwapMemoryStat    `json:"swap"`
	Net       []net.IOCountersStat   `json:"net"`
	DiskIO    []disk.IOCountersStat  `json:"disk_io"`
	Disk      []disk.PartitionStat   `json:"disk"`
	DiskUsage []disk.UsageStat       `json:"disk_usage"`
	Time      time.Time              `json:"time"`
}

CurrentInfo 监控信息

type KV

type KV struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

func MapToKV

func MapToKV(m map[string]string) []KV

MapToKV 将 map 转换为 key-value 切片

func SliceToKV

func SliceToKV(s []string) []KV

SliceToKV 将 key=value 切片转换为 key-value 切片

type LV

type LV struct {
	Label string `json:"label"`
	Value string `json:"value"`
}

type LVInt

type LVInt struct {
	Label string `json:"label"`
	Value int    `json:"value"`
}

type Load

type Load struct {
	Load1  []float64 `json:"load1"`
	Load5  []float64 `json:"load5"`
	Load15 []float64 `json:"load15"`
}

type Mem

type Mem struct {
	Total     string   `json:"total"`
	Available []string `json:"available"`
	Used      []string `json:"used"`
}

type MonitorData

type MonitorData struct {
	Times []string `json:"times"`
	Load  Load     `json:"load"`
	CPU   CPU      `json:"cpu"`
	Mem   Mem      `json:"mem"`
	SWAP  SWAP     `json:"swap"`
	Net   Network  `json:"net"`
}

type MySQLDatabase

type MySQLDatabase struct {
	Name      string `json:"name"`
	CharSet   string `json:"char_set"`
	Collation string `json:"collation"`
}

type MySQLUser

type MySQLUser struct {
	User   string   `json:"user"`
	Host   string   `json:"host"`
	Grants []string `json:"grants"`
}

type NV

type NV struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type Network

type Network struct {
	Sent []string `json:"sent"`
	Recv []string `json:"recv"`
	Tx   []string `json:"tx"`
	Rx   []string `json:"rx"`
}

type PanelAppConfig

type PanelAppConfig struct {
	Debug    bool   `yaml:"debug"`
	Key      string `yaml:"key"`
	Locale   string `yaml:"locale"`
	Timezone string `yaml:"timezone"`
	Root     string `yaml:"root"`
}

type PanelConfig

type PanelConfig struct {
	App      PanelAppConfig      `yaml:"app"`
	HTTP     PanelHTTPConfig     `yaml:"http"`
	Database PanelDatabaseConfig `yaml:"database"`
}

PanelConfig 面板配置结构体

type PanelDatabaseConfig

type PanelDatabaseConfig struct {
	Debug bool `yaml:"debug"`
}

type PanelHTTPConfig

type PanelHTTPConfig struct {
	Debug    bool   `yaml:"debug"`
	Port     uint   `yaml:"port"`
	Entrance string `yaml:"entrance"`
	TLS      bool   `yaml:"tls"`
}

type PostgresDatabase

type PostgresDatabase struct {
	Name     string `json:"name"`
	Owner    string `json:"owner"`
	Encoding string `json:"encoding"`
	Comment  string `json:"comment"`
}

type PostgresUser

type PostgresUser struct {
	Role       string   `json:"role"`
	Attributes []string `json:"attributes"`
}

type ProcessData

type ProcessData struct {
	PID        int32   `json:"pid"`
	Name       string  `json:"name"`
	PPID       int32   `json:"ppid"`
	Username   string  `json:"username"`
	Status     string  `json:"status"`
	Background bool    `json:"background"`
	StartTime  string  `json:"start_time"`
	NumThreads int32   `json:"num_threads"`
	CPU        float64 `json:"cpu"`

	DiskRead  uint64 `json:"disk_read"`
	DiskWrite uint64 `json:"disk_write"`

	CmdLine string `json:"cmd_line"`

	RSS    uint64 `json:"rss"`
	VMS    uint64 `json:"vms"`
	HWM    uint64 `json:"hwm"`
	Data   uint64 `json:"data"`
	Stack  uint64 `json:"stack"`
	Locked uint64 `json:"locked"`
	Swap   uint64 `json:"swap"`

	Envs []string `json:"envs"`

	OpenFiles   []process.OpenFilesStat `json:"open_files"`
	Connections []net.ConnectionStat    `json:"connections"`
	Nets        []net.IOCountersStat    `json:"nets"`
}

type SWAP

type SWAP struct {
	Total string   `json:"total"`
	Used  []string `json:"used"`
	Free  []string `json:"free"`
}

type WebsiteListen

type WebsiteListen struct {
	Address string `form:"address" json:"address" validate:"required"` // 监听地址 e.g. 80 0.0.0.0:80 [::]:80
	HTTPS   bool   `form:"https" json:"https"`                         // 是否启用HTTPS
	QUIC    bool   `form:"quic" json:"quic"`                           // 是否启用QUIC
}

WebsiteListen 网站监听配置

type WebsiteSetting

type WebsiteSetting struct {
	ID                uint            `json:"id"`
	Name              string          `json:"name"`
	Listens           []WebsiteListen `form:"listens" json:"listens" validate:"required"`
	Domains           []string        `json:"domains"`
	Path              string          `json:"path"` // 网站目录
	Root              string          `json:"root"` // 运行目录
	Index             []string        `json:"index"`
	PHP               int             `json:"php"`
	OpenBasedir       bool            `json:"open_basedir"`
	HTTPS             bool            `json:"https"`
	SSLCertificate    string          `json:"ssl_certificate"`
	SSLCertificateKey string          `json:"ssl_certificate_key"`
	SSLNotBefore      string          `json:"ssl_not_before"`
	SSLNotAfter       string          `json:"ssl_not_after"`
	SSLDNSNames       []string        `json:"ssl_dns_names"`
	SSLIssuer         string          `json:"ssl_issuer"`
	SSLOCSPServer     []string        `json:"ssl_ocsp_server"`
	HTTPRedirect      bool            `json:"http_redirect"`
	HSTS              bool            `json:"hsts"`
	OCSP              bool            `json:"ocsp"`
	Rewrite           string          `json:"rewrite"`
	Raw               string          `json:"raw"`
	Log               string          `json:"log"`
}

WebsiteSetting 网站设置

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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