utils

package
v0.0.0-...-9cc3d76 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDeleteResponse

func CreateDeleteResponse[T any](w http.ResponseWriter, reason string, data *T)

func CreateErrorResponse

func CreateErrorResponse(w http.ResponseWriter, code int, reason string, err error)

func CreateResponse

func CreateResponse[T any](w http.ResponseWriter, reason string, data *T)

Types

type ApiResponse

type ApiResponse struct {
	Status     bool   `json:"status"`
	Message    string `json:"message"`
	StatusCode int    `json:"statusCode"`
	Response   any    `json:"data"`
}

func (*ApiResponse) ToJson

func (api *ApiResponse) ToJson() []byte

type Empty

type Empty struct {
}

Jump to

Keyboard shortcuts

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