common

package
v1.32.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: MIT Imports: 13 Imported by: 117

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(protoAddr string) (net.Conn, error)

Connect dials the given address and returns a net.Conn. The protoAddr argument should be prefixed with the protocol, eg. "tcp://127.0.0.1:8080" or "unix:///tmp/test.sock"

func DialerFunc

func DialerFunc(ctx context.Context, addr string) (net.Conn, error)

func HexToBytes

func HexToBytes(str string) ([]byte, error)

func LoadNetwork

func LoadNetwork(name string, node string) network

func LoadTlsCert

func LoadTlsCert(path string, serverName string) credentials.TransportCredentials

func ProtocolAndAddress

func ProtocolAndAddress(listenAddr string) (string, string)

ProtocolAndAddress splits an address into the protocol and address components. For instance, "tcp://127.0.0.1:8080" will be split into "tcp" and "127.0.0.1:8080". If the address has no protocol prefix, the default is "tcp".

Types

type ClientOption

type ClientOption func(opts *ClientOptions) error

func OptionGasPrices

func OptionGasPrices(gasPrices string) ClientOption

func OptionTLSCert

func OptionTLSCert(tlsCert credentials.TransportCredentials) ClientOption

type ClientOptions

type ClientOptions struct {
	GasPrices string
	TLSCert   credentials.TransportCredentials
}

func DefaultClientOptions

func DefaultClientOptions() *ClientOptions

Jump to

Keyboard shortcuts

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