proxy

package
v0.0.0-...-82567e2 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = []byte(`{
	"tld": "wip",
	"host": "localhost",
	"port": 7080,
	"domains": {
	}
}
`)

Functions

func ToConfiguredProjects

func ToConfiguredProjects() (map[string]*projects.ConfiguredProject, error)

Types

type Config

type Config struct {
	TLD  string `json:"tld"`
	Host string `json:"host"`
	Port int    `json:"port"`
	// only here so that we can unmarshal :(
	TmpDomains map[string]string `json:"domains"`
	// contains filtered or unexported fields
}

func Load

func Load(homeDir string) (*Config, error)

func (*Config) AddDirDomains

func (c *Config) AddDirDomains(dir string, domains []string) error

func (*Config) Dirs

func (c *Config) Dirs() map[string][]string

func (*Config) Domains

func (c *Config) Domains() map[string]string

func (*Config) GetDir

func (c *Config) GetDir(domain string) string

func (*Config) GetDomains

func (c *Config) GetDomains(dir string) []string

func (*Config) NormalizeDomain

func (c *Config) NormalizeDomain(domain string) string

func (*Config) RemoveDirDomains

func (c *Config) RemoveDirDomains(domains []string) error

func (*Config) ReplaceDirDomains

func (c *Config) ReplaceDirDomains(dir string, domains []string) error

func (*Config) Save

func (c *Config) Save() error

func (*Config) SetDomains

func (c *Config) SetDomains(domains map[string]string)

func (*Config) Watch

func (c *Config) Watch()

Watch checks config file changes

type Proxy

type Proxy struct {
	*Config
	// contains filtered or unexported fields
}

func New

func New(config *Config, ca *cert.CA, logger *log.Logger, debug bool) *Proxy

func (*Proxy) Start

func (p *Proxy) Start() error

Jump to

Keyboard shortcuts

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