expander

package
v0.0.0-...-f567841 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2014 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

View Source
const (
	REF_KEY        = "ref"
	REL_KEY        = "rel"
	VERB_KEY       = "verb"
	COLLECTION_KEY = "Collection"
)

Variables

View Source
var Cache *lru.Cache = lru.New(250)
View Source
var CacheMutex = sync.Mutex{}

Functions

func Expand

func Expand(data interface{}, expansion, fields string) map[string]interface{}

TODO: TagFields & BSONFields

func ExpandArray

func ExpandArray(data interface{}, expansion, fields string) []interface{}

func Init

func Init()

Types

type CacheEntry

type CacheEntry struct {
	Timestamp int64
	Data      string
}

type Configuration

type Configuration struct {
	UsingCache           bool
	UsingMongo           bool
	IdURIs               map[string]string
	CacheExpInSeconds    int64
	ConnectionTimeoutInS int
}
var ExpanderConfig Configuration = Configuration{
	UsingMongo:           false,
	UsingCache:           false,
	CacheExpInSeconds:    86400,
	ConnectionTimeoutInS: 2,
}

type DBRef

type DBRef struct {
	Collection string
	Id         interface{}
	Database   string
}

type Filter

type Filter struct {
	Children Filters
	Value    string
}

type Filters

type Filters []Filter

func (Filters) Contains

func (m Filters) Contains(v string) bool

func (Filters) Get

func (m Filters) Get(v string) Filter

func (Filters) IsEmpty

func (m Filters) IsEmpty() bool

type ObjectId

type ObjectId interface {
	Hex() string
}

Jump to

Keyboard shortcuts

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