rest

package
Version: v0.0.0-...-a023b77 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 15, 2021 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Overview

Author: yangzq80@gmail.com Date: 2021-03-16

Author: yangzq80@gmail.com Date: 2021-03-25

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JsonStoreRest

type JsonStoreRest struct {
	D *Storage
}

func NewJsonStoreRest

func NewJsonStoreRest(dir string, r *gin.Engine) *JsonStoreRest
type Search struct {
	B       string `form:"b"`
	K       string `form:"k"`
	Node    string `form:"node"`
	Key     string `form:"key"`
	Value   string `form:"value"`
	ShortBy string `form:"shortBy"`
	Page    int    `form:"page"`
	Size    int    `form:"size"`
}

type Storage

type Storage struct {
	// contains filtered or unexported fields
}

func NewStorage

func NewStorage(dir string) *Storage

func (*Storage) ConfigHandles

func (s *Storage) ConfigHandles(r *gin.Engine)

func (*Storage) Create

func (s *Storage) Create(bucket string, key string, value interface{}) string

保存key,value. bucket类似table

func (*Storage) Delete

func (s *Storage) Delete(bucket string, key string)

根据key删除

func (*Storage) DeleteAll

func (s *Storage) DeleteAll(bucket string, key string) int

func (*Storage) DeleteList

func (s *Storage) DeleteList(bucket string, items interface{}, isData bool) int

func (*Storage) Read

func (s *Storage) Read(bucket string, key string) model.Data

查询单个

func (*Storage) ReadAll

func (s *Storage) ReadAll(bucket string, key string) *model.Response

查询bucket中 key 全部

func (*Storage) ReadAllSort

func (s *Storage) ReadAllSort(bucket string, key string) *model.Response

func (*Storage) ReadOneRaw

func (s *Storage) ReadOneRaw(bucket string, key string) []byte

func (*Storage) ReadOneStruct

func (s *Storage) ReadOneStruct(bucket string, key string, v interface{}) error

查询单个,返回 Struct 对象

func (*Storage) Search

func (s *Storage) Search(search Search) *model.Response

func (*Storage) Update

func (s *Storage) Update(bucket string, key string, value interface{}) error

根据key更新

func (*Storage) UpdateMarshalValue

func (s *Storage) UpdateMarshalValue(bucket string, key string, value []byte) error

func (*Storage) UpdateWeight

func (s *Storage) UpdateWeight(bucket string, kid string) interface{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL