Documentation ¶
Index ¶
- Constants
- func Decode(c *gin.Context, obj interface{}) error
- func Delete(key, bucket string, store gostore.ObjectStore, c *gin.Context, ...)
- func Get(key, bucket string, store gostore.ObjectStore, c *gin.Context, ...)
- func GetAll(bucket string, store gostore.ObjectStore, c *gin.Context, ...)
- func GetFunctionName(i interface{}) string
- func Post(bucket string, store gostore.ObjectStore, c *gin.Context, record interface{}, ...)
- func Put(key, bucket string, store gostore.ObjectStore, c *gin.Context, ...)
- type ChangeResult
- type CreateResult
- type ErrorCtx
- type ErrorList
- type GetKey
- type InvalidContent
- type JSONError
- type MarshalError
- type MarshalFn
- type OnError
- type OnSuccess
- type ParsedContent
- type Results
- type SuccessCtx
- type UnMarshalFn
- type UnknownContent
Constants ¶
View Source
const ( FORM_CONTENT = "form" JSON_CONTENT = "json" XML_CONTENT = "xml" )
Variables ¶
This section is empty.
Functions ¶
func Get ¶
func Get(key, bucket string, store gostore.ObjectStore, c *gin.Context, record interface{}, unMarshalFn UnMarshalFn, onSuccess OnSuccess, onError OnError)
func GetAll ¶
func GetAll(bucket string, store gostore.ObjectStore, c *gin.Context, unMarshalFn UnMarshalFn, onSuccess OnSuccess, onError OnError)
TODO: Extract core logic from each crud function i.e make doGetAll, doGet, ... they return data, err
func GetFunctionName ¶
func GetFunctionName(i interface{}) string
Types ¶
type ChangeResult ¶
type CreateResult ¶
type CreateResult struct {
New map[string]interface{}
}
type InvalidContent ¶
func (InvalidContent) Error ¶
func (e InvalidContent) Error() string
type JSONError ¶
type JSONError interface {
Serialize() map[string]interface{} //serialize error to json
}
type MarshalError ¶
type MarshalError struct {
Data map[string]interface{}
}
type OnSuccess ¶
type OnSuccess func(ctx SuccessCtx) (string, error)
Called when a crud operation is successful
type ParsedContent ¶
type ParsedContent map[string]interface{}
type SuccessCtx ¶
type UnMarshalFn ¶
type UnknownContent ¶
func (UnknownContent) Error ¶
func (e UnknownContent) Error() string
Click to show internal directories.
Click to hide internal directories.