ribbon

package
v0.0.0-...-168b963 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package ribbon is named after the NetflixOSS routing and load balancing project, functions for routing traffic

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Router

type Router struct {
	// contains filtered or unexported fields
}

Router tracks times and channels

func MakeRouter

func MakeRouter() *Router

MakeRouter with maps initialized

func (*Router) Add

func (r *Router) Add(name string, c chan gotocol.Message, t time.Time)

Add an entry to the routing table

func (*Router) All

func (r *Router) All(p string) *Router

All routes that match a package

func (*Router) Len

func (r *Router) Len() int

Len of routing table

func (*Router) NameChan

func (r *Router) NameChan(ch chan gotocol.Message) string

NameChan find the name corresponding to a channel

func (*Router) Named

func (r *Router) Named(n string) chan gotocol.Message

Named entry find and return that channel from the routing table

func (*Router) Names

func (r *Router) Names() (ns []string)

Names return all

func (*Router) Pick

func (r *Router) Pick(p string) chan gotocol.Message

Pick a random matching package and return that channel from the routing table

func (*Router) Random

func (r *Router) Random() chan gotocol.Message

Random channel from the routing table

func (*Router) Remove

func (r *Router) Remove(name string)

Remove an entry from the routing table

func (Router) String

func (r Router) String() (s string)

Return just the names in the routing table as a string

Jump to

Keyboard shortcuts

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