httputil

package
v0.0.33 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Response

type Response[T any] struct {
	Headers http.Header `json:"-"`
	Status  int         `json:"-"`
	Error   error       `json:"-"`
	Message string      `json:"message"`
	Data    *T          `json:"data"`
}

func (*Response[T]) AddHeader

func (r *Response[T]) AddHeader(key, value string) *Response[T]

func (*Response[T]) SetData

func (r *Response[T]) SetData(data *T) *Response[T]

func (*Response[T]) SetError

func (r *Response[T]) SetError(err error) *Response[T]

func (*Response[T]) SetMessage

func (r *Response[T]) SetMessage(message string) *Response[T]

func (*Response[T]) SetStatus

func (r *Response[T]) SetStatus(status int) *Response[T]

func (*Response[T]) Write

func (r *Response[T]) Write(w http.ResponseWriter) (int, error)

Jump to

Keyboard shortcuts

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