metathings_tagd_storage

package
v1.1.31-alpha4 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MONGO_TAG_ID  = "##id"
	MONGO_TAG_NS  = "##ns"
	MONGO_TAG_PAD = "x"
)

Variables

View Source
var (
	ErrUnknownDriver = errors.New("unknown driver")
	ErrNotFound      = errors.New("not found")
)

Functions

This section is empty.

Types

type MongoStorage

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

func (*MongoStorage) Get

func (self *MongoStorage) Get(ns string, id string) ([]string, error)

func (*MongoStorage) Query

func (self *MongoStorage) Query(ns string, tags []string) ([]string, error)

func (*MongoStorage) Remove

func (self *MongoStorage) Remove(ns string, id string) error

func (*MongoStorage) Tag

func (self *MongoStorage) Tag(ns string, id string, tags []string) error

func (*MongoStorage) Untag

func (self *MongoStorage) Untag(ns string, id string, tags []string) error

type MongoStorageOption

type MongoStorageOption struct {
	Uri        string
	Database   string
	Collection string
	Timeout    time.Duration
}

func NewMongoStorageOption

func NewMongoStorageOption() *MongoStorageOption

type Storage

type Storage interface {
	Tag(ns string, id string, tags []string) error
	Untag(ns string, id string, tags []string) error
	Remove(ns string, id string) error
	Get(ns string, id string) ([]string, error)
	Query(ns string, tags []string) ([]string, error)
}

func NewMongoStorage

func NewMongoStorage(args ...interface{}) (Storage, error)

func NewStorage

func NewStorage(driver string, args ...interface{}) (Storage, error)

Jump to

Keyboard shortcuts

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