router

package
v0.0.0-...-4d8574e Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2018 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Counter

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

func NewCounter

func NewCounter() *Counter

func (*Counter) IncFailure

func (c *Counter) IncFailure(rn RangeName)

func (*Counter) IncSuccess

func (c *Counter) IncSuccess(rn RangeName)

func (*Counter) Metrics

func (c *Counter) Metrics(rn RangeName) (metric Metric)

type FileSystem

type FileSystem interface {
	List() (file []string, err error)
	Writer(name string) (writer Writer, err error)
}

type Hasher

type Hasher interface {
	Hash(data []byte) (hash uint64, err error)
}

type Metric

type Metric struct {
	WriteCount, ErrCount uint64
}

type MetricsCounter

type MetricsCounter interface {
	IncSuccess(name RangeName)
	IncFailure(name RangeName)
}

type RangeName

type RangeName struct {
	Low, High uint64
	Term      uint64
	Rand      int64
}

type Router

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

func New

func New(fs FileSystem, hasher Hasher, metricsCounter MetricsCounter) *Router

func (*Router) Write

func (r *Router) Write(data []byte) (err error)

type Writer

type Writer interface {
	Write(data []byte) (err error)
	Close()
}

Jump to

Keyboard shortcuts

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