logic

package
v0.0.0-...-725be48 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SUCC   = 0
	FAILED = -1
	HTTP   = "http://"
)

Variables

This section is empty.

Functions

func Dns

func Dns(host string) *net.IP

Dns get DNS record

func DnsDecoder

func DnsDecoder(urlStr string) (*string, *string, error)

DnsDecoder resolve url's dns

func Initializer

func Initializer(conf string) bool

Initializer Func

func Lookup

func Lookup(ctype, host, dnsServer string) (*dns.Msg, error)

Lookup search recordy by dns server

func Loop

func Loop()

Loop Func Register web interface

func NewRedisPool

func NewRedisPool(host string, db string) *redis.Pool

func PingHandler

func PingHandler(ctx *web.Context) string

PingHandler Func

func ResolveHandler

func ResolveHandler(ctx *web.Context) string

ResolveHandler Func

Types

type AppConfig

type AppConfig struct {
	Redis      RedisConf `yaml:"redis"`
	Logconf    string    `yaml:"log_config"`
	Listen     string    `yaml:"listen"`
	Port       string    `yaml:"port"`
	TTL        int       `yaml:"ttl"`
	Dnsservers []string  `yaml:"dnsservers"`
}

AppConfig Type

type RedisConf

type RedisConf struct {
	Host string `yaml:"host"`
	Db   string `yaml:"db"`
}

RedisConf Type

type Resp

type Resp struct {
	Code     int    `json:"c"`
	TargetIP string `json:"targetip,omitempty"`
	Host     string `json:"host, omitempty"`
	Msg      string `json:"msg, omitempty"`
}

Resp Type

Jump to

Keyboard shortcuts

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