dtorespwithdata

package
v0.0.0-...-e1a70cd Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Class

type Class[T any] struct {
	Data  *T               `json:"data"`
	Error dto.ServiceError `json:"error"`

	PreWriteHook func(*T) `json:"-"`
}

func New

func New[T any](data *T, errCode string, errMessage string) *Class[T]

func NewError

func NewError(errCode string, errMessage string) *Class[any]

func (*Class[T]) RenderTo

func (c *Class[T]) RenderTo(w http.ResponseWriter, httpStatusCode int)

func (*Class[T]) WithPrewriteHook

func (c *Class[T]) WithPrewriteHook(hook func(*T)) *Class[T]

Jump to

Keyboard shortcuts

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