Documentation ¶
Overview ¶
Author: yangzq80@gmail.com Date: 2021/3/21
Author: yangzq80@gmail.com Date: 2021-03-16
Author: yangzq80@gmail.com Date: 2023/2/28
Author: yangzq80@gmail.com Date: 2021-03-25
Author: yangzq80@gmail.com Date: 2021-03-16
Index ¶
- Constants
- func DisableCors() gin.HandlerFunc
- type JsonStoreRest
- type Search
- type Storage
- func (s *Storage) CacheGet(key string, val *interface{})
- func (s *Storage) CacheGetString(category string, kvKey string) string
- func (s *Storage) CachePut(key string, val interface{})
- func (s *Storage) CachePutString(category string, kvKey string, kvValue string)
- func (s *Storage) Create(bucket string, key string, value interface{}) *model.Data
- func (s *Storage) Delete(bucket string, key string)
- func (s *Storage) DeleteAll(bucket string, key string) int
- func (s *Storage) DeleteList(bucket string, items interface{}, isData bool) int
- func (s *Storage) FIFO(key string, val interface{}, size int)
- func (s *Storage) Read(bucket string, key string) *model.Data
- func (s *Storage) ReadAll(bucket string, key string) *model.Response
- func (s *Storage) ReadAllSort(bucket string, key string) *model.Response
- func (s *Storage) ReadOneRaw(bucket string, key string) []byte
- func (s *Storage) ReadOneStruct(bucket string, key string, v interface{}) error
- func (s *Storage) Search(search Search) *model.Response
- func (s *Storage) SearchStruct(search Search, obj interface{}) *model.Response
- func (s *Storage) Update(bucket string, key string, value interface{}) *model.Data
- func (s *Storage) UpdateMarshalValue(bucket string, key string, value []byte) error
- func (s *Storage) UpdateWeight(bucket string, kid string) interface{}
Constants ¶
View Source
const (
CACHE_BUCKET string = "meta"
)
Variables ¶
This section is empty.
Functions ¶
func DisableCors ¶
func DisableCors() gin.HandlerFunc
Needed in order to disable CORS for local development
Types ¶
type JsonStoreRest ¶
type JsonStoreRest struct { D *Storage BasicAuth map[string]string // 使用BasicAuth 如 admin:admin DisableCors bool }
func NewJsonStoreRest ¶
func NewJsonStoreRest(dir string) *JsonStoreRest
func (*JsonStoreRest) ConfigHandles ¶
func (s *JsonStoreRest) ConfigHandles(r *gin.Engine)
type Search ¶
type Search struct { B string `form:"b"` K string `form:"k"` Node string `form:"node"` Key string `form:"key"` // Search conditions key Value string `form:"value"` // Search conditions value Relation string `form:"relation"` // Search relation,default equal; equal,like,isNotEq ShortBy string `form:"shortBy"` Page int `form:"page"` Size int `form:"size"` Fields string `form:"fields"` }
type Storage ¶
func NewStorage ¶
func (*Storage) CacheGetString ¶
func (*Storage) CachePutString ¶
通用 key:value 字符串类型kv存储
func (*Storage) DeleteList ¶
func (*Storage) ReadAllSort ¶
func (*Storage) ReadOneStruct ¶
查询单个,返回 Struct 对象
func (*Storage) SearchStruct ¶
func (*Storage) UpdateMarshalValue ¶
func (*Storage) UpdateWeight ¶
Click to show internal directories.
Click to hide internal directories.