response

package
v0.0.0-...-f5047bd Latest Latest
Warning

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

Go to latest
Published: May 20, 2023 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	RequestID uint32 `json:"request_id"`
	Code      uint32 `json:"code"`
	Message   string `json:"message"`
}

func NewBase

func NewBase(c *gin.Context, code uint32, message string) *Base

func UnmarshalResponseBodyBase

func UnmarshalResponseBodyBase(resp *http.Response) (*Base, error)

type DataAndExtension

type DataAndExtension[T1 interface{}, T2 interface{}] struct {
	Data      T1 `json:"data,omitempty"`
	Extension T2 `json:"ext,omitempty"`
}

type Generic

type Generic[T1 interface{}, T2 interface{}] struct {
	Base
	DataAndExtension[T1, T2]
}

func NewGeneric

func NewGeneric[T1 interface{}, T2 interface{}](c *gin.Context, code uint32, message string, data T1, extension T2) *Generic[T1, T2]

func UnmarshalResponseBodyBaseWithDataAndExtension

func UnmarshalResponseBodyBaseWithDataAndExtension[T1 interface{}, T2 interface{}](resp *http.Response) (*Generic[T1, T2], error)

Jump to

Keyboard shortcuts

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