...

Package rest

import "github.com/gin-gonic/contrib/rest"
Overview
Index

Overview ▾

func CRUD

func CRUD(group *gin.RouterGroup, path string, resource interface{})

It defines

POST: /path
GET:  /path
PUT:  /path/:id
POST: /path/:id

type CreateSupported

All of the methods are the same type as HandlerFunc if you don't want to support any methods of CRUD, then don't implement it

type CreateSupported interface {
    CreateHandler(*gin.Context)
}

type DeleteSupported

type DeleteSupported interface {
    DeleteHandler(*gin.Context)
}

type ListSupported

type ListSupported interface {
    ListHandler(*gin.Context)
}

type TakeSupported

type TakeSupported interface {
    TakeHandler(*gin.Context)
}

type UpdateSupported

type UpdateSupported interface {
    UpdateHandler(*gin.Context)
}