common

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 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 ErrorResp

type ErrorResp struct {
	Status   Status    `json:"status"`
	Message  string    `json:"message"`
	Metadata *Metadata `json:"metadata"`
}

type FailureResp

type FailureResp[T interface{}] struct {
	Status   Status    `json:"status"`
	Data     T         `json:"data"`
	Message  string    `json:"message"`
	Metadata *Metadata `json:"metadata"`
}

type Metadata

type Metadata struct {
	RequestID string `json:"requestId"`
	Duration  int    `json:"duration"`
	Timestamp string `json:"timestamp"`
	Version   string `json:"version"`
}

type Status

type Status string
const (
	SuccessStatus Status = "success"
	FailureStatus Status = "failure"
	ErrorStatus   Status = "error"
)

type SuccessResp

type SuccessResp[T interface{}] struct {
	Status   Status    `json:"status"`
	Data     T         `json:"data"`
	Metadata *Metadata `json:"metadata"`
}

Jump to

Keyboard shortcuts

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