util

package
v0.0.105 Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 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
	Conn    *grpc.ClientConn
	Counter int64
}

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
	Closed bool
}

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) CloseAll added in v0.0.79

func (cp *ConnectionPool) CloseAll()

func (*ConnectionPool) Get

func (cp *ConnectionPool) Get() *Connection

func (*ConnectionPool) GetWithRetry

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

func (*ConnectionPool) NewConnection added in v0.0.79

func (cp *ConnectionPool) NewConnection(address string) *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