Documentation ¶
Index ¶
- func BadRequest(c *gin.Context, err error)
- func Conflict(c *gin.Context, err error)
- func Created(c *gin.Context, data any)
- func Error(c *gin.Context, err error)
- func NotFound(c *gin.Context, err error)
- func OK(c *gin.Context, data any)
- func Unauthorized(c *gin.Context, err error)
- type ReqAccessToken
- type ReqAddLedger
- type ReqGetLedger
- type ReqGetLedgers
- type ReqSignIn
- type ReqSignUp
- type ResAddLedger
- type ResErr
- type ResGetLedger
- type ResGetLedgers
- type ResGetTime
- type ResSignIn
- type ResSignUp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BadRequest ¶
BadRequest is a convenience function for 400 response.
func Unauthorized ¶
Unauthorized is a convenience function for 401 response.
Types ¶
type ReqAccessToken ¶
type ReqAccessToken struct {
Authorization string `header:"Authorization" binding:"required"`
}
ReqAccessToken binds header for authorized access.
type ReqAddLedger ¶
type ReqAddLedger struct { UserID string `json:"user_id" binding:"required"` Desc string `json:"description" binding:"required"` Income int `json:"income" binding:"required"` Date string `json:"date" binding:"required,datetime=2006-01-02"` }
ReqAddLedger binds request body for adding ledger.
type ReqGetLedger ¶
type ReqGetLedger struct {
LedgerID uint `uri:"ledger_id" binding:"min=1"`
}
ReqGetLedger binds path variable for getting a ledger.
type ReqGetLedgers ¶
type ReqGetLedgers struct {
UserID string `uri:"user_id" binding:"required"`
}
ReqGetLedgers binds path variable for getting ledgers.
type ReqSignIn ¶
type ReqSignIn struct { Email string `json:"email" binding:"email"` Password string `json:"password" binding:"required,min=8,max=18"` }
ReqSignIn binds request body for sign in.
type ReqSignUp ¶
type ReqSignUp struct { Email string `json:"email" binding:"email"` Password string `json:"password" binding:"required,min=8,max=18"` }
ReqSignUp binds request body for sign up.
type ResAddLedger ¶
ResAddLedger is a response for adding ledger.
type ResGetLedger ¶
type ResGetLedger struct { LedgerID string `json:"ledger_id"` UserID string `json:"user_id"` Desc string `json:"description"` Income int `json:"income"` Date string `json:"date"` }
ResGetLedger is a response for getting a ledger.
type ResGetLedgers ¶
type ResGetLedgers struct {
Ledgers []ResGetLedger `json:"ledgers"`
}
ResGetLedgers is a response for getting ledgers.
type ResGetTime ¶
ResGetTime returns current timestamp and date.
Click to show internal directories.
Click to hide internal directories.