model

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BizError added in v0.9.8

type BizError struct {
	StatusCode int
	ErrCode    int
	ErrMsg     string
}

BizError is used for business error implemented error interface StatusCode will be set to http response status code ErrCode is used for business error code ErrMsg is custom error message

func NewBizError added in v0.9.8

func NewBizError(err error, opts ...BizErrorOption) *BizError

NewBizError is factory function for creating an instance of BizError struct

func (BizError) Error added in v0.9.8

func (b BizError) Error() string

Error is used for implementing error interface

func (BizError) String added in v0.9.8

func (b BizError) String() string

String function is used for printing string representation of a BizError instance

type BizErrorOption added in v0.9.8

type BizErrorOption func(bizError *BizError)

func WithErrCode added in v0.9.8

func WithErrCode(errCode int) BizErrorOption

func WithStatusCode added in v0.9.8

func WithStatusCode(statusCode int) BizErrorOption

type Route

type Route struct {
	Name        string
	Method      string
	Pattern     string
	HandlerFunc http.HandlerFunc
}

Route wraps config for route

Jump to

Keyboard shortcuts

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