redigotree

package module
v0.0.0-...-c7675e8 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2018 License: MIT Imports: 9 Imported by: 0

README

redigo-tree


Go Port of https://github.com/shimohq/ioredis-tree

Install


go get -u github.com/kardianos/govendor
govendor sync -insecure -v

Usage


import (
	tree "github.com/zhujiaqi/redigo-tree"
)

tree.TInsert("treename", "parent", "node", map[string]string{"index": "1000"})

API & Examples

For complete API, check: https://github.com/shimohq/ioredis-tree

Please see redigotree_test.go for examples. The tests are for reference only, they are not completed...for now.

To run the tests:

go test

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Filter

func Filter(vs []string, f func(string) bool) []string

Returns a new slice containing all strings in the slice that satisfy the predicate f. Borrowed from https://play.golang.org/p/3PNdke3Wia

func TDestroy

func TDestroy(key string, node string) int

func TExists

func TExists(key string, node string) bool

func TInsert

func TInsert(key string, parent string, node string, options map[string]string) int

func TMoveChildren

func TMoveChildren(key string, source string, target string, op string) int

func TMrem

func TMrem(key string, node string, options map[string]string) interface{}

func TParents

func TParents(key string, node string) []string

func TPath

func TPath(key string, node string, newNode string) []string

func TPrune

func TPrune(key string, node string) bool

func TRem

func TRem(key string, parent string, count int, node string) int

func TRename

func TRename(key string, node string, newNode string) bool

Types

type TreeNode

type TreeNode struct {
	Node     string     `json:"node"`
	HasChild bool       `json:"hasChild"`
	Children []TreeNode `json:"children"`
}

func TChildren

func TChildren(key string, node string, options map[string]string) []TreeNode

Jump to

Keyboard shortcuts

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