system

package
v0.0.0-...-3839eb7 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppAPI = "appapi"

	OpenAPI = "openapi"
)

Variables

View Source
var (
	ErrBadParams        = errs.NewI18nError("err.badparams").FallBack("invalid params").Status(http.StatusBadRequest).Code(code.BadRequest)
	ErrForbidden        = errs.NewI18nError("err.forbidden").FallBack("forbidden").Status(http.StatusForbidden).Code(code.Forbidden)
	ErrUnAthorzied      = errs.NewI18nError("err.unauthorized").FallBack("unauthorized").Status(http.StatusUnauthorized).Code(code.UnAuthorized)
	ErrResourceNotFound = errs.NewI18nError("err.notfound").FallBack("resource not found").Status(http.StatusNotFound).Code(code.ResourceNotFound)
)
View Source
var (

	// ErrDatabase
	// This error is used to describe database operations.
	// These operations may not have any exceptions themselves, but they have not caused any impact, so they are invalid operations.
	ErrDatabase = errs.NewI18nError("err.database").FallBack("database error").Status(http.StatusInternalServerError).Code(code.DatabaseError)

	ErrFileSystem = errs.NewI18nError("err.filesystem").FallBack("file system error").Status(http.StatusInternalServerError).Code(code.FilesystemError)

	ErrNetwork = errs.NewI18nError("err.network").FallBack("network error").Status(http.StatusInternalServerError).Code(code.NetworkError)

	ErrProgram = errs.NewI18nError("err.program").FallBack("program error").Status(http.StatusInternalServerError).Code(code.ProgramError)

	ErrUnknown = errs.NewI18nError("err.unknown").FallBack("unknown error").Status(http.StatusInternalServerError).Code(code.UnknownError)
)
View Source
var (
	RulePing = helper.Rules(vax.RangeLenRune(1, 10), vax.In("wilson", "wendy"))
)

Functions

This section is empty.

Types

type Id

type Id struct {
	Id string `json:"id" uri:"id" form:"id" label:"field.id"`
}

Id represent query or path param ID

func (Id) Int

func (i Id) Int() int

func (Id) String

func (i Id) String() string

func (Id) Uint

func (i Id) Uint() uint

func (Id) Validate

func (i Id) Validate(lang string) error

type PingReply

type PingReply struct {
	Reply string `json:"reply" example:"hello wendy! Now is 2023-10-17 11:07:21.696 +08:00."`
}

type PingRequest

type PingRequest struct {
	// name must be one of [wilson, wendy]
	Name string `json:"name" uri:"name" form:"name" label:"field.name" example:"wilson"`
}

func (PingRequest) Validate

func (p PingRequest) Validate(lang string) error

type Uid

type Uid struct {
	UUID string `json:"uuid" uri:"uuid" form:"uuid" label:"field.uuid"`
}

func (Uid) Validate

func (u Uid) Validate(lang string) error

Jump to

Keyboard shortcuts

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