Documentation ¶
Index ¶
Constants ¶
View Source
const ( // HandlerError is error in handler HandlerError int = -1 // BadRequest is bad formed request BadRequest int = -2 )
View Source
const ( // REFERENCE is field for reference REFERENCE = "reference" // SEED is field to reference SEED = "seed" )
View Source
const TraceIDQueryParam = "traceID"
Variables ¶
This section is empty.
Functions ¶
func RandTraceID ¶ added in v0.6.2
func RandTraceID() string
RandTraceID returns random traceID in uuid format
Types ¶
type Params ¶
type Params struct { QueryType string `json:"query_type"` Name string `json:"name"` Reference string `json:"reference"` From string `json:"from"` To string `json:"to"` Method string `json:"method"` Requester string `json:"requester"` Target string `json:"target"` Amount uint `json:"amount"` PublicKey string `json:"public_key"` Roles []string `json:"roles"` NumberOfBootstrapNodes uint `json:"bootstrap_nodes_num"` MajorityRule uint `json:"majority_rule"` Host string `json:"host"` }
Params contains supported query params
type QueryType ¶
type QueryType int
QueryType represents type of query
const ( UNDEFINED QueryType = iota CreateMember DumpUserInfo GetBalance SendMoney DumpAllUsers RegisterNode IsAuth GetSeed )
Supported query types
func QTypeFromString ¶
QTypeFromString converts string representation to enum
type RequestHandler ¶
type RequestHandler struct {
// contains filtered or unexported fields
}
RequestHandler encapsulate processing of request
func NewRequestHandler ¶
func NewRequestHandler(params *Params, messageBus core.MessageBus, nc core.NetworkCoordinator, rootDomainReference core.RecordRef, smanager *seedmanager.SeedManager) *RequestHandler
NewRequestHandler creates new query handler
func (*RequestHandler) ProcessGetSeed ¶ added in v0.5.0
func (rh *RequestHandler) ProcessGetSeed(ctx context.Context) (map[string]interface{}, error)
ProcessGetSeed processes get seed request
func (*RequestHandler) ProcessIsAuthorized ¶ added in v0.4.0
func (rh *RequestHandler) ProcessIsAuthorized(ctx context.Context) (map[string]interface{}, error)
ProcessIsAuthorized processes is_auth query type
func (*RequestHandler) ProcessRegisterNode ¶ added in v0.3.0
func (rh *RequestHandler) ProcessRegisterNode(ctx context.Context) (map[string]interface{}, error)
ProcessRegisterNode process register node response
Source Files ¶
Click to show internal directories.
Click to hide internal directories.