api

package
v1.3.18 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HttpResult

func HttpResult(r *http.Request, w http.ResponseWriter, resp interface{}, err error)

func SpanIDFromContext added in v1.0.2

func SpanIDFromContext(ctx context.Context) string

func TokenHandle added in v1.2.76

func TokenHandle(next http.HandlerFunc) http.HandlerFunc

func TraceIDFromContext added in v1.0.2

func TraceIDFromContext(ctx context.Context) string

Types

type AuthorizationName added in v1.2.77

type AuthorizationName string

type ResponseFail

type ResponseFail struct {
	Success bool         `json:"success"`
	Message string       `json:"message"`
	Code    errx.ErrCode `json:"code"`
	Trace   string       `json:"trace"`
	Span    string       `json:"span"`
}

func Fail

func Fail(errCode errx.ErrCode, errMsg string) *ResponseFail

func FailWithTrace added in v1.0.2

func FailWithTrace(errCode errx.ErrCode, errMsg string, span, trace string) *ResponseFail

type ResponseOk

type ResponseOk struct {
	Success bool        `json:"success"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

func Success

func Success(data interface{}) *ResponseOk

type TokenKey added in v1.2.76

type TokenKey string

func NewTokenKey added in v1.2.77

func NewTokenKey() TokenKey

Jump to

Keyboard shortcuts

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