modeldb

package
v0.0.0-01-21-2016.10-2... Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2016 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddLink(link *Link, obj ModelObj)

AddLink adds a one way link to target object

func AddLinkSet

func AddLinkSet(linkSet *(map[string]Link), obj ModelObj) error

Add a link into linkset. initialize the linkset if required

func DeleteObj

func DeleteObj(objType, objKey string) error

func ReadAllObj

func ReadAllObj(objType string) ([]string, error)

func ReadObj

func ReadObj(objType, objKey string, retVal interface{}) error
func RemoveLink(link *Link, obj ModelObj)

RemoveLink removes a one way link

func RemoveLinkSet

func RemoveLinkSet(linkSet *(map[string]Link), obj ModelObj) error

func WriteObj

func WriteObj(objType, objKey string, value interface{}) error

Types

type Link struct {
	ObjType string `json:"type,omitempty"`
	ObjKey  string `json:"key,omitempty"`
	// contains filtered or unexported fields
}

Link is a one way relattion between two objects

type ModelObj

type ModelObj interface {
	GetType() string
	GetKey() string
	Read() error
	Write() error
}

Jump to

Keyboard shortcuts

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