mdb

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CSV  = "csv"
	JSON = "json"
)
View Source
const (
	DICT = "dict"
	META = "meta"
	HASH = "hash"
	LIST = "list"
)
View Source
const (
	CREATE = "create"
	RENAME = "rename"
	REMOVE = "remove"
	COMMIT = "commit"
	IMPORT = "import"
	EXPORT = "export"

	INPUTS = "inputs"

	INSERT = "insert"
	MODIFY = "modify"
	DELETE = "delete"
	SELECT = "select"
)
View Source
const ENGINE = "engine"
View Source
const (
	ErrDenyModify = "deny modify "
)
View Source
const PLUGIN = "plugin"
View Source
const RENDER = "render"
View Source
const SEARCH = "search"

Variables

View Source
var Index = &ice.Context{Name: "mdb", Help: "数据模块",
	Commands: map[string]*ice.Command{
		ice.CTX_INIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {}},
		ice.CTX_EXIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {}},

		INSERT: {Name: "insert conf key type arg...", Help: "添加", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
			switch arg[2] {
			case HASH:
				m.Echo(_hash_insert(m, arg[0], arg[1], arg[3:]...))
			case LIST:
				m.Echo("%d", _list_insert(m, arg[0], arg[1], arg[3:]...))
			}
		}},
		MODIFY: {Name: "modify conf key type field value arg...", Help: "编辑", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
			switch arg[2] {
			case HASH:
				_hash_modify(m, arg[0], arg[1], arg[3], arg[4], arg[5:]...)
			case LIST:
				_list_modify(m, arg[0], arg[1], arg[3], arg[4], arg[5:]...)
			}
		}},
		DELETE: {Name: "delete conf key type field value arg...", Help: "删除", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
			switch arg[2] {
			case HASH:
				_hash_delete(m, arg[0], arg[1], arg[3], arg[4])
			case LIST:
				_list_delete(m, arg[0], arg[1], arg[3], arg[4])
			}
		}},
		SELECT: {Name: "select conf key type field value", Help: "数据查询", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
			switch arg[2] {
			case HASH:
				_hash_select(m, arg[0], arg[1], kit.Select("", arg, 3), kit.Select(kit.MDB_FOREACH, arg, 4))
			case LIST:
				_list_select(m, arg[0], arg[1], kit.Select("", arg, 3), kit.Select("", arg, 4))
			}
		}},
		EXPORT: {Name: "export conf key type [name]", Help: "导出数据", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
			switch file := _file_name(m, arg...); arg[2] {
			case HASH:
				_hash_export(m, arg[0], arg[1], file)
			case LIST:
				_list_export(m, arg[0], arg[1], file)
			}
		}},
		IMPORT: {Name: "import conf key type file", Help: "导入数据", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
			switch file := _file_name(m, arg...); arg[2] {
			case HASH:
				_hash_import(m, arg[0], arg[1], file)
			case LIST:
				_list_import(m, arg[0], arg[1], file)
			}
		}},
		INPUTS: {Name: "inputs conf key type field value", Help: "输入补全", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
			switch arg[2] {
			case HASH:
				_hash_inputs(m, arg[0], arg[1], arg[3], kit.Select("", arg, 4))
			case LIST:
			}
		}},
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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