server

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2021 License: Apache-2.0 Imports: 35 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
)

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

Variables

This section is empty.

Functions

This section is empty.

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
}

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 added in v0.6.1

type ResolveItem models.Resolve

type ResolveList added in v0.6.1

type ResolveList []*ResolveItem

type ResolveResult added in v0.6.1

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

type Role

type Role models.Role

type TranslateItem added in v0.6.1

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 added in v0.4.0

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
	Dsn       string
	Domain    string
	IP        string
	Listen    string
	Swagger   bool
	WithGuest bool

	AuthExpire                   time.Duration
	DefaultCleanInterval         int64
	DefaultQueryApiMaxItem       int
	DefaultMaxCallbackErrorCount int64
	DefaultLanguage              string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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