data_models

package
v0.0.5-37 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LANGUAGES_CONTENT_UNITS_SQL = `` /* 212-byte string literal not displayed */

	TAGS_CONTENT_UNITS_SQL = `` /* 208-byte string literal not displayed */

	SOURCES_CONTENT_UNITS_SQL = `` /* 217-byte string literal not displayed */

	PERSONS_CONTENT_UNITS_SQL = `` /* 217-byte string literal not displayed */

	RAV_PERSON_UID = "abcdefgh"

	COLLECTIONS_CONTENT_UNITS_SQL = `` /* 229-byte string literal not displayed */

	CONTENT_UNITS_COLLECTIONS_SQL = `` /* 230-byte string literal not displayed */

	CONTENT_UNITS_INFO_SQL = `` /* 419-byte string literal not displayed */

	COLLECTIONS_INFO_SQL = `` /* 202-byte string literal not displayed */

	CONTENT_UNITS_WATCH_DURATION_SQL = `` /* 520-byte string literal not displayed */

)

Variables

This section is empty.

Functions

func ScanCollectionInfo

func ScanCollectionInfo(rows *sql.Rows, datas map[string]interface{}) error

func ScanContentUnitInfo

func ScanContentUnitInfo(rows *sql.Rows, datas map[string]interface{}) error

Types

type CollectionInfo

type CollectionInfo struct {
	TypeId    int64
	Uid       string
	Date      time.Time
	CreatedAt time.Time
	SourceUid string
}

type ContentUnitInfo

type ContentUnitInfo struct {
	TypeId             int64
	Uid                string
	Date               time.Time
	CreatedAt          time.Time
	SecureAndPublished bool
	IsLessonPrep       bool
	Duration           time.Duration
}

type DataModels

type DataModels struct {
	LanguagesContentUnitsFilter   *MDBFilterModel
	TagsContentUnitsFilter        *MDBFilterModel
	SourcesContentUnitsFilter     *MDBFilterModel
	PersonsContentUnitsFilter     *MDBFilterModel
	CollectionsContentUnitsFilter *MDBFilterModel
	ContentUnitsCollectionsFilter *MDBFilterModel

	ContentUnitsInfo *MDBDataModel

	CollectionsInfo *MDBDataModel
	// contains filtered or unexported fields
}

func MakeDataModels

func MakeDataModels(db *sql.DB) *DataModels

func (*DataModels) Refresh

func (dataModels *DataModels) Refresh() error

type MDBDataModel

type MDBDataModel struct {
	Datas map[string]interface{}
	// contains filtered or unexported fields
}

func MakeMDBDataModel

func MakeMDBDataModel(db *sql.DB, name string, interval time.Duration, sql string, scanRows ScanRows) *MDBDataModel

func (*MDBDataModel) Data

func (model *MDBDataModel) Data(key string) interface{}

func (*MDBDataModel) Interval

func (model *MDBDataModel) Interval() time.Duration

func (*MDBDataModel) Keys

func (model *MDBDataModel) Keys() []string

func (*MDBDataModel) Name

func (model *MDBDataModel) Name() string

func (*MDBDataModel) Refresh

func (model *MDBDataModel) Refresh() error

type MDBFilterModel

type MDBFilterModel struct {
	Values map[string][]string
	// contains filtered or unexported fields
}

--- MDB Filter Model --- //

func MakeMDBFilterModel

func MakeMDBFilterModel(db *sql.DB, name string, interval time.Duration, sql string) *MDBFilterModel

func (*MDBFilterModel) FilterValues

func (model *MDBFilterModel) FilterValues(keys []string) []string

func (*MDBFilterModel) Interval

func (model *MDBFilterModel) Interval() time.Duration

func (*MDBFilterModel) Name

func (model *MDBFilterModel) Name() string

func (*MDBFilterModel) Refresh

func (model *MDBFilterModel) Refresh() error

type RefreshModel

type RefreshModel interface {
	Name() string
	Refresh() error
	Interval() time.Duration
}

type ScanRows

type ScanRows func(rows *sql.Rows, datas map[string]interface{}) error

-- MDB Data Model -- //

Jump to

Keyboard shortcuts

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