stat

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigHandler

func ConfigHandler(c *Options)

ConfigHandler sets up the server that powers the stat service That is, it configures the mux paths to access the service

Types

type Options

type Options struct {
	S Service

	//APIRouter is assumed to be a subrouter with the API prefix path (i.e. 'api/v2')
	APIRouter    *mux.Router
	Authenticate *alice.Chain
	Log          kitlog.Logger
}

Options wraps the properties needed to set up the stat server

type Service

type Service interface {
	RequestStat(authHeaderValue, deviceID string) (*common.XmidtResponse, error)
}

Service defines the behavior of the device statistics Tr1d1um Service

func NewService

func NewService(o *ServiceOptions) Service

NewService constructs a new stat service instance given some options

type ServiceOptions

type ServiceOptions struct {
	//Base Endpoint URL for device stats from XMiDT API
	XmidtStatURL string

	//Tr1d1umTransactor is the component that's responsible to make the HTTP
	//request to the XMiDT API and return only data we care about
	common.Tr1d1umTransactor
}

ServiceOptions defines the options needed to build a new stat service

Jump to

Keyboard shortcuts

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