Documentation
¶
Overview ¶
Package gsel provides selector definition and implements.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Builder ¶
Builder creates and returns selector in runtime.
type DoneFunc ¶
DoneFunc is callback function when RPC invoke done.
type DoneInfo ¶
type DoneInfo struct {
// Err is the rpc error the RPC finished with. It could be nil.
Err error
// Trailer contains the metadata from the RPC's trailer, if present.
Trailer DoneInfoMD
// BytesSent indicates if any bytes have been sent to the server.
BytesSent bool
// BytesReceived indicates if any byte has been received from the server.
BytesReceived bool
// ServerLoad is the load received from server. It's usually sent as part of
// trailing metadata.
//
// The only supported type now is *orca_v1.LoadReport.
ServerLoad interface{}
}
DoneInfo contains additional information for done.
type DoneInfoMD ¶
type DoneInfoMD interface {
// Len returns the number of items in md.
Len() int
// Get obtains the values for a given key.
//
// k is converted to lowercase before searching in md.
Get(k string) []string
// Set sets the value of a given key with a slice of values.
//
// k is converted to lowercase before storing in md.
Set(key string, values ...string)
// Append adds the values to key k, not overwriting what was already stored at
// that key.
//
// k is converted to lowercase before storing in md.
Append(k string, values ...string)
// Delete removes the values for a given key k which is converted to lowercase
// before removing it from md.
Delete(k string)
}
DoneInfoMD is a mapping from metadata keys to value array. Users should use the following two convenience functions New and Pairs to generate MD.
Source Files
¶
- gsel.go
- gsel_builder.go
- gsel_builder_least_connection.go
- gsel_builder_random.go
- gsel_builder_round_robin.go
- gsel_builder_weight.go
- gsel_selector_least_connection.go
- gsel_selector_random.go
- gsel_selector_round_robin.go
- gsel_selector_weight.go
Click to show internal directories.
Click to hide internal directories.