auth

package
v0.0.0-...-c328704 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CMD_AUTH       = "auth"
	CMD_AUTH_REPLY = "auth:reply"
)

Variables

View Source
var (
	ErrForbiddenKey = errors.New("forbidden key")
)

Functions

func ClientSide

func ClientSide(routes <-chan NextRoute) protocal.HandshakeHandleFunc

func ServerSide

func ServerSide(router *service.Router, authFn func(key string) (allow bool)) protocal.HandshakeHandleFunc

Types

type AuthReq

type AuthReq struct {
	Key string
}

type NextRoute

type NextRoute struct {
	Req        route.RouteReq
	HandleFunc protocal.HandshakeHandleFunc
	Cmd        string
	Details    interface{}
}

type Reply

type Reply struct {
	OK  bool
	Err string
}

Jump to

Keyboard shortcuts

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