service

package
v0.0.0-...-b505c3d Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRealIP

func GetRealIP(r *http.Request) string

func Listen

func Listen(configPath string) error

func NewProxy

func NewProxy(parsedURL *url.URL, requestModifier func(req *http.Request) (bool, error), responseModifier func(resp *http.Response) error) (func(http.ResponseWriter, *http.Request), error)

Types

type Config

type Config struct {
	Mirrors   map[string]string `json:"mirrors"`
	Redirects map[string]string `json:"redirects"`
	Listen    string            `json:"listen"`
	SansorURI string            `json:"sansor_uri"`
}

func ReadConfig

func ReadConfig(path string) (*Config, error)

type Router

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

func NewRouter

func NewRouter(config *Config) (*Router, error)

func (*Router) Handle

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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