plugin

package
v3.7.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 9, 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(caller Caller) tp.Plugin

Proxy creates a proxy plugin for handling unknown pulling and pushing.

func ProxyPull

func ProxyPull(fn PullFunc) tp.Plugin

ProxyPull creates a proxy plugin for handling unknown pulling.

func ProxyPush

func ProxyPush(fn PushFunc) 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 {
	// 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 {
	Pull(uri string, args interface{}, reply interface{}, setting ...socket.PacketSetting) tp.PullCmd
	Push(uri string, args interface{}, setting ...socket.PacketSetting) *tp.Rerror
}

Caller the object used to pull and push

type GenerateAuthInfoFunc

type GenerateAuthInfoFunc func() string

GenerateAuthInfoFunc the function used to generate auth info

type PullFunc

type PullFunc func(uri string, args interface{}, reply interface{}, setting ...socket.PacketSetting) tp.PullCmd

PullFunc the function used to pull

type PushFunc

type PushFunc func(uri string, args interface{}, setting ...socket.PacketSetting) *tp.Rerror

PushFunc the function 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