devicevalidation

package
v0.0.0-...-0af6729 Latest Latest
Warning

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

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

Documentation

Overview

Package devicevalidation provides the use-case of matching a device to a valid version number.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidArgument = errors.New("invalid argument")

ErrInvalidArgument is returned when one or more arguments are invalid.

Functions

func MakeHandler

func MakeHandler(dvs Service, logger kitlog.Logger) http.Handler

MakeHandler returns a handler for the devicevalidation service.

Types

type ErrCurrentVersionNotParseable

type ErrCurrentVersionNotParseable struct {
	Version string
}

ErrCurrentVersionNotParseable is returned when a current version is not parseable.

func (*ErrCurrentVersionNotParseable) Error

type ErrRequiredVersionNotParseable

type ErrRequiredVersionNotParseable struct {
	Version string
}

ErrRequiredVersionNotParseable is returned when a required version is not parseable.

func (*ErrRequiredVersionNotParseable) Error

type Service

type Service interface {
	// Validate a deviceType and its current version. Return the compliance
	// state and required version to be compliant.
	Validate(deviceType string, currentVersion string) (bool, string, error)
}

Service is the interface that provides the Validate method.

func NewInstrumentingService

func NewInstrumentingService(counter metrics.Counter, latency metrics.Histogram, s Service) Service

NewInstrumentingService returns an instance of an instrumenting Service.

func NewLoggingService

func NewLoggingService(logger log.Logger, s Service) Service

NewLoggingService returns a new instance of a logging Service.

func NewService

func NewService(deviceMappings devicemapping.Repository) Service

NewService returns a new instance of the default Service.

Jump to

Keyboard shortcuts

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