requestmgr

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Element

type Element struct {
	Namespace  string
	Collection string
	Key        string
	Value      []byte
	Expiry     time.Time
}

Element contains transient data for a single key

type Elements

type Elements []*Element

Elements is a slice of Element

func AsElements added in v0.1.4

func AsElements(i interface{}) Elements

AsElements converts the given value to Elements

func (Elements) Get

func (e Elements) Get(ns, coll, key string) (*Element, bool)

Get returns the Element matching the given namespace, collection, and key.

type Request

type Request interface {
	ID() uint64
	GetResponse(context context.Context) (*Response, error)
	Cancel()
}

Request is an interface to get the response

type RequestMgr

type RequestMgr interface {
	Respond(reqID uint64, response *Response)
	NewRequest() Request
}

RequestMgr is an interface to create a new request and to respond to the request

func Get

func Get(channelID string) RequestMgr

Get returns the RequestMgr for the given channel

type Response

type Response struct {
	Endpoint  string      // The endpoint of the peer that sent the response
	MSPID     string      // The MSP ID of the peer that sent the response
	Signature []byte      // The signature of the peer that provided the data
	Identity  []byte      // The identity of the peer that sent the response
	Data      interface{} // The response data
}

Response is the response from a remote peer for a collection of transient data keys

Jump to

Keyboard shortcuts

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