webserver

package
v0.0.0-...-d9ac2dc Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SchemeHttp  = "http"
	SchemeHttps = "https"
)
View Source
const (
	ServerCaddy = "caddy"
	ServerNginx = "nginx"
)

Variables

View Source
var (
	ErrNotValidIp   = errors.New("[webserver] this IP looks invalid")
	ErrNotPrivateIp = errors.New("[webserver] provided ip is not private")
	ErrNotOfficeIp  = errors.New("[webserver] provided ip is not belong to any of the office networks")
	ErrIpDenied     = errors.New("[webserver] you can't use this ip. Its usage denied by administration")
	ErrIpParse      = errors.New("[webserver] can't parse this IP. contact bot admin")
	ErrNetworkIP    = errors.New("[webserver] seems that you entered network address")
	ErrConfigExists = errors.New("[webserver] config for this domain already exists")
)
View Source
var (
	Debug bool
)

Functions

func CheckIfIpAllowed

func CheckIfIpAllowed(allowedIPs, deniedIPs []string, ip string) error

Types

type IP

type IP struct {
	Allowed []*net.IPNet
	Denied  []net.IP
}

type Server

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

func New

func New(s string) *Server

func (*Server) Create

func (s *Server) Create(c *entities.Domain) error

func (*Server) Delete

func (s *Server) Delete(domain string) error

type Webserver

type Webserver interface {
	Create(c *entities.Domain) error
	Delete(domain string) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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