v2

package
v0.1.75 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: Apache-2.0 Imports: 4 Imported by: 5

Documentation

Index

Constants

View Source
const (
	ApiVersion                 = "v2"
	ApiBase                    = "/api/v2"
	ApiEventRoute              = ApiBase + "/event"
	ApiAllEventRoute           = ApiEventRoute + "/" + All
	ApiEventIdRoute            = ApiEventRoute + "/" + Id + "/{" + Id + "}"
	ApiEventPushRoute          = ApiEventRoute + "/" + Pushed
	ApiEventCountRoute         = ApiEventRoute + "/" + Count
	ApiEventCountByDeviceRoute = ApiEventCountRoute + "/" + Device + "/{" + DeviceIdParam + "}"
	ApiEventByDeviceRoute      = ApiEventRoute + "/" + Device + "/{" + DeviceIdParam + "}"
	ApiAllEventByDeviceRoute   = ApiEventByDeviceRoute + "/" + All
	ApiEventByTimeRangeRoute   = ApiEventRoute + "/" + Start + "/{" + Start + "}/" + End + "/{" + End + "}"
	ApiEventByAgeRoute         = ApiEventRoute + "/" + Age + "/{" + Age + "}"
	ApiEventScrubRoute         = ApiEventRoute + "/" + Scrub
	ApiReadingRoute            = ApiBase + "/reading"
	ApiAllReadingRoute         = ApiReadingRoute + "/" + All
	ApiReadingCountRoute       = ApiReadingRoute + "/" + Count
	ApiReadingIdRoute          = ApiReadingRoute + "/" + Id + "/{" + Id + "}"
	ApiAllReadingByDeviceRoute = ApiReadingRoute + "/" + Device + "/{" + DeviceIdParam + "}/" + All
	ApiReadingByTypeRoute      = ApiReadingRoute + "/" + Type + "/{" + Type + "}"
	ApiReadingByTimeRangeRoute = ApiReadingRoute + "/" + Start + "/{" + Start + "}/" + End + "/{" + End + "}"
	ApiConfigRoute             = ApiBase + "/config"
	ApiMetricsRoute            = ApiBase + "/metrics"
	ApiPingRoute               = ApiBase + "/ping"
	ApiVersionRoute            = ApiBase + "/version"
)

Constants related to defined routes in the v2 service APIs

View Source
const (
	All           = "all"
	Id            = "id"
	Pushed        = "pushed"
	Count         = "count"
	Device        = "device"
	DeviceIdParam = "deviceId"
	Start         = "start"
	End           = "end"
	Age           = "age"
	Scrub         = "scrub"
	Type          = "type"
)

Constants related to defined url path names and parameters in the v2 service APIs

Variables

This section is empty.

Functions

func NewErrContractInvalid

func NewErrContractInvalid(message string) error

NewErrContractInvalid returns an instance of the error interface with ErrContractInvalid as its implementation.

func Validate

func Validate(a interface{}) error

Validate function will use the validator package to validate the struct annotation

func ValidateAutoEventFrequency added in v0.1.67

func ValidateAutoEventFrequency(fl validator.FieldLevel) bool

ValidateAutoEventFrequency validate AutoEvent's Frequency field which should follow the ISO 8601 Durations format

Types

type ErrContractInvalid

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

ErrContractInvalid is a specific error type for handling model validation failures. Type checking within the calling application will facilitate more explicit error handling whereby it's clear that validation has failed as opposed to something unexpected happening.

func (ErrContractInvalid) Error

func (e ErrContractInvalid) Error() string

Error fulfills the error interface and returns an error message assembled from the state of ErrContractInvalid.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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