server

package
v0.0.0-...-5e74752 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2016 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AES-256
	KeyLength = 32
)

Variables

View Source
var (
	ErrFailedToLogin = errors.New("failed to login") // returned by concrete client
	ErrInvalidData   = errors.New("invalid data")    // returned by concrete client
	ErrWrongType     = errors.New("wrong session type")
	ErrTimeout       = errors.New("subtask timeout")
)
View Source
var (
	ErrNoPrivateKeyFound = errors.New("no private key found")
)
View Source
var PullTimeout = 30 * time.Second

Functions

func Decrypt

func Decrypt(content string, orig []byte) (string, error)

func Encrypt

func Encrypt(content string, key string) (string, error)

func GetNakedKey

func GetNakedKey(cipher string) ([]byte, error)

func InitDefaultDispatcher

func InitDefaultDispatcher()

It's main's obligation to invoke this function.

func InitPrivKey

func InitPrivKey()

This function could be called any times you want, explicitly or implicitly.

func NakedEncrypt

func NakedEncrypt(content string, orig []byte) (string, error)

Types

type Dispatcher

type Dispatcher struct {
	// contains filtered or unexported fields
}
var DefaultDispatcher *Dispatcher

func NewDispatcher

func NewDispatcher(capacity int, avaliableHandlers []string) *Dispatcher

func (*Dispatcher) PushSubtask

func (d *Dispatcher) PushSubtask(s *dispatcher.Subtask) <-chan *dispatcher.SubtaskResult

func (*Dispatcher) RunSubtask

func (*Dispatcher) ServeHTTP

func (d *Dispatcher) ServeHTTP(w http.ResponseWriter, r *http.Request)

type M

type M map[string]interface{}

Jump to

Keyboard shortcuts

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