common

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2022 License: Apache-2.0 Imports: 5 Imported by: 37

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseRequest

type BaseRequest struct {
	Versionable `json:",inline"`
	RequestId   string `json:"requestId" validate:"len=0|uuid"`
}

BaseRequest defines the base content for request DTOs (data transfer objects). This object and its properties correspond to the BaseRequest object in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-data/2.1.0#/BaseRequest

func NewBaseRequest

func NewBaseRequest() BaseRequest

type BaseResponse

type BaseResponse struct {
	Versionable `json:",inline"`
	RequestId   string `json:"requestId,omitempty"`
	Message     string `json:"message,omitempty"`
	StatusCode  int    `json:"statusCode"`
}

BaseResponse defines the base content for response DTOs (data transfer objects). This object and its properties correspond to the BaseResponse object in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-data/2.1.0#/BaseResponse

func NewBaseResponse

func NewBaseResponse(requestId string, message string, statusCode int) BaseResponse

type BaseWithConfigResponse

type BaseWithConfigResponse struct {
	BaseResponse `json:",inline"`
	ServiceName  string      `json:"serviceName"`
	Config       interface{} `json:"config"`
}

BaseWithConfigResponse defines the base content for response DTOs (data transfer objects). This object and its properties correspond to the BaseWithConfigResponse object in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/system-agent/2.1.0#/BaseWithConfigResponse

type BaseWithIdResponse

type BaseWithIdResponse struct {
	BaseResponse `json:",inline"`
	Id           string `json:"id"`
}

BaseWithIdResponse defines the base content for response DTOs (data transfer objects). This object and its properties correspond to the BaseWithIdResponse object in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-data/2.1.0#/BaseWithIdResponse

func NewBaseWithIdResponse

func NewBaseWithIdResponse(requestId string, message string, statusCode int, id string) BaseWithIdResponse

type BaseWithMetricsResponse

type BaseWithMetricsResponse struct {
	BaseResponse `json:",inline"`
	ServiceName  string      `json:"serviceName"`
	Metrics      interface{} `json:"metrics"`
}

BaseWithMetricsResponse defines the base content for response DTOs (data transfer objects). This object and its properties correspond to the BaseWithMetricsResponse object in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/system-agent/2.1.0#/BaseWithMetricsResponse

type BaseWithServiceNameResponse

type BaseWithServiceNameResponse struct {
	BaseResponse `json:",inline"`
	ServiceName  string `json:"serviceName"`
}

BaseWithServiceNameResponse defines the base content for response DTOs (data transfer objects). This object and its properties correspond to the BaseWithServiceNameResponse object in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/system-agent/2.1.0#/BaseWithServiceNameResponse

type BaseWithTotalCountResponse added in v2.1.0

type BaseWithTotalCountResponse struct {
	BaseResponse `json:",inline"`
	TotalCount   uint32 `json:"totalCount"`
}

BaseWithTotalCountResponse defines the base content for response DTOs (data transfer objects). This object and its properties correspond to the BaseWithTotalCountResponse object in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-data/2.1.0#/BaseWithTotalCountResponse

func NewBaseWithTotalCountResponse added in v2.1.0

func NewBaseWithTotalCountResponse(requestId string, message string, statusCode int, totalCount uint32) BaseWithTotalCountResponse

type ConfigResponse

type ConfigResponse struct {
	Versionable `json:",inline"`
	Config      interface{} `json:"config"`
	ServiceName string      `json:"serviceName"`
}

ConfigResponse defines the configuration for the targeted service. This object and its properties correspond to the ConfigResponse object in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-data/2.1.0#/ConfigResponse

func NewConfigResponse

func NewConfigResponse(serviceConfig interface{}, serviceName string) ConfigResponse

NewConfigResponse creates new ConfigResponse with all fields set appropriately

type CountResponse

type CountResponse struct {
	BaseResponse `json:",inline"`
	Count        uint32
}

CountResponse defines the Response Content for GET count DTO. This object and its properties correspond to the CountResponse object in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-data/2.1.0#/CountResponse

func NewCountResponse

func NewCountResponse(requestId string, message string, statusCode int, count uint32) CountResponse

NewCountResponse creates new CountResponse with all fields set appropriately

type Metrics

type Metrics struct {
	MemAlloc       uint64 `json:"memAlloc"`
	MemFrees       uint64 `json:"memFrees"`
	MemLiveObjects uint64 `json:"memLiveObjects"`
	MemMallocs     uint64 `json:"memMallocs"`
	MemSys         uint64 `json:"memSys"`
	MemTotalAlloc  uint64 `json:"memTotalAlloc"`
	CpuBusyAvg     uint8  `json:"cpuBusyAvg"`
}

type MetricsResponse

type MetricsResponse struct {
	Versionable `json:",inline"`
	Metrics     Metrics `json:"metrics"`
	ServiceName string  `json:"serviceName"`
}

MetricsResponse defines the providing memory and cpu utilization stats of the service. This object and its properties correspond to the MetricsResponse object in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-data/2.1.0#/MetricsResponse

func NewMetricsResponse

func NewMetricsResponse(metrics Metrics, serviceName string) MetricsResponse

NewMetricsResponse creates new MetricsResponse with all fields set appropriately

type PingResponse

type PingResponse struct {
	Versionable `json:",inline"`
	Timestamp   string `json:"timestamp"`
	ServiceName string `json:"serviceName"`
}

PingResponse defines the content of response content for POST Ping DTO This object and its properties correspond to the Ping object in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-data/2.1.0#/PingResponse

func NewPingResponse

func NewPingResponse(serviceName string) PingResponse

NewPingResponse creates new PingResponse with all fields set appropriately

type SecretDataKeyValue

type SecretDataKeyValue struct {
	Key   string `json:"key" validate:"required"`
	Value string `json:"value" validate:"required"`
}

SecretDataKeyValue is a key/value pair to be stored in the Secret Store as part of the Secret Data See detail specified by the V2 API swagger in openapi/v2

type SecretRequest

type SecretRequest struct {
	BaseRequest `json:",inline"`
	Path        string               `json:"path" validate:"required"`
	SecretData  []SecretDataKeyValue `json:"secretData" validate:"required,gt=0,dive"`
}

SecretRequest is the request DTO for storing supplied secret at specified Path in the Secret Store See detail specified by the V2 API swagger in openapi/v2

func NewSecretRequest

func NewSecretRequest(path string, secretData []SecretDataKeyValue) SecretRequest

func (*SecretRequest) UnmarshalJSON

func (sr *SecretRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the Unmarshaler interface for the SecretRequest type

func (*SecretRequest) Validate

func (sr *SecretRequest) Validate() error

Validate satisfies the Validator interface

type VersionResponse

type VersionResponse struct {
	Versionable `json:",inline"`
	Version     string `json:"version"`
	ServiceName string `json:"serviceName"`
}

VersionResponse defines the latest version supported by the service. This object and its properties correspond to the VersionResponse object in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-data/2.1.0#/VersionResponse

func NewVersionResponse

func NewVersionResponse(version string, serviceName string) VersionResponse

NewVersionResponse creates new VersionResponse with all fields set appropriately

type VersionSdkResponse

type VersionSdkResponse struct {
	VersionResponse `json:",inline"`
	SdkVersion      string `json:"sdk_version"`
}

VersionSdkResponse defines the latest sdk version supported by the service. This object and its properties correspond to the VersionSdkResponse object in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-data/2.1.0#/VersionSdkResponse

func NewVersionSdkResponse

func NewVersionSdkResponse(appVersion string, sdkVersion string, serviceName string) VersionSdkResponse

NewVersionSdkResponse creates new VersionSdkResponse with all fields set appropriately

type Versionable

type Versionable struct {
	ApiVersion string `json:"apiVersion" yaml:"apiVersion" validate:"required"`
}

Versionable shows the API version in DTOs

func NewVersionable

func NewVersionable() Versionable

Jump to

Keyboard shortcuts

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