proxy

package
v0.0.0-...-cfe3041 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2016 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DiscoveryPath = "/docker/ambd/nodes"
)

Variables

View Source
var (
	ErrProxyExist = errors.New("proxy exist")

	ErrMissingName = errors.New("proxy name empty")

	Targets []string

	Cancel      ctx.CancelFunc
	RootContext ctx.Context

	Store *libkv.Store
)
View Source
var (
	ProxyConfigKey string = "__nobody__"

	ConfigReset ctx.CancelFunc
)
View Source
var (
	EnableDiscoveryProxy bool

	DiscoveryProxyInfo = &Info{
		Name: "discovery",
		Net:  "tcp4",
		From: ":2379",
	}
)

Functions

func ConfigKey

func ConfigKey() string

func DiscoveryURI

func DiscoveryURI()

func Follow

func Follow()

func Listen

func Listen(meta *Info) error

Types

type Info

type Info struct {
	// describe what TLS role this instnace is running
	// Either *leave empty*, which is not engage in TLS
	// or *client*, which is to connect with provided certificate
	// or *server*, which is to listen with provided certificate
	ServerRole string `json:"tlsrole"`

	// certificate root path
	CA string `json:"tlscacert"`

	// certificate public private key pair
	Cert string `json:"tlscert"`
	Key  string `json:"tlskey"`

	Name string `json:"name"`

	Net       string   `json:"net"`
	From      string   `json:"src"`
	FromRange []string `json:"range"`

	// static assignment
	To []string `json:"dst,omitempty"`

	// read from discovery
	Service string `json:"srv,omitempty"`

	// Abort proxy handler
	Cancel ctx.CancelFunc `json:"-"`
}

func (*Info) Listen

func (i *Info) Listen()

type ProxyFunc

type ProxyFunc func(ctx.Context, *proxy.ConnOptions) error

Jump to

Keyboard shortcuts

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