Documentation
¶
Index ¶
- Variables
- type AddrListener
- type ChanListener
- func (l *ChanListener) Accept() (net.Conn, error)
- func (l *ChanListener) Addr() (addr net.Addr)
- func (l *ChanListener) Close() error
- func (l *ChanListener) Dial(ctx context.Context, remoteAddr string) (con net.Conn, err error)
- func (l *ChanListener) Listen() (err error)
- func (l *ChanListener) Name() string
- func (l *ChanListener) OnClose(f ...func())
- func (l *ChanListener) ProtoAddr() string
- func (l *ChanListener) String() string
- type ClientListeners
- type ContextKey
- type DB
- type DefaultReversePortForwardingRegister
- func (r *DefaultReversePortForwardingRegister) Get(ctx ssh.Context, addr string) (ln net.Listener, ok bool)
- func (r *DefaultReversePortForwardingRegister) GetListener(apName, serviceName string, addr ...string) (ln *ServiceListener, err error)
- func (r *DefaultReversePortForwardingRegister) Register(ctx ssh.Context, addr string, ln net.Listener) error
- func (r *DefaultReversePortForwardingRegister) UnRegister(ctx ssh.Context, addr string) (ln net.Listener, ok bool)
- type Dialer
- type HostPaths
- type HttpHosts
- type HttpUsers
- func (a *HttpUsers) Empty() bool
- func (a *HttpUsers) Match(user, password string) bool
- func (a *HttpUsers) Remove(user ...string) *HttpUsers
- func (a *HttpUsers) Scan(src interface{}) (err error)
- func (a *HttpUsers) Set(user, password string) *HttpUsers
- func (a *HttpUsers) Value() (v driver.Value, err error)
- type LB
- type Listener
- type LoadBalancer
- type LoadBalancerFilter
- type LoadBalancers
- func (s *LoadBalancers) Add(ap, service string, maxCount int, publicAddr string) (err error)
- func (s *LoadBalancers) Get(ap, service string) (balancer *LoadBalancer, err error)
- func (s *LoadBalancers) GetUsers(ap, service string) (users HttpUsers, enabled bool, err error)
- func (s *LoadBalancers) HttpUserAdd(ap, name, username, pasword string) (err error)
- func (s *LoadBalancers) HttpUserRemove(ap, name string, username ...string) (err error)
- func (s *LoadBalancers) List(cb func(i int, lb *LoadBalancer) error, filter *LoadBalancerFilter) (err error)
- func (s *LoadBalancers) Remove(ap string, name ...string) (removed int64, err error)
- func (s *LoadBalancers) Set(ap, name, field string, value interface{}) (err error)
- func (s *LoadBalancers) SetHttpAuthEnabled(ap, name string, value bool) (err error)
- func (s *LoadBalancers) SetHttpHost(ap, name string, value *string) (err error)
- func (s *LoadBalancers) SetHttpPath(ap, name string, value string) (err error)
- func (s *LoadBalancers) SetMaxCount(ap, name string, value int) (err error)
- func (s *LoadBalancers) SetPublicAddr(ap, name, value string) (err error)
- func (s *LoadBalancers) SetUnixSocket(ap, name string, value bool) (err error)
- type Node
- func (n Node) Close() (err error)
- func (n Node) CloseEndPont(addr string)
- func (n Node) Forever()
- func (n Node) Listen() (err error)
- func (n Node) NextDial(ctx context.Context, remoteAddr string) (conn net.Conn, err error)
- func (n Node) NextDialSl(ctx context.Context, remoteAddr string) (sl *NodeServiceListener, conn net.Conn, err error)
- func (n Node) String() string
- type NodeServiceListener
- type Nodes
- type PubKeySigner
- type Server
- func (srv *Server) CreateToken() (err error)
- func (srv *Server) IsRunning() bool
- func (srv *Server) RoundTrip(lb *LB, r *http.Request) (resp *http.Response, err error)
- func (srv *Server) Run() (err error)
- func (srv *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (srv *Server) Setup(appender task.Appender) (err error)
- func (srv *Server) Start(done func()) (stop task.Stoper, err error)
- func (srv *Server) Stop()
- type ServiceListener
- type UnixListener
- func (l *UnixListener) Addr() net.Addr
- func (l *UnixListener) Close() (err error)
- func (l *UnixListener) Listen() (err error)
- func (l *UnixListener) OnClose(f ...func())
- func (l *UnixListener) ProtoAddr() string
- func (l *UnixListener) RemoveSocketFile() (err error)
- func (l UnixListener) String() string
- type User
- type Users
- func (s *Users) Add(name string, isAp, updateKey bool) (err error)
- func (s *Users) CheckUser(user, key string) (err error, ok, isAp bool)
- func (s *Users) IsAp(user string) (ok bool, err error)
- func (s *Users) List(isAp bool, cb func(i int, u *User) error, nameMatch ...string) (err error)
- func (s *Users) Remove(name ...string) (removed int64, err error)
- func (s *Users) SetUpdateKeyFlag(value bool, name ...string) (removed int64, err error)
- type VirtualAddr
- type VirtualCon
- func (con VirtualCon) Close() error
- func (con VirtualCon) LocalAddr() net.Addr
- func (con VirtualCon) Read(p []byte) (n int, err error)
- func (con VirtualCon) RemoteAddr() net.Addr
- func (con VirtualCon) SetDeadline(t time.Time) error
- func (con VirtualCon) SetReadDeadline(t time.Time) error
- func (con VirtualCon) SetWriteDeadline(t time.Time) error
- func (con VirtualCon) Write(p []byte) (n int, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultKeepAliveIdleInterval specifies how long connection can be idle // before sending keepalive message. DefaultKeepAliveIdleInterval = 15 * time.Minute // DefaultKeepAliveCount specifies maximal number of keepalive messages // sent before marking connection as dead. DefaultKeepAliveCount = 8 // DefaultKeepAliveInterval specifies how often retry sending keepalive // messages when no response is received. DefaultKeepAliveInterval = 5 * time.Second )
View Source
var ErrStopIteration = errors.New("stop iteration")
Functions ¶
This section is empty.
Types ¶
type AddrListener ¶
type AddrListener struct {
AddrS string
net.Listener
StrPrefix string
// contains filtered or unexported fields
}
func (*AddrListener) Close ¶
func (l *AddrListener) Close() (err error)
func (*AddrListener) Listen ¶
func (l *AddrListener) Listen() (err error)
func (AddrListener) ProtoAddr ¶ added in v0.1.11
func (l AddrListener) ProtoAddr() string
func (AddrListener) String ¶
func (l AddrListener) String() string
type ChanListener ¶ added in v0.1.11
type ChanListener struct {
// contains filtered or unexported fields
}
func NewChanListener ¶ added in v0.1.11
func NewChanListener(name string) *ChanListener
func (*ChanListener) Addr ¶ added in v0.1.11
func (l *ChanListener) Addr() (addr net.Addr)
func (*ChanListener) Close ¶ added in v0.1.11
func (l *ChanListener) Close() error
func (*ChanListener) Listen ¶ added in v0.1.11
func (l *ChanListener) Listen() (err error)
func (*ChanListener) Name ¶ added in v0.1.12
func (l *ChanListener) Name() string
func (*ChanListener) OnClose ¶ added in v0.1.11
func (l *ChanListener) OnClose(f ...func())
func (*ChanListener) ProtoAddr ¶ added in v0.1.11
func (l *ChanListener) ProtoAddr() string
func (*ChanListener) String ¶ added in v0.1.11
func (l *ChanListener) String() string
type ClientListeners ¶
type ClientListeners struct {
// contains filtered or unexported fields
}
func (*ClientListeners) Add ¶
func (cl *ClientListeners) Add(sl ...*ServiceListener)
func (*ClientListeners) Close ¶
func (cl *ClientListeners) Close()
type DefaultReversePortForwardingRegister ¶
type DefaultReversePortForwardingRegister struct {
Nodes *Nodes
HttpHosts *HttpHosts
// contains filtered or unexported fields
}
func (*DefaultReversePortForwardingRegister) GetListener ¶
func (r *DefaultReversePortForwardingRegister) GetListener(apName, serviceName string, addr ...string) (ln *ServiceListener, err error)
func (*DefaultReversePortForwardingRegister) UnRegister ¶
type HostPaths ¶ added in v0.1.11
type HostPaths struct {
// contains filtered or unexported fields
}
func (*HostPaths) Set ¶ added in v0.1.11
func (hp *HostPaths) Set(lb *LoadBalancer, n *Node)
type HttpHosts ¶ added in v0.1.11
type HttpHosts struct {
// contains filtered or unexported fields
}
func (*HttpHosts) GetOrRegister ¶ added in v0.1.12
type HttpUsers ¶ added in v0.1.11
type HttpUsers struct {
// contains filtered or unexported fields
}
type LB ¶ added in v0.1.11
type LB struct {
*LoadBalancer
Node *Node
}
type LoadBalancer ¶
type LoadBalancerFilter ¶
type LoadBalancers ¶
type LoadBalancers struct {
*DB
}
func NewLoadBalancers ¶
func NewLoadBalancers(DB *DB) *LoadBalancers
func (*LoadBalancers) Add ¶
func (s *LoadBalancers) Add(ap, service string, maxCount int, publicAddr string) (err error)
func (*LoadBalancers) Get ¶
func (s *LoadBalancers) Get(ap, service string) (balancer *LoadBalancer, err error)
func (*LoadBalancers) GetUsers ¶ added in v0.1.11
func (s *LoadBalancers) GetUsers(ap, service string) (users HttpUsers, enabled bool, err error)
func (*LoadBalancers) HttpUserAdd ¶ added in v0.1.11
func (s *LoadBalancers) HttpUserAdd(ap, name, username, pasword string) (err error)
func (*LoadBalancers) HttpUserRemove ¶ added in v0.1.11
func (s *LoadBalancers) HttpUserRemove(ap, name string, username ...string) (err error)
func (*LoadBalancers) List ¶
func (s *LoadBalancers) List(cb func(i int, lb *LoadBalancer) error, filter *LoadBalancerFilter) (err error)
func (*LoadBalancers) Remove ¶
func (s *LoadBalancers) Remove(ap string, name ...string) (removed int64, err error)
func (*LoadBalancers) Set ¶ added in v0.1.11
func (s *LoadBalancers) Set(ap, name, field string, value interface{}) (err error)
func (*LoadBalancers) SetHttpAuthEnabled ¶ added in v0.1.11
func (s *LoadBalancers) SetHttpAuthEnabled(ap, name string, value bool) (err error)
func (*LoadBalancers) SetHttpHost ¶ added in v0.1.11
func (s *LoadBalancers) SetHttpHost(ap, name string, value *string) (err error)
func (*LoadBalancers) SetHttpPath ¶ added in v0.1.11
func (s *LoadBalancers) SetHttpPath(ap, name string, value string) (err error)
func (*LoadBalancers) SetMaxCount ¶ added in v0.1.11
func (s *LoadBalancers) SetMaxCount(ap, name string, value int) (err error)
func (*LoadBalancers) SetPublicAddr ¶ added in v0.1.11
func (s *LoadBalancers) SetPublicAddr(ap, name, value string) (err error)
func (*LoadBalancers) SetUnixSocket ¶ added in v0.1.11
func (s *LoadBalancers) SetUnixSocket(ap, name string, value bool) (err error)
type Node ¶
type Node struct {
*ChanListener
Dir string
Ap, Service string
Listeners []Listener
EndPoints map[string]*NodeServiceListener
// contains filtered or unexported fields
}
func (Node) CloseEndPont ¶
func (Node) NextDialSl ¶ added in v0.1.12
type NodeServiceListener ¶
type NodeServiceListener struct {
*ServiceListener
// contains filtered or unexported fields
}
type Nodes ¶
type Nodes struct {
Dir string
Ln net.Listener
SockPerm os.FileMode
// contains filtered or unexported fields
}
func (*Nodes) Add ¶
func (ns *Nodes) Add(LB *LoadBalancer, ln *ServiceListener) (node *Node, err error)
func (*Nodes) Remove ¶
func (ns *Nodes) Remove(LB *LoadBalancer, ln *NodeServiceListener)
type PubKeySigner ¶
type PubKeySigner struct {
// contains filtered or unexported fields
}
func (PubKeySigner) PublicKey ¶
func (s PubKeySigner) PublicKey() ssh.PublicKey
type Server ¶
type Server struct {
KeyFile string
Addr string
HttpConfig *httpu.Config
SocketsDir string
NodeSockerPerm os.FileMode
Updater updater.Updater
Cron *cron.Cron
RenewTokenSchedule cron.Schedule
Users *Users
LoadBalancers *LoadBalancers
HttpHosts *HttpHosts
// contains filtered or unexported fields
}
func (*Server) CreateToken ¶ added in v0.1.11
func (*Server) ServeHTTP ¶ added in v0.1.11
func (srv *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
type ServiceListener ¶
type ServiceListener struct {
Name string
Listener
Client ssh.Session
// contains filtered or unexported fields
}
func (*ServiceListener) Close ¶
func (sl *ServiceListener) Close() error
type UnixListener ¶
type UnixListener struct {
net.Listener
Str string
RootDir string
SocketPath string
SockPerm os.FileMode
// contains filtered or unexported fields
}
func (*UnixListener) Addr ¶ added in v0.1.11
func (l *UnixListener) Addr() net.Addr
func (*UnixListener) Close ¶
func (l *UnixListener) Close() (err error)
func (*UnixListener) Listen ¶
func (l *UnixListener) Listen() (err error)
func (*UnixListener) OnClose ¶ added in v0.1.11
func (l *UnixListener) OnClose(f ...func())
func (*UnixListener) ProtoAddr ¶ added in v0.1.11
func (l *UnixListener) ProtoAddr() string
func (*UnixListener) RemoveSocketFile ¶
func (l *UnixListener) RemoveSocketFile() (err error)
func (UnixListener) String ¶
func (l UnixListener) String() string
type VirtualAddr ¶ added in v0.1.11
type VirtualAddr struct {
Name string
}
func (VirtualAddr) Network ¶ added in v0.1.11
func (addr VirtualAddr) Network() string
func (VirtualAddr) String ¶ added in v0.1.11
func (addr VirtualAddr) String() string
type VirtualCon ¶ added in v0.1.11
type VirtualCon struct {
Writer io.Writer
Reader io.Reader
LAddr net.Addr
RAddr net.Addr
// contains filtered or unexported fields
}
func (VirtualCon) Close ¶ added in v0.1.11
func (con VirtualCon) Close() error
func (VirtualCon) LocalAddr ¶ added in v0.1.11
func (con VirtualCon) LocalAddr() net.Addr
func (VirtualCon) RemoteAddr ¶ added in v0.1.11
func (con VirtualCon) RemoteAddr() net.Addr
func (VirtualCon) SetDeadline ¶ added in v0.1.11
func (con VirtualCon) SetDeadline(t time.Time) error
func (VirtualCon) SetReadDeadline ¶ added in v0.1.11
func (con VirtualCon) SetReadDeadline(t time.Time) error
func (VirtualCon) SetWriteDeadline ¶ added in v0.1.11
func (con VirtualCon) SetWriteDeadline(t time.Time) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.