Documentation ¶
Index ¶
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 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 GenerateAuthInfoFunc ¶
type GenerateAuthInfoFunc func() string
GenerateAuthInfoFunc the function used to generate auth info
type VerifyAuthInfoFunc ¶
type VerifyAuthInfoFunc func(authInfo string, sess AuthSession) *tp.Rerror
VerifyAuthInfoFunc the function used to verify auth info
Click to show internal directories.
Click to hide internal directories.