proxy

package
v0.0.0-...-2759aa6 Latest Latest
Warning

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

Go to latest
Published: May 27, 2022 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const ApiV1Prefix = "/api/v1"
View Source
const ServiceFile = "/etc/systemd/system/vite.service"
View Source
const (
	Store = datadir.Store("certs")
)
View Source
const UptimeRegex = `(?m); (.+) ago\n`

Variables

View Source
var DisableCmds = [][]string{
	{"systemctl", "stop", "vite.service"},
	{"systemctl", "disable", "vite.service"},
	{"systemctl", "daemon-reload"},
}
View Source
var EnableCmds = [][]string{
	{"systemctl", "daemon-reload"},
	{"systemctl", "enable", "vite.service"},
	{"systemctl", "start", "vite.service"},
}

Functions

func DaemonConfig

func DaemonConfig(user string) ([]byte, error)

func GetAutoCert

func GetAutoCert() (*tls.Certificate, error)

func NewAPI

func NewAPI() *gin.Engine

Types

type DaemonStatus

type DaemonStatus int
const (
	Absent DaemonStatus = iota
	Running
	Errored
)

func State

func State() (DaemonStatus, string, error)

func (DaemonStatus) String

func (s DaemonStatus) String() string

type Logger

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

func (Logger) Log

func (l Logger) Log(level zoup.Level, message string, fields zoup.Fields)

func (*Logger) LogR

func (l *Logger) LogR(r *http.Request, level zoup.Level, message string)

type Proxy

type Proxy struct {
	Router      *Router
	CertManager *autocert.Manager
	Logger      *Logger
}

func New

func New(stdout io.Writer, deployment *deployment.Deployment) (*Proxy, error)

func (*Proxy) Run

func (p *Proxy) Run(HTTP string, HTTPS string, unsecure bool)

type Router

type Router struct {
	API *gin.Engine
	// contains filtered or unexported fields
}

func (*Router) Accepts

func (r *Router) Accepts(host string) (bool, error)

func (*Router) IPFor

func (r *Router) IPFor(host string) (string, error)

func (*Router) Proxy

func (r *Router) Proxy(w http.ResponseWriter, req *http.Request)

Jump to

Keyboard shortcuts

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