server

package
v0.4.2-0...-ac2c6ee Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2020 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LOG_TTL     = 0
	NS_TTL      = 600
	DEFAULT_TTL = 300
	XIP_TTL     = 86400
)
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()

func (*DnsServer) Update

func (self *DnsServer) Update(rr []Resolve)

type DnsServerConfig

type DnsServerConfig struct {
	Domain             string
	RTimeout, WTimeout time.Duration
	V4, V6             net.IP
	Fixed              []Resolve
}

type HostSwitch

type HostSwitch map[string]http.Handler

func (HostSwitch) ServeHTTP

func (hs HostSwitch) ServeHTTP(w http.ResponseWriter, r *http.Request)

Implement the ServeHTTP method on our new type

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 Role

type Role models.Role

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