example

package
v0.0.0-...-d874ebc Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

generated by reguerr; DO NOT EDIT

Index

Constants

This section is empty.

Variables

View Source
var (
	// No message arguments
	PermissionDeniedErr = reguerr.New("1001", "permission denied").Build()

	// One message arguments
	UpdateConflictErr = reguerr.New("1002", "other user updated: key=%s").Build()

	// Message arguments with label
	InvalidInputParameterErr = reguerr.New("1003", "invalid input parameter: %v").
								Label(0, "payload", map[string]interface{}{}).
								Build()

	// Disable default error argument
	UserTypeUnregisterErr = reguerr.New("1005", "not found user type").DisableError().Build()

	// Change log level and exitCode
	NotFoundOperationIDErr = reguerr.New("1004", "not found operation id").
							Warn().WithStatusCode(404).
							Build()
)

reguerr targets is below. cd $GOPATH/src/gitlab.com/future-architect/reguerr && go run cmd/reguerr/main.go generate -f example/error_code.go

Functions

func IsInvalidInputParameterErr

func IsInvalidInputParameterErr(err error) bool

IsInvalidInputParameterErr indicates if the passed in error is from the error with code [1003].

func IsNotFoundOperationIDErr

func IsNotFoundOperationIDErr(err error) bool

IsNotFoundOperationIDErr indicates if the passed in error is from the error with code [1004].

func IsPermissionDeniedErr

func IsPermissionDeniedErr(err error) bool

IsPermissionDeniedErr indicates if the passed in error is from the error with code [1001].

func IsUpdateConflictErr

func IsUpdateConflictErr(err error) bool

IsUpdateConflictErr indicates if the passed in error is from the error with code [1002].

func IsUserTypeUnregisterErr

func IsUserTypeUnregisterErr(err error) bool

IsUserTypeUnregisterErr indicates if the passed in error is from the error with code [1005].

func NewInvalidInputParameterErr

func NewInvalidInputParameterErr(err error, payload map[string]interface{}) *reguerr.ReguError

NewInvalidInputParameterErr is the error indicating [1003] invalid input parameter: %v: $err.

func NewNotFoundOperationIDErr

func NewNotFoundOperationIDErr(err error) *reguerr.ReguError

NewNotFoundOperationIDErr is the error indicating [1004] not found operation id: $err.

func NewPermissionDeniedErr

func NewPermissionDeniedErr(err error) *reguerr.ReguError

NewPermissionDeniedErr is the error indicating [1001] permission denied: $err.

func NewUpdateConflictErr

func NewUpdateConflictErr(err error, arg1 interface{}) *reguerr.ReguError

NewUpdateConflictErr is the error indicating [1002] other user updated: key=%s: $err.

func NewUserTypeUnregisterErr

func NewUserTypeUnregisterErr() *reguerr.ReguError

NewUserTypeUnregisterErr is the error indicating [1005] not found user type.

func UserHandleFunc

func UserHandleFunc(w http.ResponseWriter, r *http.Request)

Types

This section is empty.

Jump to

Keyboard shortcuts

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