godatamodel

package module
v0.0.0-...-9b03086 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DataModelSubjectFieldTypeBool        DataModelSubjectFieldType = "bool"
	DataModelSubjectFieldTypeInt                                   = "int"
	DataModelSubjectFieldTypeUInt                                  = "uint"
	DataModelSubjectFieldTypeFloat                                 = "float"
	DataModelSubjectFieldTypeDataDateUTC                           = "dateutc"
	DataModelSubjectFieldTypeString                                = "string"
	DataModelSubjectFieldTypeBytes                                 = "bytes"
	DataModelSubjectFieldTypeUUID                                  = "uuid"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DataModel

type DataModel struct {
	Subjects []*DataModelSubject
}

this is root structure of tree like structure of this package functionality

func (*DataModel) GetSubjectByName

func (self *DataModel) GetSubjectByName(name string) *DataModelSubject

type DataModelSubject

type DataModelSubject struct {
	Name         string
	DisplayTitle string
	Description  string
	ForExport    bool // clients can request this Model represintation
	Fields       []*DataModelSubjectField
}

describes table and it's fields

func (*DataModelSubject) GetFieldByName

func (self *DataModelSubject) GetFieldByName(name string) *DataModelSubjectField

type DataModelSubjectDocument

type DataModelSubjectDocument struct {
	Items []*DataModelSubjectDocumentItem
}

this is used to insert or get documents

type DataModelSubjectDocumentItem

type DataModelSubjectDocumentItem struct {
	Name    string
	Value   interface{}
	Null    bool
	Default bool
}

type DataModelSubjectField

type DataModelSubjectField struct {
	// Mode                  DataModelSubjectFieldMode
	Name                  string
	Type                  DataModelSubjectFieldType
	CanBeNull             bool
	DefaultCanBeUsed      bool
	DefaultValue          interface{}
	DisplayTitle          string
	Description           string
	DisplayMustBeCensored bool
	ForStorage            bool // store/load to/from db
	ForUserView           bool // user can view
	ForUserSet            bool // user can change
	ForTransport          bool // for network transfers // TODO: experimental

}

type DataModelSubjectFieldType

type DataModelSubjectFieldType string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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