proxy

package
v0.0.0-...-d356c50 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2015 License: MIT Imports: 16 Imported by: 81

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrClosedProxy = errors.New("use of closed proxy")

Functions

This section is empty.

Types

type ApiClient

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

func NewApiClient

func NewApiClient(addr string) *ApiClient

func (*ApiClient) FillSlot

func (c *ApiClient) FillSlot(slots ...*models.Slot) error

func (*ApiClient) Model

func (c *ApiClient) Model() (*models.Proxy, error)

func (*ApiClient) SetXAuth

func (c *ApiClient) SetXAuth(name, auth string, token string)

func (*ApiClient) Shutdown

func (c *ApiClient) Shutdown() error

func (*ApiClient) Start

func (c *ApiClient) Start() error

func (*ApiClient) Stats

func (c *ApiClient) Stats() (*Stats, error)

func (*ApiClient) Summary

func (c *ApiClient) Summary() (*Summary, error)

func (*ApiClient) XPing

func (c *ApiClient) XPing() error

type Config

type Config struct {
	ProtoType string `toml:"proto_type" json:"proto_type"`
	ProxyAddr string `toml:"proxy_addr" json:"proxy_addr"`
	AdminAddr string `toml:"admin_addr" json:"admin_addr"`

	ProductName string `toml:"product_name" json:"product_name"`
	ProductAuth string `toml:"product_auth" json:"-"`

	BackendPingPeriod      int `toml:"backend_ping_period" json:"backend_ping_period"`
	SessionMaxTimeout      int `toml:"session_max_timeout" json:"session_max_timeout"`
	SessionMaxBufSize      int `toml:"session_max_bufsize" json:"session_max_bufsize"`
	SessionMaxPipeline     int `toml:"session_max_pipeline" json:"session_max_pipeline"`
	SessionKeepAlivePeriod int `toml:"session_keepalive_period" json:"session_keepalive_period"`
}

func NewDefaultConfig

func NewDefaultConfig() *Config

func (*Config) LoadFromFile

func (c *Config) LoadFromFile(path string) error

func (*Config) String

func (c *Config) String() string

type Proxy

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

func New

func New(config *Config) (*Proxy, error)

func (*Proxy) Close

func (s *Proxy) Close() error

func (*Proxy) FillSlot

func (s *Proxy) FillSlot(slots ...*models.Slot) error

func (*Proxy) GetConfig

func (s *Proxy) GetConfig() *Config

func (*Proxy) GetModel

func (s *Proxy) GetModel() *models.Proxy

func (*Proxy) GetSlots

func (s *Proxy) GetSlots() []*models.Slot

func (*Proxy) GetToken

func (s *Proxy) GetToken() string

func (*Proxy) GetXAuth

func (s *Proxy) GetXAuth() string

func (*Proxy) IsClosed

func (s *Proxy) IsClosed() bool

func (*Proxy) IsOnline

func (s *Proxy) IsOnline() bool

func (*Proxy) Start

func (s *Proxy) Start() error

type Stats

type Stats struct {
	Ops struct {
		Total int64             `json:"total"`
		Cmds  []*router.OpStats `json:"cmds,omitempty"`
	} `json:"ops"`

	Sessions struct {
		Total   int64 `json:"total"`
		Actived int64 `json:"actived"`
	} `json:"sessions"`
}

type Summary

type Summary struct {
	Version string `json:"version"`
	Compile string `json:"compile"`

	Config *Config `json:"config"`
	Online bool    `json:"online"`
	Closed bool    `json:"closed"`

	Model *models.Proxy  `json:"model"`
	Slots []*models.Slot `json:"slots,omitempty"`
	Stats *Stats         `json:"stats,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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