Documentation ¶
Index ¶
- Constants
- Variables
- func Bearer(tok string) string
- func New(opts ...Option) *gin.Engine
- func NewDefault(t *testing.T, db *gorm.DB) (expect *httpexpect.Expect, closeFunc func())
- type Option
- type Result
- type Router
- func (r *Router) Authorize(ctx *gin.Context)
- func (r *Router) Challenge(ctx *gin.Context)
- func (r *Router) GetLogByDate(ctx *gin.Context)
- func (r *Router) GetLogByUser(ctx *gin.Context)
- func (r *Router) GetLogs(ctx *gin.Context)
- func (r *Router) Login(ctx *gin.Context)
- func (r *Router) Register(ctx *gin.Context)
- func (r *Router) UpdatePassword(ctx *gin.Context)
- func (r *Router) UserByUsername(ctx *gin.Context)
- func (r *Router) UsernameByUUID(ctx *gin.Context)
- type Token
Constants ¶
View Source
const ( UsernameParam = "username" UUIDParam = "uuid" )
View Source
const ( RootRoute = "/" EchoRoute = "/echo" LoginRoute = "/login" RegisterRoute = "/register" ChallengeRoute = "/challenge" AccountPasswordRoute = "/account/password" LogsRoute = "/logs" UserRoute = "/user" LogsUserRoute = LogsRoute + UserRoute DateRoute = "/date" LogsDateRoute = LogsRoute + DateRoute UserUUIDRoute = "/user/uuid" UserUUIDWithParamsRoute = UserUUIDRoute + "/:" + UsernameParam UsernameByUUIDRoute = "/user/username" UsernameByUUIDWithParamsRoute = UsernameByUUIDRoute + "/:" + UUIDParam )
View Source
const (
AuthorizationHeader = "Authorization"
)
View Source
const (
SessionVariale = "SESSION"
)
Variables ¶
Functions ¶
Types ¶
type Option ¶
type Option func(r *Router)
func WithController ¶ added in v0.0.19
func WithController(c *controller.Controller) Option
func WithEngine ¶
type Result ¶ added in v0.0.19
func InternalServerError ¶ added in v0.0.19
func SucceedResult ¶ added in v0.0.23
type Router ¶
type Router struct { *gin.Engine C *controller.Controller }
func (*Router) GetLogByDate ¶ added in v0.0.26
GET /logs/date
func (*Router) GetLogByUser ¶ added in v0.0.26
GET /logs/username
func (*Router) UpdatePassword ¶ added in v0.0.23
func (*Router) UserByUsername ¶ added in v0.0.23
func (*Router) UsernameByUUID ¶ added in v0.0.31
Click to show internal directories.
Click to hide internal directories.