Documentation ¶
Index ¶
- func RegisterPeerPicker(fn func() PeerPicker)
- type AtomicInt
- type ByteView
- func (v ByteView) At(i int) byte
- func (v ByteView) ByteSlice() []byte
- func (v ByteView) Copy(dest []byte) int
- func (v ByteView) Equal(b2 ByteView) bool
- func (v ByteView) EqualBytes(b2 []byte) bool
- func (v ByteView) EqualString(s string) bool
- func (v ByteView) Len() int
- func (v ByteView) ReadAt(p []byte, off int64) (n int, err error)
- func (v ByteView) Reader() io.ReadSeeker
- func (v ByteView) Slice(from, to int) ByteView
- func (v ByteView) SliceFrom(from int) ByteView
- func (v ByteView) String() string
- func (v ByteView) WriteTo(w io.Writer) (n int64, err error)
- type CacheStats
- type Getter
- type GetterFunc
- type Group
- type HTTPPool
- type HTTPPoolOptions
- type PeerPicker
- type ProtoGetter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterPeerPicker ¶
func RegisterPeerPicker(fn func() PeerPicker)
Types ¶
type ByteView ¶
type ByteView struct {
// contains filtered or unexported fields
}
A ByteView holds an immutable view of bytes. Internally it wraps either a []byte or a string, but that detail is invisible to callers.
A ByteView is meant to be used as a value type, not a pointer (like a time.Time).
func (ByteView) EqualBytes ¶
EqualBytes returns whether the bytes in b are the same as the bytes in b2.
func (ByteView) EqualString ¶
EqualString returns whether the bytes in b are the same as the bytes in s.
func (ByteView) Reader ¶
func (v ByteView) Reader() io.ReadSeeker
Reader returns an io.ReadSeeker for the bytes in v.
type CacheStats ¶
type GetterFunc ¶
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
type HTTPPool ¶
type HTTPPool struct {
// contains filtered or unexported fields
}
func NewHTTPPool ¶
func NewHTTPPoolOpts ¶
func NewHTTPPoolOpts(self string, o *HTTPPoolOptions) *HTTPPool
func (*HTTPPool) PickPeer ¶
func (p *HTTPPool) PickPeer(key string) ProtoGetter
type HTTPPoolOptions ¶
type HTTPPoolOptions struct { BasePath string Replicas int HashFn consistenthash.Hash }
type PeerPicker ¶
type PeerPicker interface {
PickPeer(key string) ProtoGetter
}
Click to show internal directories.
Click to hide internal directories.