toolbox

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: 15 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{}

func NewApp

func NewApp() *App

func (*App) GetDNS

func (s *App) GetDNS(w http.ResponseWriter, r *http.Request)

GetDNS 获取 DNS 信息

func (*App) GetHostname

func (s *App) GetHostname(w http.ResponseWriter, r *http.Request)

GetHostname 获取主机名

func (*App) GetHosts

func (s *App) GetHosts(w http.ResponseWriter, r *http.Request)

GetHosts 获取 hosts 信息

func (*App) GetSWAP

func (s *App) GetSWAP(w http.ResponseWriter, r *http.Request)

GetSWAP 获取 SWAP 信息

func (*App) GetTimezone

func (s *App) GetTimezone(w http.ResponseWriter, r *http.Request)

GetTimezone 获取时区

func (*App) Route

func (s *App) Route(r chi.Router)

func (*App) SyncTime

func (s *App) SyncTime(w http.ResponseWriter, r *http.Request)

SyncTime 同步时间

func (*App) UpdateDNS

func (s *App) UpdateDNS(w http.ResponseWriter, r *http.Request)

UpdateDNS 设置 DNS 信息

func (*App) UpdateHostname

func (s *App) UpdateHostname(w http.ResponseWriter, r *http.Request)

UpdateHostname 设置主机名

func (*App) UpdateHosts

func (s *App) UpdateHosts(w http.ResponseWriter, r *http.Request)

UpdateHosts 设置 hosts 信息

func (*App) UpdateRootPassword

func (s *App) UpdateRootPassword(w http.ResponseWriter, r *http.Request)

UpdateRootPassword 设置 root 密码

func (*App) UpdateSWAP

func (s *App) UpdateSWAP(w http.ResponseWriter, r *http.Request)

UpdateSWAP 设置 SWAP 信息

func (*App) UpdateTime

func (s *App) UpdateTime(w http.ResponseWriter, r *http.Request)

UpdateTime 设置时间

func (*App) UpdateTimezone

func (s *App) UpdateTimezone(w http.ResponseWriter, r *http.Request)

UpdateTimezone 设置时区

type DNS

type DNS struct {
	DNS1 string `form:"dns1" json:"dns1" validate:"required"`
	DNS2 string `form:"dns2" json:"dns2" validate:"required"`
}

type Hostname

type Hostname struct {
	Hostname string `form:"hostname" json:"hostname" validate:"required|regex:^[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]$"`
}

type Hosts

type Hosts struct {
	Hosts string `form:"hosts" json:"hosts"`
}

type Password

type Password struct {
	Password string `form:"password" json:"password" validate:"required|password"`
}

type SWAP

type SWAP struct {
	Size int64 `form:"size" json:"size" validate:"min:0"`
}

type Time

type Time struct {
	Time time.Time `form:"time" json:"time" validate:"required"`
}

type Timezone

type Timezone struct {
	Timezone string `form:"timezone" json:"timezone" validate:"required"`
}

Jump to

Keyboard shortcuts

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