message

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPrinter

func GetPrinter(c *gin.Context) (printer *message.Printer)

Types

type Message

type Message interface {
	Text(string) Message
	ToMap() map[string]interface{}
	JSON(c *gin.Context)
	ToJSON() []byte
	Abort(c *gin.Context)
	Write(c *gin.Context)
	Error() string
	IsError() bool
	Is400() bool
	Is500() bool
	Set(key string, val interface{}) Message
	Get(key string) interface{}
	Add(msgs ...Message) Message
}

func CannotDeleteSharedResource

func CannotDeleteSharedResource(c *gin.Context) Message

func Conflict

func Conflict(c *gin.Context) Message

409

func ConflictingOrderByAndDistinct

func ConflictingOrderByAndDistinct(c *gin.Context) Message

func ConflictingPaginationAndAggregation

func ConflictingPaginationAndAggregation(c *gin.Context) Message

func ConflictingUsername

func ConflictingUsername(c *gin.Context) Message

func DeleteFailed

func DeleteFailed(c *gin.Context, blockingRelations []string) Message

func DisplayNameNotSupported

func DisplayNameNotSupported(c *gin.Context) Message

func DuplicateStructField

func DuplicateStructField(c *gin.Context, field string) Message

func DuplicateUnique

func DuplicateUnique(c *gin.Context, table, combination string) Message

func ExpectedSlice

func ExpectedSlice(c *gin.Context) Message

func FileNotFound

func FileNotFound(c *gin.Context) Message

func FolderNotFound

func FolderNotFound(c *gin.Context) Message

func Forbidden

func Forbidden(c *gin.Context) Message

403

func FromError

func FromError(status int, err error) Message

func InsufficientPermissions

func InsufficientPermissions(c *gin.Context, permissions ...string) Message

func InsufficientPermissionsHasOne

func InsufficientPermissionsHasOne(c *gin.Context, permissions ...string) Message

func InternalServerError

func InternalServerError(c *gin.Context) Message

func InvalidField

func InvalidField(c *gin.Context, field string) Message

func InvalidFieldAlias

func InvalidFieldAlias(c *gin.Context, alias, field string) Message

func InvalidFieldRequired

func InvalidFieldRequired(c *gin.Context, name string) Message

func InvalidFieldValue

func InvalidFieldValue(c *gin.Context, field, rules string, value interface{}) Message

func InvalidJSON

func InvalidJSON(c *gin.Context) Message

func InvalidOrders

func InvalidOrders(c *gin.Context, orders ...string) Message

func InvalidParamOperator

func InvalidParamOperator(c *gin.Context, operator string) Message

func InvalidParamType

func InvalidParamType(c *gin.Context, field string, correctType string) Message

func InvalidParamsJSON

func InvalidParamsJSON(c *gin.Context) Message

func InvalidParamsSyntax

func InvalidParamsSyntax(c *gin.Context) Message

func InvalidRelation

func InvalidRelation(c *gin.Context, table string) Message

func InvalidRelations

func InvalidRelations(c *gin.Context, relations ...string) Message

func InvalidUrlParameter

func InvalidUrlParameter(c *gin.Context, parameter string) Message

400

func ItemFound

func ItemFound(c *gin.Context) Message

307

func ItemNotFound

func ItemNotFound(c *gin.Context) Message

404

func ManualPagination

func ManualPagination(c *gin.Context) Message

func MissingForeignKey

func MissingForeignKey(c *gin.Context, key, rel string) Message

func MissingRequiredParameter

func MissingRequiredParameter(c *gin.Context, name, in string) Message

func Ok

func Ok(c *gin.Context) Message

200

func RowError

func RowError(c *gin.Context, row int, message string) Message

func UnauthorizedRelations

func UnauthorizedRelations(c *gin.Context, relations ...string) Message

func Unprocessable

func Unprocessable(c *gin.Context) Message

422

func UnsupportedParamType

func UnsupportedParamType(c *gin.Context, parameter string) Message

type Msg

type Msg struct {
	Message    string
	Status     int
	Properties map[string]interface{}
}

func (*Msg) Abort

func (m *Msg) Abort(c *gin.Context)

func (*Msg) Add

func (m *Msg) Add(msgs ...Message) Message

func (*Msg) Error

func (m *Msg) Error() string

func (*Msg) Get

func (m *Msg) Get(key string) interface{}

func (*Msg) Is400

func (m *Msg) Is400() bool

func (*Msg) Is500

func (m *Msg) Is500() bool

func (*Msg) IsError

func (m *Msg) IsError() bool

func (*Msg) JSON

func (m *Msg) JSON(c *gin.Context)

func (*Msg) Set

func (m *Msg) Set(key string, val interface{}) Message

func (*Msg) Text

func (m *Msg) Text(text string) Message

func (*Msg) ToJSON

func (m *Msg) ToJSON() []byte

func (*Msg) ToMap

func (m *Msg) ToMap() map[string]interface{}

func (*Msg) Write

func (m *Msg) Write(c *gin.Context)

type SkipDelete

type SkipDelete struct{}

func (SkipDelete) Error

func (SkipDelete) Error() string

Jump to

Keyboard shortcuts

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