Documentation ¶
Index ¶
- func LaunchAuth(fn GenerateAuthInfoFunc) tp.Plugin
- func Proxy(fn func(*ProxyLabel) Caller) tp.Plugin
- func ProxyPull(fn func(*ProxyLabel) PullCaller) tp.Plugin
- func ProxyPush(fn func(*ProxyLabel) PushCaller) tp.Plugin
- func VerifyAuth(fn VerifyAuthInfoFunc) tp.Plugin
- type AuthSession
- type Caller
- type GenerateAuthInfoFunc
- type ProxyLabel
- type PullCaller
- type PushCaller
- type VerifyAuthInfoFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LaunchAuth ¶
func LaunchAuth(fn GenerateAuthInfoFunc) tp.Plugin
LaunchAuth creates a plugin for initiating authorization.
func Proxy ¶
func Proxy(fn func(*ProxyLabel) Caller) tp.Plugin
Proxy creates a proxy plugin for handling unknown pulling and pushing.
func ProxyPull ¶
func ProxyPull(fn func(*ProxyLabel) PullCaller) tp.Plugin
ProxyPull creates a proxy plugin for handling unknown pulling.
func ProxyPush ¶
func ProxyPush(fn func(*ProxyLabel) PushCaller) tp.Plugin
ProxyPush creates a proxy plugin for handling unknown pushing.
func VerifyAuth ¶
func VerifyAuth(fn VerifyAuthInfoFunc) tp.Plugin
VerifyAuth creates a plugin for verifying authorization.
Types ¶
type AuthSession ¶
type AuthSession interface { // Peer returns the peer. Peer() tp.Peer // SetId sets the session id. SetId(newId string) // RemoteAddr returns the remote network address. RemoteAddr() net.Addr // Swap returns custom data swap of the session(socket). Swap() goutil.Map }
AuthSession auth session provides SetId, RemoteAddr and Swap methods in base session
type Caller ¶
type Caller interface { PullCaller PushCaller }
Caller the object used to pull and push
type GenerateAuthInfoFunc ¶
type GenerateAuthInfoFunc func() string
GenerateAuthInfoFunc the function used to generate auth info
type ProxyLabel ¶
type ProxyLabel struct {
SessionId, RealIp, Uri string
}
ProxyLabel proxy label information
type PullCaller ¶
type PullCaller interface {
Pull(uri string, arg interface{}, result interface{}, setting ...socket.PacketSetting) tp.PullCmd
}
PullCaller the object used to pull
type PushCaller ¶
type PushCaller interface {
Push(uri string, arg interface{}, setting ...socket.PacketSetting) *tp.Rerror
}
PushCaller the object used to push
type VerifyAuthInfoFunc ¶
type VerifyAuthInfoFunc func(authInfo string, sess AuthSession) *tp.Rerror
VerifyAuthInfoFunc the function used to verify auth info