things

package module
v0.0.0-...-289309d Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2016 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ScopeToPerson

func ScopeToPerson(person_id int64) (ancestors []pacific.Ancestor)

Types

type Scope

type Scope struct {
	Context     pacific.Context
	Ancestors   []pacific.Ancestor
	PersonId    int64
	PersonIdStr string
	OriginId    string
}

func (Scope) SharedThings

func (scope Scope) SharedThings(tag string) (shared_things []Share)

func (Scope) Shares

func (scope Scope) Shares(tags []string) (shares []Share)

func (Scope) Tag

func (scope Scope) Tag(tag_id string) Tag

func (Scope) Tags

func (scope Scope) Tags() (tags []Tag)

func (Scope) Thing

func (scope Scope) Thing(thing_id string) (thing Thing, err error)

func (Scope) Things

func (scope Scope) Things(tag_ar ...[]string) (things []Thing)

type Share

type Share struct {
	Kind     string `datastore:"-" sql:"-"`
	ObjectId string
	ParentId string `pacific_parent:"parent_id"`
	PersonId int64  `pacific_parent:"person_id"`
	OriginId string `pacific_parent:"origin_id"`
	Status   int
	Created  time.Time `sql:"-"`
	Updated  time.Time `sql:"-"`
	Scope    Scope     `datastore:"-" sql:"-"`
}

func (Share) Save

func (share Share) Save()

type Tag

type Tag struct {
	Scope   Scope  `datastore:"-" sql:"-" json:"-"`
	Claimed bool   `json:"-"`
	Policy  string `json:"-"`
	Owner   string `json:"-"`

	TagId    string
	ObjectId string
	OriginId string
	ParentId string
	Status   int
	Created  time.Time
	Updated  time.Time
	PersonId int64
	Things   []string `json:"-"`
}

func (Tag) Save

func (tag Tag) Save()

TODO: Tags...

func (Tag) Share

func (tag Tag) Share(person_id int64)

type Thing

type Thing struct {
	Scope Scope `datastore:"-" sql:"-" json:"-"`

	Value string `sql:"type:text" datastore:",noindex" json:"-"`

	Map        map[string]interface{} `datastore:"-" sql:"-"`
	Tags       map[string]Tag         `datastore:"-" sql:"-"`
	Dispatched map[string]interface{} `datastore:"-" sql:"-" json:"-"`
	Mock       bool                   `datastore:"-" sql:"-" json:"-"`
	Sharing    int                    `datastore:"-" sql:"-" json:"-"`

	ThingId     string
	Created     time.Time `sql:"-"`
	Updated     time.Time `sql:"-"`
	PersonId    int64
	PersonIdStr string
	Status      int  `json:"-"`
	IsNew       bool `datastore:"-" sql:"-" json:"-"`
}

func (Thing) New

func (thing Thing) New(thing_id string) Thing

func (*Thing) Save

func (thing *Thing) Save() bool

func (Thing) Share

func (thing Thing) Share(person_id int64, person_id_str, origin_id, tag string)

func (*Thing) TagsFromString

func (thing *Thing) TagsFromString(sep string, chunks ...interface{})

func (Thing) ToJSON

func (thing Thing) ToJSON() string

Jump to

Keyboard shortcuts

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