shaman

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2021 License: MIT Imports: 13 Imported by: 0

README

shaman

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PathMatch

func PathMatch(r *http.Request, p string) bool

func PrefixMatch

func PrefixMatch(r *http.Request, p string) bool

func WatchFile

func WatchFile(filename string, c chan bool)

Types

type Config

type Config struct {
	Mode  string `json:"mode,omitempty"`
	Rules []Rule `json:"rules,omitempty"`
}

func (Config) String

func (c Config) String() string

type Rule

type Rule struct {
	Action string `json:"action"`

	Method string `json:"method,omitempty"`
	Path   string `json:"path,omitempty"`
	Prefix string `json:"prefix,omitempty"`

	Delay string `json:"delay,omitempty"`

	ReturnCode    int               `json:"code,omitempty"`
	ReturnBody    string            `json:"body,omitempty"`
	ReturnHeaders map[string]string `json:"headers,omitempty"`
}

type Shaman

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

func NewShaman

func NewShaman(backend string) (Shaman, error)

func (*Shaman) ReloadConfig

func (shaman *Shaman) ReloadConfig(newconfig Config)

func (*Shaman) WatchConfig

func (shaman *Shaman) WatchConfig(configFile string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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