route

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2015 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Addresser

type Addresser interface {
	GetMasterShards(address string) (map[int]bool, error)
	GetSlaveShards(address string) (map[int]bool, error)
	GetAllAddresses() ([]string, error)
}

func NewDiscoveryAddresser

func NewDiscoveryAddresser(discoveryClient discovery.Client) Addresser

func NewSingleAddresser

func NewSingleAddresser(address string, numShards int) Addresser

type Dialer

type Dialer interface {
	Dial(address string) (*grpc.ClientConn, error)
	Clean() error
}

func NewDialer

func NewDialer(opts ...grpc.DialOption) Dialer

type Router

type Router interface {
	GetMasterShards() (map[int]bool, error)
	GetSlaveShards() (map[int]bool, error)
	GetMasterClientConn(shard int) (*grpc.ClientConn, error)
	GetMasterOrSlaveClientConn(shard int) (*grpc.ClientConn, error)
	GetAllClientConns() ([]*grpc.ClientConn, error)
}

func NewRouter

func NewRouter(
	addresser Addresser,
	dialer Dialer,
	localAddress string,
) Router

type Sharder

type Sharder interface {
	NumShards() int
	GetShard(path *pfs.Path) (int, error)
}

func NewSharder

func NewSharder(numShards int) Sharder

Jump to

Keyboard shortcuts

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