structs

package
v0.0.0-...-d01b63e Latest Latest
Warning

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

Go to latest
Published: May 13, 2017 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	Model  Model
	ID     int
	Fields []ItemField
}

func (Item) Save

func (item Item) Save()

Save will save the given item using it's associated model

type ItemField

type ItemField struct {
	ModelField ModelField
	Value      []byte
}

type Model

type Model struct {
	Name   string
	Fields []ModelField
}

Model defines the structure of a model

func GetModels

func GetModels() ([]Model, error)

GetModels returns the models defined as .JSON files

func (Model) CreateSchema

func (m Model) CreateSchema()

CreateSchema will create the schema in the DB

func (Model) GetAll

func (m Model) GetAll() []Item

GetAll returns all the items

type ModelField

type ModelField struct {
	Name string
	Type string
}

ModelField is a field structure, Model have a list of this

Jump to

Keyboard shortcuts

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