Documentation ¶
Index ¶
- func BootstrapRingpop(rp *ringpop.Ringpop, provider discovery.DiscoverProvider) error
- func NewChannel() (*tchannel.Channel, error)
- func NewRingpop(ch *tchannel.Channel, ringpopPeerIP, ringpopPeerPort string, ...) (*ringpop.Ringpop, error)
- func RequestToKey(r *http.Request) string
- func ResolveDestinationNode(rp *ringpop.Ringpop, key string) (string, error)
- func SetLogger(logger bark.Logger)
- type Forwarder
- type HTTPResponseWriter
- type RequestForwarder
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BootstrapRingpop ¶
func BootstrapRingpop(rp *ringpop.Ringpop, provider discovery.DiscoverProvider) error
Bootstrap starts communication for this Ringpop instance. When Bootstrap is called, this Ringpop instance will attempt to contact other instances from the DiscoverProvider.
func NewChannel ¶
func NewChannel() (*tchannel.Channel, error)
NewChannel returns new TChannel used for communication between nodes in ring
func NewRingpop ¶
func NewRingpop(ch *tchannel.Channel, ringpopPeerIP, ringpopPeerPort string, logger bark.Logger) (*ringpop.Ringpop, error)
NewRingpop returns new ringpop
func RequestToKey ¶
RequestToKey converts request to key, that will be used for hash ring This func uses client IP as key
func ResolveDestinationNode ¶
ResolveDestinationNode finds out responsible node from hashring by given key
Types ¶
type Forwarder ¶
Forwarder is a request forwarder used to transfer request between nodes in hashring
type HTTPResponseWriter ¶
type HTTPResponseWriter struct {
// contains filtered or unexported fields
}
HTTPResponseWriter is a simple http.ResponseWriter implementation
func NewResponseWriter ¶
func NewResponseWriter() *HTTPResponseWriter
NewResponseWriter returns new HTTP ResponseWriter
func (*HTTPResponseWriter) Header ¶
func (r *HTTPResponseWriter) Header() http.Header
func (*HTTPResponseWriter) Response ¶
func (r *HTTPResponseWriter) Response() *http.Response
func (*HTTPResponseWriter) WriteHeader ¶
func (r *HTTPResponseWriter) WriteHeader(status int)
type RequestForwarder ¶
type RequestForwarder struct {
// contains filtered or unexported fields
}
RequestForwarder is a simple request forwarder that transfers request between nodes using ringpop
func NewForwarder ¶
func NewForwarder(rp *ringpop.Ringpop, l bark.Logger) *RequestForwarder
NewForwarder returns new request forwarder