transport

package
v0.0.0-...-984c388 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicResponse

type BasicResponse struct {
	Message string `json:"message"`
}

BasicResponse generic system response template containing plain messages.

type DataResponse

type DataResponse struct {
	Data any `json:"data"`
}

DataResponse generic system response template for data retrieval.

type ErrorResponse

type ErrorResponse struct {
	// Code HTTP status code.
	Code int `json:"code"`
	// ErrorStatus name of error type cataloged by the system (e.g. ResourceNotFound, MissingParameter).
	//
	// Might be used by external systems to change behaviour at runtime.
	ErrorStatus string `json:"status"`
	// Message description or title of error type.
	Message string `json:"message"`
}

ErrorResponse system error template based on RFC 7807 specification (ref: https://www.rfc-editor.org/rfc/rfc7807) and Google Cloud's API Design whitepaper (ref: https://cloud.google.com/apis/design/errors).

type ErrorsResponse

type ErrorsResponse struct {
	Errors []ErrorResponse `json:"errors"`
	// Code top-level error code from inner Errors (e.g. 400,404,502 -> 502).
	Code int `json:"code"`
}

ErrorsResponse collection of ErrorResponse(s).

type ListDataResponse

type ListDataResponse struct {
	Data          any    `json:"data"`
	Count         int    `json:"count"`
	NextPageToken string `json:"next_page_token"`
}

ListDataResponse generic system response template for collections of data retrieval.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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