util

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2019 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package util provides UUIDs for CarbonAPI and CarbonZipper HTTP requests.

Index

Constants

View Source
const (
	StepSize = 50
)

Variables

This section is empty.

Functions

func Bounds

func Bounds(bucket int) (lower, upper int)

Bounds returns the lower and upper bounds of bucket number 'bucket'.

func Bucket

func Bucket(n int64, buckets int) int

Bucket finds the number of the bucket that 'n' falls into out of 'buckets' buckets.

func GetUUID

func GetUUID(ctx context.Context) string

GetUUID gets the Carbon UUID of a request.

func MarshalCtx

func MarshalCtx(ctx context.Context, request *http.Request) *http.Request

MarshalCtx ensures that outgoing HTTP requests have a Carbon UUID.

func UUIDHandler

func UUIDHandler(h http.Handler) http.Handler

UUIDHandler is middleware that adds a Carbon UUID to all HTTP requests.

func WithUUID

func WithUUID(ctx context.Context) context.Context

WithUUID ensures that a context has a Carbon UUID.

Types

This section is empty.

Jump to

Keyboard shortcuts

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