server

package
v0.0.0-...-7f13dd7 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: Apache-2.0 Imports: 33 Imported by: 0

README

translation

  1. Extract

    go run --tags=bootstrap bootstrap.go generate

  2. Edit ts.yml

  3. Generate code

    go run --tags=bootstrap bootstrap.go translate

Documentation

Index

Constants

View Source
const (
	LOG_TTL              = 0
	NS_TTL               = 600
	DEFAULT_TTL          = 300
	XIP_TTL              = 86400 * 7 // one week
	CUSTOM_REBIND_EXPIRE = 3600 * time.Second
)
View Source
const (
	CodeOK             = models.CodeOK
	CodeBadPermission  = models.CodeBadPermission
	CodeBadData        = models.CodeBadData
	CodeNoAuth         = models.CodeNoAuth
	CodeNoPermission   = models.CodeNoPermission
	CodeServerInternal = models.CodeServerInternal
	CodeNoData         = models.CodeNoData
	CodeExpire         = models.CodeExpire
	VerifycodeErr      = models.VerifycodeErr
)

============================================================================== api models ==============================================================================

Variables

This section is empty.

Functions

func Serve

func Serve(w http.ResponseWriter, r *http.Request, id, ext, lang string, download bool, width, height int) error

Types

type AppSecurity

type AppSecurity models.AppSecurity

type AppSecuritySet

type AppSecuritySet models.AppSecuritySet

type AppSetting

type AppSetting models.AppSetting

type CR

type CR models.CR

commone response

type DeleteRecordRequest

type DeleteRecordRequest models.DeleteRecordRequest

type DnsRecord

type DnsRecord models.DnsRecord

type DnsRecordResp

type DnsRecordResp models.DnsRecordResp

type DnsServer

type DnsServer struct {
	DnsServerConfig
	// contains filtered or unexported fields
}

func NewDnsServer

func NewDnsServer(cfg *DnsServerConfig, store *cache.Cache) (*DnsServer, error)

func (*DnsServer) Do

func (h *DnsServer) Do(w dns.ResponseWriter, req *dns.Msg)

func (*DnsServer) Run

func (s *DnsServer) Run()

func (*DnsServer) Shutdown

func (s *DnsServer) Shutdown()

type DnsServerConfig

type DnsServerConfig struct {
	Domain             string
	RTimeout, WTimeout time.Duration
	V4, V6             net.IP
	Upstream           string
}

dns server 配置

type HttpRecord

type HttpRecord models.HttpRecord

type HttpRecordResp

type HttpRecordResp models.HttpRecordResp

type LoginRequest

type LoginRequest models.LoginRequest

type LoginResponse

type LoginResponse models.LoginResponse

type MyClaims

type MyClaims struct {
	Seed string `json:"seed"`
	jwt.StandardClaims
}

type Pagination

type Pagination models.Pagination

type Permission

type Permission models.Permission

type PermissionActionSet

type PermissionActionSet models.PermissionActionSet

type Resolve

type Resolve struct {
	Name  string
	Type  string
	Value string
	Ttl   uint32
}

type ResolveItem

type ResolveItem models.Resolve

type ResolveList

type ResolveList []*ResolveItem

type ResolveResult

type ResolveResult struct {
	Pagination
	Data ResolveList `json:"data"`
}

type Role

type Role models.Role

type TranslateItem

type TranslateItem map[string]string

type UserInfo

type UserInfo models.UserInfo

type UserListResp

type UserListResp models.UserListResp

type UserRequest

type UserRequest models.UserRequest

type WebServer

type WebServer struct {
	WebServerConfig
	// contains filtered or unexported fields
}

func NewWebServer

func NewWebServer(cfg *WebServerConfig, store *cache.Cache) (*WebServer, error)

func (*WebServer) Index

func (h *WebServer) Index(c *gin.Context)

Reference: https://github.com/fanjq99/dnslog.git

func (*WebServer) IsDuplicate

func (self *WebServer) IsDuplicate(err error) bool

func (*WebServer) ResetPassword

func (self *WebServer) ResetPassword(user, password string) error

func (*WebServer) Run

func (self *WebServer) Run() error

func (*WebServer) RunStoreRoutine

func (self *WebServer) RunStoreRoutine()

func (*WebServer) Shutdown

func (self *WebServer) Shutdown(ctx context.Context) error

func (*WebServer) Status

func (h *WebServer) Status(c *gin.Context)

type WebServerConfig

type WebServerConfig struct {
	Driver                       string        `json:"driver"`      // 驱动名
	Dsn                          string        `json:"dsn"`         // 驱动链接信息
	Domain                       string        `json:"domain"`      // 域名
	Author                       string        `json:"author"`      //
	IP                           string        `json:"ip"`          // ip地址
	Listen                       string        `json:"listen"`      // 监听地址,默认 0:8081
	Swagger                      bool          `json:"swagger"`     // 默认 false
	WithGuest                    bool          `json:"withGuest"`   // 默认false
	AuthExpire                   time.Duration `json:"auth_expire"` // 登陆有效期
	DefaultCleanInterval         int64         `json:"default_clean_interval"`
	DefaultQueryApiMaxItem       int           `json:"default_query_api_max_item"`
	DefaultMaxCallbackErrorCount int64         `json:"default_max_callback_error_count"`
	DefaultLanguage              string        `json:"default_language"`
	ServerPem                    string        `json:"server_pem"`
	ServerKey                    string        `json:"server_key"`
}

Jump to

Keyboard shortcuts

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