grid

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCreate        = errors.New("unable to initialize grid")
	ErrNoConnections = errors.New("no alive connections available")
	ErrGridEndpoint  = errors.New("error adding static endpoint")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	ConnectionsPerEndpoint int
}

type Grid

type Grid struct {
	*balancing.Tree[*transport.Connection, transport.Connection]
	// contains filtered or unexported fields
}

func NewWithOneEndpoint

func NewWithOneEndpoint(cfg OneEndpointConfig) *Grid

func NewWithStaticEndpoints

func NewWithStaticEndpoints(
	ctx context.Context,
	endpoints []string,
	creds credentials.TransportCredentials,
	auth transport.Authenticator,
	db string,
) (*Grid, error)

func NewWithThreeLevels

func NewWithThreeLevels(cfg Config) *Grid

func NewWithTwoLevels

func NewWithTwoLevels(cfg Config) *Grid

func (*Grid) AddEndpoint

func (g *Grid) AddEndpoint(path []string, connFunc func() (*transport.Connection, error)) error

func (*Grid) DeleteEndpoint

func (g *Grid) DeleteEndpoint(path []string) error

func (*Grid) Invoke

func (g *Grid) Invoke(ctx context.Context, method string, args any, reply any, opts ...grpc.CallOption) error

func (*Grid) NewStream

func (g *Grid) NewStream(
	ctx context.Context,
	desc *grpc.StreamDesc,
	method string,
	opts ...grpc.CallOption,
) (grpc.ClientStream, error)

type OneEndpointConfig

type OneEndpointConfig struct {
	ConnFunc          func() (*transport.Connection, error)
	ConnectionsNumber int
}

Jump to

Keyboard shortcuts

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