proxy

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2017 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DOCKER_SOCKET = "/var/run/docker.sock"
	PROXY_SOCKET  = "/tmp/doxy.sock"
	PATTERN_FILE  = "/etc/doxy.pattern"
)

Variables

View Source
var (
	DEFAULT_PATTERNS = []string{
		`^/(v\d\.\d+/)?containers(/\w+)?/(json|stats|top)$`,
		`^/(v\d\.\d+/)?services(/[0-9a-f]+)?$`,
		`^/(v\d\.\d+/)?tasks(/\w+)?$`,
		`^/(v\d\.\d+/)?networks(/\w+)?$`,
		`^/(v\d\.\d+/)?volumes(/\w+)?$`,
		`^/(v\d\.\d+/)?nodes(/\w+)?$`,
		`^/(v\d\.\d+/)?info$`,
		`^/(v\d\.\d+/)?version$`,
		"^/_ping$",
	}
)

Functions

func ListenToNewSock

func ListenToNewSock(newsock string, sigc chan os.Signal) (l net.Listener, err error)

func ReadPatterns added in v0.1.2

func ReadPatterns(reader io.Reader) (patterns []string, err error)

Types

type Proxy

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

func NewProxy

func NewProxy(opts ...ProxyOption) Proxy

func (*Proxy) GetOptions added in v0.1.2

func (p *Proxy) GetOptions() map[string]interface{}

func (*Proxy) Run

func (p *Proxy) Run()

type ProxyOption added in v0.1.2

type ProxyOption func(*ProxyOptions)

func WithDebugEnabled added in v0.1.2

func WithDebugEnabled() ProxyOption

func WithDebugValue added in v0.1.2

func WithDebugValue(d bool) ProxyOption

func WithDockerSocket added in v0.1.2

func WithDockerSocket(s string) ProxyOption

func WithPattern added in v0.1.2

func WithPattern(p string) ProxyOption

func WithPatterns added in v0.1.2

func WithPatterns(p []string) ProxyOption

func WithProxySocket added in v0.1.2

func WithProxySocket(s string) ProxyOption

type ProxyOptions added in v0.1.2

type ProxyOptions struct {
	DockerSocket string
	ProxySocket  string
	Debug        bool
	Patterns     []string
}

type UnixSocket

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

UnixSocket just provides the path, so that I can test it

func NewUnixSocket

func NewUnixSocket(path string) UnixSocket

NewUnixSocket return a socket using the path

type UpStream

type UpStream struct {
	Name string
	// contains filtered or unexported fields
}

func NewUpstream

func NewUpstream(socket string, regs []string) *UpStream

NewUpstream returns a new socket (magic)

func (*UpStream) ServeHTTP

func (u *UpStream) ServeHTTP(w http.ResponseWriter, req *http.Request)

Jump to

Keyboard shortcuts

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