httpsnapservice

package
v0.4.20 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2020 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PeerConfigPath = ""

PeerConfigPath use for testing

Functions

This section is empty.

Types

type Dialer

type Dialer func(network, addr string) (net.Conn, error)

Dialer is custom dialer to verify cert against pinset

type HTTPServiceImpl

type HTTPServiceImpl struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

HTTPServiceImpl used to create transaction service

func Get

func Get(channelID string) (*HTTPServiceImpl, error)

Get will return httpService to caller

func (*HTTPServiceImpl) GeneratePin

func (httpServiceImpl *HTTPServiceImpl) GeneratePin(c *x509.Certificate) string

GeneratePin returns pin of an x509 certificate

func (*HTTPServiceImpl) Invoke

func (httpServiceImpl *HTTPServiceImpl) Invoke(httpServiceInvokeRequest HTTPServiceInvokeRequest) ([]byte, errors.Error)

Invoke http service

func (*HTTPServiceImpl) NewInvoker added in v0.2.5

func (httpServiceImpl *HTTPServiceImpl) NewInvoker(httpServiceInvokeRequest HTTPServiceInvokeRequest) (Invoker, errors.Error)

NewInvoker returns a new Invoker

type HTTPServiceInvokeRequest

type HTTPServiceInvokeRequest struct {
	RequestURL     string
	RequestHeaders map[string]string
	RequestBody    string
	NamedClient    string
	PinSet         []string

	// TxID is used only for logging
	TxID string
}

HTTPServiceInvokeRequest used to create http invoke service

type Invoker added in v0.2.5

type Invoker interface {
	// Invoke invokes the HTTP service synchronously and returns the response or error
	Invoke() ([]byte, errors.Error)

	// InvokeAsync invokes the HTTP service asynchronously and returns a response channel and error channel,
	// one of which will return the result of the invocation
	InvokeAsync() (chan []byte, chan errors.Error)
}

Invoker invokes the HTTP service either synchronously or asynchronously.

type Metrics added in v0.4.0

type Metrics struct {
	HTTPCounter metrics.Counter
	HTTPTimer   metrics.Histogram
}

Metrics contain graphs

func NewMetrics added in v0.4.0

func NewMetrics(p metrics.Provider) *Metrics

NewMetrics create new instance of metrics

type PrivateKey

type PrivateKey struct {
	// contains filtered or unexported fields
}

PrivateKey is signer implementation for golang client TLS

func (*PrivateKey) Public

func (priv *PrivateKey) Public() crypto.PublicKey

Public returns the public key corresponding to priv.

func (*PrivateKey) Sign

func (priv *PrivateKey) Sign(rand io.Reader, msg []byte, opts crypto.SignerOpts) ([]byte, error)

Sign signs msg with priv, reading randomness from rand. If opts is a *PSSOptions then the PSS algorithm will be used, otherwise PKCS#1 v1.5 will be used. This method is intended to support keys where the private part is kept in, for example, a hardware module. Common uses should use the Sign* functions in this package.

Jump to

Keyboard shortcuts

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