v2

package
v0.1.102 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2020 License: Apache-2.0 Imports: 5 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 + "/{" + DeviceName + "}"
	ApiEventByDeviceRoute      = ApiEventRoute + "/" + Device + "/{" + DeviceName + "}"
	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 + "/{" + DeviceName + "}/" + All
	ApiReadingByTypeRoute      = ApiReadingRoute + "/" + Type + "/{" + Type + "}"
	ApiReadingByTimeRangeRoute = ApiReadingRoute + "/" + Start + "/{" + Start + "}/" + End + "/{" + End + "}"

	ApiDeviceProfileRoute                       = ApiBase + "/deviceprofile"
	ApiDeviceProfileUploadFileRoute             = ApiDeviceProfileRoute + "/uploadfile"
	ApiDeviceProfileByNameRoute                 = ApiDeviceProfileRoute + "/" + Name + "/{" + Name + "}"
	ApiDeviceProfileByIdRoute                   = ApiDeviceProfileRoute + "/" + Id + "/{" + Id + "}"
	ApiAllDeviceProfileRoute                    = ApiDeviceProfileRoute + "/" + All
	ApiDeviceProfileByManufacturerRoute         = ApiDeviceProfileRoute + "/" + Manufacturer + "/{" + Manufacturer + "}"
	ApiDeviceProfileByModelRoute                = ApiDeviceProfileRoute + "/" + Model + "/{" + Model + "}"
	ApiDeviceProfileByManufacturerAndModelRoute = ApiDeviceProfileRoute + "/" + Manufacturer + "/{" + Manufacturer + "}" + "/" + Model + "/{" + Model + "}"

	ApiDeviceServiceRoute       = ApiBase + "/deviceservice"
	ApiAllDeviceServiceRoute    = ApiDeviceServiceRoute + "/" + All
	ApiDeviceServiceByNameRoute = ApiDeviceServiceRoute + "/" + Name + "/{" + Name + "}"
	ApiDeviceServiceByIdRoute   = ApiDeviceServiceRoute + "/" + Id + "/{" + Id + "}"

	ApiDeviceRoute                 = ApiBase + "/device"
	ApiAllDeviceRoute              = ApiDeviceRoute + "/" + All
	ApiDeviceExistsByIdRoute       = ApiDeviceRoute + "/" + Check + "/" + Id + "/{" + Id + "}"
	ApiDeviceExistsByNameRoute     = ApiDeviceRoute + "/" + Check + "/" + Name + "/{" + Name + "}"
	ApiDeviceByIdRoute             = ApiDeviceRoute + "/" + Id + "/{" + Id + "}"
	ApiDeviceByNameRoute           = ApiDeviceRoute + "/" + Name + "/{" + Name + "}"
	ApiAllDeviceByProfileIdRoute   = ApiDeviceRoute + "/" + Profile + "/" + Id + "/{" + Id + "}"
	ApiAllDeviceByProfileNameRoute = ApiDeviceRoute + "/" + Profile + "/" + Name + "/{" + Name + "}"
	ApiAllDeviceByServiceIdRoute   = ApiDeviceRoute + "/" + Service + "/" + Id + "/{" + Id + "}"
	ApiAllDeviceByServiceNameRoute = ApiDeviceRoute + "/" + Service + "/" + Name + "/{" + Name + "}"

	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"
	Created      = "created"
	Modified     = "modified"
	Pushed       = "pushed"
	Count        = "count"
	Device       = "device"
	DeviceId     = "deviceId"
	DeviceName   = "deviceName"
	Check        = "check"
	Profile      = "profile"
	Service      = "service"
	ProfileName  = "profileName"
	ServiceName  = "serviceName"
	Start        = "start"
	End          = "end"
	Age          = "age"
	Scrub        = "scrub"
	Type         = "type"
	Name         = "name"
	Manufacturer = "manufacturer"
	Model        = "model"
	ValueType    = "valueType"
	Offset       = "offset" //query string to specify the number of items to skip before starting to collect the result set.
	Limit        = "limit"  //query string to specify the numbers of items to return
	Labels       = "labels" //query string to specify associated user-defined labels for querying a given object. More than one label may be specified via a comma-delimited list
)

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

View Source
const (
	DefaultOffset  = 0
	DefaultLimit   = 20
	CommaSeparator = ","
)

Constants related to the default value of query strings in the v2 service APIs

Variables

This section is empty.

Functions

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

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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