out

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Environment = "development"

Functions

func SetEnvironment

func SetEnvironment(env string)

Types

type Response

type Response struct {
	HttpCode   int      `json:"httpCode,omitempty"`
	ErrorCode  int      `json:"errorCode,omitempty"`
	ErrorName  string   `json:"errorName,omitempty"`
	Message    string   `json:"message,omitempty"`
	Data       any      `json:"data,omitempty"`
	StackTrace []string `json:"stack,omitempty"`
	Details    *string  `json:"details,omitempty"`
}

Response represents a standard API response

func Error

func Error(httpCode int, errorCode int, errorName string, message string) *Response

func ErrorDetail

func ErrorDetail(httpCode int, errorCode int, errorName string, message string, detail error) *Response

func SuccessData

func SuccessData(data any) *Response

SuccessData creates a success response

func SuccessDataMessage

func SuccessDataMessage(data any, msg string) *Response

SuccessData creates a success response

func SuccessMessage

func SuccessMessage(msg string) *Response

func (*Response) Error

func (e *Response) Error() string

Error implements the error interface

Jump to

Keyboard shortcuts

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