util

package
v0.0.61 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeToString added in v0.0.46

func EncodeToString(b []byte) string

BytesToString Alternative to hex.EncodeToString(b)

Types

type Connection

type Connection struct {
	Address string
	Client  pb.VeriServiceClient
	Conn    *grpc.ClientConn
}

func NewConnection

func NewConnection(address string) *Connection

func (*Connection) Close

func (c *Connection) Close()

type ConnectionCache

type ConnectionCache struct {
	Provider goburrow.LoadingCache
}

func NewConnectionCache

func NewConnectionCache() *ConnectionCache

func (*ConnectionCache) Close added in v0.0.49

func (cc *ConnectionCache) Close(c *Connection)

func (*ConnectionCache) Get

func (cc *ConnectionCache) Get(address string) *Connection

func (*ConnectionCache) Put

func (cc *ConnectionCache) Put(c *Connection)

type ConnectionPool

type ConnectionPool struct {
	Pool *sync.Pool
}

func NewConnectionPool

func NewConnectionPool(address string) *ConnectionPool

Func to init pool

func (*ConnectionPool) Close added in v0.0.49

func (cp *ConnectionPool) Close(conn *Connection)

func (*ConnectionPool) Get

func (cp *ConnectionPool) Get() *Connection

func (*ConnectionPool) GetWithRetry

func (cp *ConnectionPool) GetWithRetry(count int) *Connection

func (*ConnectionPool) Put

func (cp *ConnectionPool) Put(conn *Connection)

func (*ConnectionPool) PutIfHealthy

func (cp *ConnectionPool) PutIfHealthy(conn *Connection)

Jump to

Keyboard shortcuts

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