lighthouse

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: May 7, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetWildcardHost added in v1.3.0

func GetWildcardHost(host string) ([]string, error)

func Serve

func Serve(cfg *Config)

Config is the configuration of lighthouse

Types

type Config

type Config struct {
	Title   string `config:"title"`
	Version string `config:"version"`
	Author  string `config:"author"`
	Server  struct {
		Host string `config:"host"`
		Port int64  `config:"port"`
	} `config:"server"`
	Upstreams []string `config:"upstreams"`
	Cache     struct {
		Engine string `config:"engine,default=memory"`
		MaxAge int64  `config:"max_age"`
		Config struct {
			Host     string `config:"host"`
			Port     int64  `config:"port"`
			Db       int64  `config:"db"`
			Password string `config:"password"`
			Prefix   string `config:"prefix"`
		} `config:"config"`
	} `config:"cache"`
	Log struct {
		Transport string `config:"transport"`
		Level     string `config:"level"`
	} `config:"log"`
	Hosts struct {
		Enable bool   `config:"enable"`
		File   string `config:"file"`
	} `config:"hosts"`
}

Config is the configuration of lighthouse

type IPS added in v1.3.0

type IPS struct {
	// contains filtered or unexported fields
}

IPS is the IPs manager

func NewIPS added in v1.3.0

func NewIPS(cfg *Config) *IPS

NewIPS creates a new IPS

func (*IPS) GetByExactHost added in v1.3.4

func (i *IPS) GetByExactHost(host string, typ int) ([]string, error)

GetByHost returns the IPs of the extract host

func (*IPS) GetByWildcardHost added in v1.3.0

func (i *IPS) GetByWildcardHost(host string, typ int) ([]string, error)

GetByWildcardHost returns the IPs of the wildcard host

func (*IPS) SearchByHost added in v1.3.4

func (i *IPS) SearchByHost(host string, typ int) ([]string, error)

SearchByHost returns the IPs of host

Jump to

Keyboard shortcuts

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