auth

package
v5.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2018 License: Apache-2.0 Imports: 4 Imported by: 41

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLaunchPlugin

func NewLaunchPlugin(fn GenerateAuthInfoFunc) tp.Plugin

NewLaunchPlugin creates a plugin for initiating authorization.

func NewVerifyPlugin

func NewVerifyPlugin(fn VerifyAuthInfoFunc) tp.Plugin

NewVerifyPlugin creates a plugin for verifying authorization.

Types

type GenerateAuthInfoFunc

type GenerateAuthInfoFunc func() string

GenerateAuthInfoFunc the function used to generate auth info

type Session

type Session 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
}

Session auth session provides SetID, RemoteAddr and Swap methods in base session

type VerifyAuthInfoFunc

type VerifyAuthInfoFunc func(authInfo string, sess Session) *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