pkg

package
v0.0.0-...-0d69797 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2020 License: Apache-2.0 Imports: 29 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HtmlTemp multitemplate.Render
)

Functions

func AddKey

func AddKey(c *gin.Context)

@Summary 添加Key接口 @Description 添加指定bucket下的key @Tags Key @Param bucket path string true "BUCKET" @Param key path string true "KEY" @Param value path string true "VALUE" @Success 200 {string} string "success" @Router /api/v1/key/add/{bucket}/{key}/{value} [post]

func AddOrm

func AddOrm(c *gin.Context)

@Summary 新增TimeSeries接口 @Description TimeSeries Add @Tags TimeSeries @Param data body TimeSeries true "NAME" @Success 200 {object} TimeSeries TimeSeries{} //成功返回的数据结构, 最后是示例 @Router /api/v1/orm/add [post]

func Api

func Api(data *Apis)

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func BackUP

func BackUP(c *gin.Context)

@Summary BackUP数据库备份 @Description curl http://localhost/api/v1/db/backup > my.db @Tags DB @Success 200 {string} string "success" //成功返回的数据结构, 最后是示例 @Router /api/v1/db/backup [get]

func BatchKey

func BatchKey(c *gin.Context)

@Summary 批量添加Key接口 @Description 批量添加指定bucket下的key @Tags Key @Param bucket path string true "BUCKET" @Param key path string true "KEY" @Param value path string true "VALUE" @Success 200 {string} string "success" @Router /api/v1/key/batch/{bucket}/{key}/{value} [post]

func Cors

func Cors() gin.HandlerFunc

跨域设置

func CreateBucket

func CreateBucket(c *gin.Context)

@Summary 新增Bucket接口 @Description Bucket Add @Tags Bucket @Param name path string true "NAME" @Success 200 {string} string "success" //成功返回的数据结构, 最后是示例 @Router /api/v1/bucket/add/{name} [post]

func DeleteBucket

func DeleteBucket(c *gin.Context)

@Summary 删除Bucket接口 @Description DELETE Bucket @Tags Bucket @Param name path string true "NAME" @Success 200 {string} string "success" @Router /api/v1/bucket/delete/{name} [delete]

func DeleteKey

func DeleteKey(c *gin.Context)

@Summary 删除Key接口 @Description 删除指定bucket下的key @Tags Key @Param bucket path string true "BUCKET" @Param key path string true "KEY" @Success 200 {string} string "success" @Router /api/v1/key/delete/{bucket}/{key} [delete]

func GetAllKey

func GetAllKey(c *gin.Context)

@Summary 查询Bucket All Key接口 @Description 查询指定bucket下所有key @Tags Key @Param bucket path string true "BUCKET" @Success 200 {string} string "success" @Router /api/v1/key/get/{bucket} [get]

func GetBucket

func GetBucket(c *gin.Context)

@Summary 查询Bucket接口 @Description Bucket GET @Tags Bucket @Success 200 {string} string "success" //成功返回的数据结构, 最后是示例 @Router /api/v1/bucket/get [get]

func GetKey

func GetKey(c *gin.Context)

@Summary 查询Key接口 @Description 查询指定bucket下的key @Tags Key @Param bucket path string true "BUCKET" @Param key path string true "KEY" @Success 200 {string} string "success" @Router /api/v1/key/get/{bucket}/{key} [get]

func GetOrmAllData

func GetOrmAllData(c *gin.Context)

@Summary 查询TimeSeries接口 @Description TimeSeries GET @Tags TimeSeries @Success 200 {string} string "success" //成功返回的数据结构, 最后是示例 @Router /api/v1/orm/getall [get]

func GetOrmRangeData

func GetOrmRangeData(c *gin.Context)

@Summary 查询TimeSeries接口 @Description TimeSeries Range范围查询 @Tags TimeSeries @Param min path string true "MIN" @Param max path string true "MAX" @Success 200 {string} string "success" //成功返回的数据结构, 最后是示例 @Router /api/v1/orm/range/{min}/{max} [get]

func GetPreifxKey

func GetPreifxKey(c *gin.Context)

@Summary Search Prefix Key接口 @Description 按前缀查询指定bucket数据 @Tags Key @Param bucket path string true "BUCKET" @Param key path string true "KEY" @Success 200 {string} string "success" @Router /api/v1/key/prefix/{bucket}/{key} [get]

func GetRangeKey

func GetRangeKey(c *gin.Context)

@Summary Search Range接口 @Description 范围搜索指定bucket数据 @Tags Key @Param bucket path string true "BUCKET" @Param min path string true "MIN" @Param max path string true "MAX" @Success 200 {string} string "success" @Router /api/v1/key/range/{bucket}/{min}/{max} [get]

func Home

func Home() (string, error)

Home returns the home directory for the executing user.

This uses an OS-specific method for discovering the home directory. An error is returned if a home directory cannot be detected.

func NewBolt

func NewBolt() *storm.DB

New/Get boltDBs

func RegisterAPI

func RegisterAPI(router *gin.Engine)

func RegisterOrmAPI

func RegisterOrmAPI(router *gin.Engine)

Types

type Apis

type Apis struct {
	Host  string // http bind host
	Port  string // http bind port
	Stats bool   // is output db stats
}

func (*Apis) Check

func (this *Apis) Check() error

func (*Apis) Execute

func (this *Apis) Execute() error

type Lflxp

type Lflxp interface {
	Check() error
	Execute() error
}

type Result

type Result struct {
	Name   string
	Data   map[string]string
	Count  int
	Status string
}

type TimeSeries

type TimeSeries struct {
	ID      int               `storm:"id,increment"`
	Name    string            `json:"name" storm:"index"`
	Data    map[string]string `json:"data"`
	Created string            `storm:"index"`
}

func (*TimeSeries) Save

func (this *TimeSeries) Save() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL