syrup_plum

package module
v0.0.0-...-9b1d774 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

README

syrup-plum

使用gob对struct等golang数据的存储与管理

  • InitOption 通过参数生成option
  • InitOptionWithConfigFile 通过配置文件生成option
  • NewSyrupPlum
  • Save 保存,如果存在会覆盖
  • Find 获取内容
  • Delete 删除

更多

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Debug = false

Functions

func NewQuery

func NewQuery(dbPath string) *query

func PathExists

func PathExists(path string) (bool, error)

func SPError

func SPError(a ...interface{})

func SetDebug

func SetDebug(debug bool)

Types

type Option

type Option struct {
	ConfigPath string //使用配置文件初始化config
	SavePath   string //数据保存目录地址

}

func InitOption

func InitOption(savePath string) (*Option, error)

func InitOptionWithConfigFile

func InitOptionWithConfigFile(configPath string) (*Option, error)

func (*Option) CheckHealthy

func (option *Option) CheckHealthy() (bool, error)

type SyrupPlum

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

func NewSyrupPlum

func NewSyrupPlum(option *Option) *SyrupPlum

func (*SyrupPlum) Delete

func (sp *SyrupPlum) Delete(index string) error

删除

func (*SyrupPlum) Find

func (sp *SyrupPlum) Find(index string, object interface{}) error

获取

func (*SyrupPlum) Save

func (sp *SyrupPlum) Save(index string, object interface{}) error

保存,如果存在会覆盖

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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