plugin

package
v3.8.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2018 License: Apache-2.0 Imports: 5 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 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

Jump to

Keyboard shortcuts

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