commandhandler

package
Version: v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2019 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package commandhandler contains functions that are used to resolve commands issued to issuers and providers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlindSignRequestHandler

func BlindSignRequestHandler(ctx context.Context, reqData HandlerData) *commands.Response

func BlindVerifyRequestHandler

func BlindVerifyRequestHandler(ctx context.Context, reqData HandlerData) *commands.Response

func DefaultResponse

func DefaultResponse() *commands.Response

func LookUpBlockCredentialsRequestHandler

func LookUpBlockCredentialsRequestHandler(ctx context.Context, reqData HandlerData) *commands.Response

func LookUpCredentialRequestHandler

func LookUpCredentialRequestHandler(ctx context.Context, reqData HandlerData) *commands.Response

func SignRequestHandler

func SignRequestHandler(ctx context.Context, reqData HandlerData) *commands.Response

func SpendCredentialRequestHandler

func SpendCredentialRequestHandler(ctx context.Context, reqData HandlerData) *commands.Response

func VerificationKeyRequestHandler

func VerificationKeyRequestHandler(ctx context.Context, reqData HandlerData) *commands.Response

func VerifyRequestHandler

func VerifyRequestHandler(ctx context.Context, reqData HandlerData) *commands.Response

Types

type BlindSignRequestHandlerData

type BlindSignRequestHandlerData struct {
	Cmd       *commands.BlindSignRequest
	Worker    *coconutworker.CoconutWorker
	Logger    *logging.Logger
	SecretKey *coconut.ThresholdSecretKey
}

func (*BlindSignRequestHandlerData) CoconutWorker

func (handlerData *BlindSignRequestHandlerData) CoconutWorker() *coconutworker.CoconutWorker

func (*BlindSignRequestHandlerData) Command

func (handlerData *BlindSignRequestHandlerData) Command() commands.Command

func (*BlindSignRequestHandlerData) Data

func (handlerData *BlindSignRequestHandlerData) Data() interface{}

func (*BlindSignRequestHandlerData) Log

func (handlerData *BlindSignRequestHandlerData) Log() *logging.Logger

type BlindVerifyRequestHandlerData

type BlindVerifyRequestHandlerData struct {
	Cmd             *commands.BlindVerifyRequest
	Worker          *coconutworker.CoconutWorker
	Logger          *logging.Logger
	VerificationKey *coconut.VerificationKey
}

func (*BlindVerifyRequestHandlerData) CoconutWorker

func (handlerData *BlindVerifyRequestHandlerData) CoconutWorker() *coconutworker.CoconutWorker

func (*BlindVerifyRequestHandlerData) Command

func (handlerData *BlindVerifyRequestHandlerData) Command() commands.Command

func (*BlindVerifyRequestHandlerData) Data

func (handlerData *BlindVerifyRequestHandlerData) Data() interface{}

func (*BlindVerifyRequestHandlerData) Log

func (handlerData *BlindVerifyRequestHandlerData) Log() *logging.Logger

type HandlerData

type HandlerData interface {
	Command() commands.Command
	CoconutWorker() *coconutworker.CoconutWorker
	Log() *logging.Logger
	Data() interface{}
}

command - request to resolve logger - possibly to remove later? pointer to coconut worker - that deals with actual crypto (passes it down to workers etc) request specific piece of data - for sign it's the secret key, for verify it's the verification key, etc.

type HandlerFunc

type HandlerFunc func(context.Context, HandlerData) *commands.Response

context is really useful for the most time consuming functions like blindverify it is not very useful for say "getVerificatonKey", but nevertheless, it is there for both, completion sake and future proofness

type HandlerRegistry

type HandlerRegistry map[reflect.Type]HandlerRegistryEntry

TODO: perhaps if it's too expensive, replace reflect.Type with some string or even a byte?

type HandlerRegistryEntry

type HandlerRegistryEntry struct {
	DataFn func(cmd commands.Command) HandlerData
	Fn     HandlerFunc
}

type LookUpBlockCredentialsRequestHandlerData

type LookUpBlockCredentialsRequestHandlerData struct {
	Cmd    *commands.LookUpBlockCredentialsRequest
	Worker *coconutworker.CoconutWorker
	Logger *logging.Logger
	Store  *storage.Database
}

func (*LookUpBlockCredentialsRequestHandlerData) CoconutWorker

func (*LookUpBlockCredentialsRequestHandlerData) Command

func (*LookUpBlockCredentialsRequestHandlerData) Data

func (handlerData *LookUpBlockCredentialsRequestHandlerData) Data() interface{}

func (*LookUpBlockCredentialsRequestHandlerData) Log

func (handlerData *LookUpBlockCredentialsRequestHandlerData) Log() *logging.Logger

type LookUpCredentialRequestHandlerData

type LookUpCredentialRequestHandlerData struct {
	Cmd    *commands.LookUpCredentialRequest
	Worker *coconutworker.CoconutWorker
	Logger *logging.Logger
	Store  *storage.Database
}

func (*LookUpCredentialRequestHandlerData) CoconutWorker

func (handlerData *LookUpCredentialRequestHandlerData) CoconutWorker() *coconutworker.CoconutWorker

func (*LookUpCredentialRequestHandlerData) Command

func (handlerData *LookUpCredentialRequestHandlerData) Command() commands.Command

func (*LookUpCredentialRequestHandlerData) Data

func (handlerData *LookUpCredentialRequestHandlerData) Data() interface{}

func (*LookUpCredentialRequestHandlerData) Log

func (handlerData *LookUpCredentialRequestHandlerData) Log() *logging.Logger

type SignRequestHandlerData

type SignRequestHandlerData struct {
	Cmd       *commands.SignRequest
	Worker    *coconutworker.CoconutWorker
	Logger    *logging.Logger
	SecretKey *coconut.ThresholdSecretKey
}

func (*SignRequestHandlerData) CoconutWorker

func (handlerData *SignRequestHandlerData) CoconutWorker() *coconutworker.CoconutWorker

func (*SignRequestHandlerData) Command

func (handlerData *SignRequestHandlerData) Command() commands.Command

func (*SignRequestHandlerData) Data

func (handlerData *SignRequestHandlerData) Data() interface{}

func (*SignRequestHandlerData) Log

func (handlerData *SignRequestHandlerData) Log() *logging.Logger

type SpendCredentialRequestHandlerData

type SpendCredentialRequestHandlerData struct {
	Cmd              *commands.SpendCredentialRequest
	Worker           *coconutworker.CoconutWorker
	Logger           *logging.Logger
	VerificationData SpendCredentialVerificationData
}

func (*SpendCredentialRequestHandlerData) CoconutWorker

func (handlerData *SpendCredentialRequestHandlerData) CoconutWorker() *coconutworker.CoconutWorker

func (*SpendCredentialRequestHandlerData) Command

func (handlerData *SpendCredentialRequestHandlerData) Command() commands.Command

func (*SpendCredentialRequestHandlerData) Data

func (handlerData *SpendCredentialRequestHandlerData) Data() interface{}

func (*SpendCredentialRequestHandlerData) Log

func (handlerData *SpendCredentialRequestHandlerData) Log() *logging.Logger

type SpendCredentialVerificationData

type SpendCredentialVerificationData struct {
	Avk       *coconut.VerificationKey
	Address   ethcommon.Address
	NymClient *nymclient.Client // in theory it should be safe to use the same instance for multiple requests
}

type VerificationKeyRequestHandlerData

type VerificationKeyRequestHandlerData struct {
	Cmd             *commands.VerificationKeyRequest
	Worker          *coconutworker.CoconutWorker
	Logger          *logging.Logger
	VerificationKey *coconut.ThresholdVerificationKey
}

func (*VerificationKeyRequestHandlerData) CoconutWorker

func (handlerData *VerificationKeyRequestHandlerData) CoconutWorker() *coconutworker.CoconutWorker

func (*VerificationKeyRequestHandlerData) Command

func (handlerData *VerificationKeyRequestHandlerData) Command() commands.Command

func (*VerificationKeyRequestHandlerData) Data

func (handlerData *VerificationKeyRequestHandlerData) Data() interface{}

func (*VerificationKeyRequestHandlerData) Log

func (handlerData *VerificationKeyRequestHandlerData) Log() *logging.Logger

type VerifyRequestHandlerData

type VerifyRequestHandlerData struct {
	Cmd             *commands.VerifyRequest
	Worker          *coconutworker.CoconutWorker
	Logger          *logging.Logger
	VerificationKey *coconut.VerificationKey
}

func (*VerifyRequestHandlerData) CoconutWorker

func (handlerData *VerifyRequestHandlerData) CoconutWorker() *coconutworker.CoconutWorker

func (*VerifyRequestHandlerData) Command

func (handlerData *VerifyRequestHandlerData) Command() commands.Command

func (*VerifyRequestHandlerData) Data

func (handlerData *VerifyRequestHandlerData) Data() interface{}

func (*VerifyRequestHandlerData) Log

func (handlerData *VerifyRequestHandlerData) Log() *logging.Logger

Jump to

Keyboard shortcuts

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