models

package
v1.0.28 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

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).

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).

func NewBaseResponse

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

type ConfigResponse

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

ConfigResponse defines the configuration for the targeted service.

func NewConfigResponse

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

NewConfigResponse creates new ConfigResponse 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 GET Ping DTO

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

type SecretRequest

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

SecretRequest is the request DTO for storing supplied secret at a given SecretName in the Secret Store

func NewSecretRequest

func NewSecretRequest(secretName 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.

func NewVersionResponse

func NewVersionResponse(version string, serviceName string) VersionResponse

NewVersionResponse creates new VersionResponse 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