kek

package module
v0.0.0-...-5859b46 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2018 License: MIT Imports: 13 Imported by: 8

README

kek

Documentation

Index

Constants

View Source
const DOC_DIR = "d/"
View Source
const FIELD_DIR = "f/"
View Source
const KEK_DIR = "/.kek/"

Variables

This section is empty.

Functions

func Delete

func Delete(locale string) error

Deprecated as you should be using the kek.store{}.Delete method

func List

func List(locale string, limit int) (map[string]bool, error)

Deprecated as you should use kek.store{}.List()

func Load

func Load(locale string, unmarshallStruct interface{}) (interface{}, error)

Deprecated as you should be using the kek.store{}.Load method

func Save

func Save(kekLocale string, content interface{}) error

Deprecated as you should be using the kek.store{}.Save method

Types

type Doc

type Doc struct {
	Id            string                 `json:"id"`
	Name          string                 `json:"name"`
	KekVersion    string                 `json:"kek_version"`
	Description   string                 `json:"description"`
	Schema        string                 `json:"$schema"`
	Attributes    map[string]interface{} `json:"attributes"`
	CreatedAt     time.Time              `json:"created_at"`
	UpdatedAt     time.Time              `json:"updated_at"`
	Revisions     revchain.ChainMaker    `json:"revisions"`
	Rev           string                 `json:"rev"`
	RootId        string                 `json:"root_id"`
	CopyIds       map[string]bool        `json:"copy_ids"`
	CollectionIds map[string]bool        `json:"collections"`
	// contains filtered or unexported fields
}

func (Doc) Delete

func (kd Doc) Delete(id string) error

Delete a kekdoc and its associated indexed attributes & revision chain.

func (Doc) Find

func (kd Doc) Find(q DocQuery) ([]Doc, error)

Find a kekdocument based on a DocQuery.

func (Doc) Get

func (kd Doc) Get(id string, withRevChain bool) (Doc, error)

func (Doc) New

func (kd Doc) New(attrs map[string]interface{}) (Doc, error)

New will create a kekdoc, index the field attributes, map the classes & start the revision chain

func (*Doc) SaveCollectionIds

func (kd *Doc) SaveCollectionIds() error

func (Doc) SetStore

func (kd Doc) SetStore(store kekstore.Storer) Doc

func (Doc) Store

func (kd Doc) Store() kekstore.Storer

func (Doc) Update

func (kd Doc) Update(id string, attrs map[string]interface{}, patch bool) (Doc, error)

type DocQuery

type DocQuery struct {
	Id            uuid.UUID
	Slug          string
	WithDocs      bool
	WithDocRevs   bool
	Offset        int
	SearchQueries []SearchQuery
	Limit         int
	OrderBy       string
}

type SearchQuery

type SearchQuery struct {
	Operator string
	Field    string
	Value    string
}

Jump to

Keyboard shortcuts

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