httpxcommons

package
v0.0.0-...-f7bd073 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: BSD-3-Clause Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*PBResponse) Descriptor

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

func (*PBResponse) GetCode

func (m *PBResponse) GetCode() int64

func (*PBResponse) GetMessage

func (m *PBResponse) GetMessage() string

func (*PBResponse) GetPayload

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

func (*PBResponse) GetRequestId

func (m *PBResponse) GetRequestId() int64

func (*PBResponse) GetSuccess

func (m *PBResponse) GetSuccess() bool

func (*PBResponse) ProtoMessage

func (*PBResponse) ProtoMessage()

func (*PBResponse) Reset

func (m *PBResponse) Reset()

func (*PBResponse) String

func (m *PBResponse) String() string

func (*PBResponse) XXX_DiscardUnknown

func (m *PBResponse) XXX_DiscardUnknown()

func (*PBResponse) XXX_Marshal

func (m *PBResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PBResponse) XXX_Merge

func (m *PBResponse) XXX_Merge(src proto.Message)

func (*PBResponse) XXX_Size

func (m *PBResponse) XXX_Size() int

func (*PBResponse) XXX_Unmarshal

func (m *PBResponse) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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