endpoints

package
v0.0.0-...-764741f Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Wrappers for receivers from the common/stats package and setting up an HTTP server with endpoints to make the stats data accessible.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeStatsReceiver

func MakeStatsReceiver(scope StatScope) stats.StatsReceiver

Create a finagle-style stats receiver with a reasonable latch default, minutely.

func Module

func Module() ice.Module

Module returns a module that supports serving HTTP Important to also install a function that returns map[string]http.Handler

func RunServer

func RunServer(bag *ice.MagicBag, schema jsonconfig.Schema, config []byte)

Starts the Server based on the MagicBag and config schema provided this method blocks until the server completes running or an error occurs.

Types

type Addr

type Addr string

type StatScope

type StatScope string

type TwitterServer

type TwitterServer struct {
	Addr     string
	Stats    stats.StatsReceiver
	Handlers map[string]http.Handler
}

TODO(dbentley): rename to ObservableServer(?) A stats receiver that provides HTTP access for metric scraping with Twitter-style endpoints.

func NewTwitterServer

func NewTwitterServer(addr Addr, stats stats.StatsReceiver, handlers map[string]http.Handler) *TwitterServer

Returns an http handler at 'addr'

func (*TwitterServer) Serve

func (s *TwitterServer) Serve() error

Jump to

Keyboard shortcuts

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