auth

package
v4.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

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

Jump to

Keyboard shortcuts

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