Documentation ¶
Index ¶
- Variables
- func ClientId(ctx context.Context) string
- func ClientIdEcho(ec echo.Context) string
- func GenerateUUIDV4() string
- func Id(ctx context.Context) string
- func IdEcho(ec echo.Context) string
- func IdEchoUid(ec echo.Context) string
- func IdEchoUidWithSuffix(ec echo.Context, suffix string) string
- func IdEchoWithSuffix(ec echo.Context, suffix string) string
- func IdUid(ctx context.Context) string
- func IdUidWithSuffix(ctx context.Context, suffix string) string
- func IsHttp1xx(httpCode int) bool
- func IsHttp2xx(httpCode int) bool
- func IsHttp3xx(httpCode int) bool
- func IsHttp4xx(httpCode int) bool
- func IsHttp5xx(httpCode int) bool
- func IsHttpError(httpCode int) bool
- type Header
- type RequestContext
Constants ¶
This section is empty.
Variables ¶
View Source
var ( HttpString = func(httpCode int) string { return fmt.Sprintf("%d: %s", httpCode, http.StatusText(httpCode)) } )
Functions ¶
func ClientIdEcho ¶ added in v0.3.0
func ClientIdEcho(ec echo.Context) string
ClientIdEcho get client id from echo context
func IdEcho ¶ added in v0.3.0
func IdEcho(ec echo.Context) string
IdEcho get request id from echo context
func IdEchoUid ¶ added in v0.3.0
func IdEchoUid(ec echo.Context) string
IdEchoUid get request id from echo context and convert into uuid
func IdEchoUidWithSuffix ¶ added in v0.3.0
IdEchoUidWithSuffix get request id from echo context, convert into uuid and add suffix
func IdEchoWithSuffix ¶ added in v0.3.0
IdEchoWithSuffix get request id from echo context and add suffix
func IdUidWithSuffix ¶ added in v0.3.0
IdUidWithSuffix get request id from context, convert it into uuid and add suffix
func IsHttpError ¶
IsHttpError treat error when http code above inclusive 300
Types ¶
type RequestContext ¶
type RequestContext string
const ( ContextClientId RequestContext = "client_id" ContextRequestId RequestContext = "request_id" ContextSignature RequestContext = "signature" )
func (RequestContext) String ¶
func (t RequestContext) String() string
Click to show internal directories.
Click to hide internal directories.