httpxcommons

package
v0.0.0-...-6b0659a Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2024 License: BSD-3-Clause Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_httpx_proto protoreflect.FileDescriptor

Functions

func LoadCertificate

func LoadCertificate(raw []byte) (tls.Certificate, error)

func SendError

func SendError(c *fiber.Ctx, err string, code int64, statusCode int) error

func SendErrorWithRedirect

func SendErrorWithRedirect(c *fiber.Ctx, message string, redirect string, code int64, statusCode int) error

func SendErrors

func SendErrors(c *fiber.Ctx, err error, code int64, statusCode int) error

func SendPBSuccess

func SendPBSuccess(c *fiber.Ctx, obj interface{}, code int64) error

func SendSuccess

func SendSuccess(c *fiber.Ctx, obj interface{}, code int64) error

Types

type AjaxResponse

type AjaxResponse struct {
	Success   bool        `json:"success"`
	Message   string      `json:"message"`
	Payload   interface{} `json:"payload"`
	RequestID string      `json:"request_id"`
	Code      int64       `json:"code"`
	Redirect  string      `json:"redirect,omitempty"`
}

func (*AjaxResponse) GetCode

func (a *AjaxResponse) GetCode() int64

func (*AjaxResponse) GetMessage

func (a *AjaxResponse) GetMessage() string

func (*AjaxResponse) GetPayload

func (a *AjaxResponse) GetPayload() interface{}

func (*AjaxResponse) GetRequestId

func (a *AjaxResponse) GetRequestId() string

func (*AjaxResponse) IsSuccess

func (a *AjaxResponse) IsSuccess() bool

type BaseResponse

type BaseResponse interface {
	IsSuccess() bool
	GetMessage() string
	GetPayload() interface{}
	GetRequestId() string
	GetCode() int64
}

type ListData

type ListData struct {
	List  interface{} `json:"list"`
	Total int64       `json:"total"`
}

type PBResponse

type PBResponse struct {
	Code      int64  `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Message   string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	RequestId int64  `protobuf:"varint,3,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	Success   bool   `protobuf:"varint,4,opt,name=success,proto3" json:"success,omitempty"`
	Payload   []byte `protobuf:"bytes,5,opt,name=payload,proto3" json:"payload,omitempty"`
	// contains filtered or unexported fields
}

func (*PBResponse) Descriptor deprecated

func (*PBResponse) Descriptor() ([]byte, []int)

Deprecated: Use PBResponse.ProtoReflect.Descriptor instead.

func (*PBResponse) GetCode

func (x *PBResponse) GetCode() int64

func (*PBResponse) GetMessage

func (x *PBResponse) GetMessage() string

func (*PBResponse) GetPayload

func (x *PBResponse) GetPayload() []byte

func (*PBResponse) GetRequestId

func (x *PBResponse) GetRequestId() int64

func (*PBResponse) GetSuccess

func (x *PBResponse) GetSuccess() bool

func (*PBResponse) ProtoMessage

func (*PBResponse) ProtoMessage()

func (*PBResponse) ProtoReflect

func (x *PBResponse) ProtoReflect() protoreflect.Message

func (*PBResponse) Reset

func (x *PBResponse) Reset()

func (*PBResponse) String

func (x *PBResponse) String() string

Jump to

Keyboard shortcuts

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