models

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArtFormQuery

func ArtFormQuery(dao *daos.Dao) *dbx.SelectQuery

ArtFormQuery returns a new dbx.SelectQuery for the ArtForm model.

func ArtTypeQuery

func ArtTypeQuery(dao *daos.Dao) *dbx.SelectQuery

ArtTypeQuery returns a new SelectQuery for the ArtType model.

func ArtistQuery

func ArtistQuery(dao *daos.Dao) *dbx.SelectQuery

ArtistQuery returns a new dbx.SelectQuery for the Artist model.

func ArtworkQuery

func ArtworkQuery(dao *daos.Dao) *dbx.SelectQuery

ArtworkQuery returns a new dbx.SelectQuery for the Artwork model.

func GuestbookQuery added in v0.11.0

func GuestbookQuery(dao *daos.Dao) *dbx.SelectQuery

func SchoolQuery

func SchoolQuery(dao *daos.Dao) *dbx.SelectQuery

SchoolQuery returns a new dbx.SelectQuery for the School model. It takes a dao object as a parameter and returns a pointer to the new query.

func StaticPageQuery

func StaticPageQuery(dao *daos.Dao) *dbx.SelectQuery

StaticPageQuery returns a new dbx.SelectQuery for querying StaticPage models.

Types

type ArtForm

type ArtForm struct {
	models.BaseModel
	Name string `db:"name" json:"name"`
	Slug string `db:"slug" json:"slug"`
}

func GetArtFormBySlug

func GetArtFormBySlug(dao *daos.Dao, slug string) (*ArtForm, error)

GetArtFormBySlug retrieves an art form from the database by its slug. It takes a dao object and a slug string as arguments and returns a pointer to the retrieved ArtForm object and an error (if any).

func GetArtForms

func GetArtForms(dao *daos.Dao) ([]*ArtForm, error)

GetArtForms retrieves all art forms from the database and returns them as a slice of ArtForm pointers. It takes a dao object as a parameter and returns the slice of ArtForm pointers and an error (if any).

func (*ArtForm) TableName

func (m *ArtForm) TableName() string

type ArtPeriod

type ArtPeriod struct {
	models.BaseModel
	Name        string `db:"name" json:"name"`
	Start       int    `db:"start" json:"start"`
	End         int    `db:"end" json:"end"`
	Description string `db:"description" json:"description"`
}

func (*ArtPeriod) TableName

func (m *ArtPeriod) TableName() string

type ArtType

type ArtType struct {
	models.BaseModel
	Name string `db:"name" json:"name"`
	Slug string `db:"slug" json:"slug"`
}

func GetArtTypeBySlug

func GetArtTypeBySlug(dao *daos.Dao, slug string) (*ArtType, error)

GetArtTypeBySlug retrieves an ArtType from the database by its slug. It takes a dao object and a slug string as parameters. It returns a pointer to the retrieved ArtType and an error if any.

func GetArtTypes

func GetArtTypes(dao *daos.Dao) ([]*ArtType, error)

GetArtTypes retrieves all art types from the database and returns them as a slice of ArtType pointers. It takes a pointer to a dao object as an argument and returns the slice of ArtType pointers and an error (if any).

func (*ArtType) TableName

func (m *ArtType) TableName() string

type Artist

type Artist struct {
	models.BaseModel
	Id           string `db:"id" json:"id"`
	Name         string `db:"name" json:"name"`
	Slug         string `db:"slug" json:"slug"`
	Bio          string `db:"bio" json:"bio"`
	YearOfBirth  int    `db:"year_of_birth" json:"year_of_birth"`
	YearOfDeath  int    `db:"year_of_death" json:"year_of_death"`
	PlaceOfBirth string `db:"place_of_birth" json:"place_of_birth"`
	PlaceOfDeath string `db:"place_of_death" json:"place_of_death"`
	Published    bool   `db:"published" json:"published"`
	School       string `db:"school" json:"school"`
	Profession   string `db:"profession" json:"profession"`
}

WIP - this is a work in progress

func GetArtistById

func GetArtistById(dao *daos.Dao, id string) (*Artist, error)

func GetArtistByNameLike

func GetArtistByNameLike(dao *daos.Dao, name string) ([]*Artist, error)

func GetArtistBySlug

func GetArtistBySlug(dao *daos.Dao, slug string) (*Artist, error)

GetArtistBySlug retrieves an art form from the database by its slug. It takes a dao object and a slug string as arguments and returns a pointer to the retrieved Artist object and an error (if any).

func GetArtists

func GetArtists(dao *daos.Dao) ([]*Artist, error)

GetArtists retrieves all art forms from the database and returns them as a slice of Artist pointers. It takes a dao object as a parameter and returns the slice of Artist pointers and an error (if any).

func (*Artist) TableName

func (m *Artist) TableName() string

type Artwork

type Artwork struct {
	models.BaseModel
	Title     string `db:"title" json:"title"`
	Author    string `db:"author" json:"author"`
	Form      string `db:"form" json:"form"`
	Technique string `db:"technique" json:"technique"`
	School    string `db:"school" json:"school"`
	Comment   string `db:"comment" json:"comment"`
	Published bool   `db:"published" json:"published"`
	Image     string `db:"image" json:"image"`
	Type      string `db:"type" json:"type"`
}

func GetArtworks

func GetArtworks(dao *daos.Dao) ([]*Artwork, error)

GetArtworks retrieves all artworks from the database. It takes a dao object as a parameter and returns a slice of Artwork pointers and an error. The artworks are ordered by title in ascending order.

func GetRandomArtworks added in v0.16.0

func GetRandomArtworks(dao *daos.Dao, itemCount int64) ([]*Artwork, error)

GetRandomArtworks returns a slice of random Artwork objects from the database. It takes a dao object and the number of items to retrieve as parameters. It returns the slice of Artwork objects and an error, if any.

func (*Artwork) TableName

func (m *Artwork) TableName() string

type Feedback

type Feedback struct {
	models.BaseModel
	Name    string `db:"name" json:"name"`
	Message string `db:"message" json:"message"`
	Email   string `db:"email" json:"email"`
	ReferTo string `db:"refer_to" json:"refer_to"`
	Handled bool   `db:"handled" json:"handled"`
}

func (*Feedback) TableName

func (m *Feedback) TableName() string

type GlossaryItem

type GlossaryItem struct {
	models.BaseModel
	Expression string `db:"expression" json:"expression"`
	Definition string `db:"definition" json:"definition"`
}

func (*GlossaryItem) TableName

func (m *GlossaryItem) TableName() string

type GuestbookEntry

type GuestbookEntry struct {
	models.BaseModel
	Name     string `db:"name" json:"name"`
	Message  string `db:"message" json:"message"`
	Email    string `db:"email" json:"email"`
	Location string `db:"location" json:"location"`
	Created  string `db:"created" json:"created"`
}

func FindEntriesForYear added in v0.11.0

func FindEntriesForYear(dao *daos.Dao, year string) ([]*GuestbookEntry, error)

func (*GuestbookEntry) TableName

func (m *GuestbookEntry) TableName() string

type Music_composer

type Music_composer struct {
	models.BaseModel
	ID       string       `db:"id" json:"id"`
	Name     string       `db:"name" json:"name"`
	Date     string       `db:"date" json:"date"`
	Language string       `db:"language" json:"language"`
	Century  string       `db:"century" json:"century"`
	Songs    []Music_song `db:"songs" json:"songs"`
}

func (*Music_composer) TableName

func (m *Music_composer) TableName() string

type Music_song

type Music_song struct {
	models.BaseModel
	Title      string `db:"title" json:"title"`
	URL        string `db:"url" json:"url"`
	Source     string `db:"source" json:"source"`
	ComposerID string `db:"composer_id" json:"composer_id"` // foreign key
}

func (*Music_song) TableName

func (m *Music_song) TableName() string

type Postcard

type Postcard struct {
	models.BaseModel
	SenderName  string `db:"sender_name" json:"sender_name"`
	SenderEmail string `db:"sender_email" json:"sender_email"`
	Recipients  string `db:"recipients" json:"recipients"`
	Message     string `db:"message" json:"message"`
}

func (*Postcard) TableName

func (m *Postcard) TableName() string

type School

type School struct {
	models.BaseModel
	Name string `db:"name" json:"name"`
	Slug string `db:"slug" json:"slug"`
}

School represents a school model with its name and slug.

func GetSchoolBySlug

func GetSchoolBySlug(dao *daos.Dao, slug string) (*School, error)

GetSchoolBySlug retrieves a school by its slug from the database. It takes a dao object and a string slug as input parameters. It returns a pointer to a School object and an error object.

func GetSchools

func GetSchools(dao *daos.Dao) ([]*School, error)

GetSchools retrieves all schools from the database and returns them as a slice of School structs. The schools are sorted by name in ascending order.

func (*School) TableName

func (m *School) TableName() string

TableName returns the name of the collection for School model.

type StaticPage

type StaticPage struct {
	models.BaseModel
	Title   string `json:"title" db:"title"`
	Slug    string `json:"slug" db:"slug"`
	Content string `json:"content" db:"content"`
}

func FindStaticPageBySlug

func FindStaticPageBySlug(dao *daos.Dao, slug string) (*StaticPage, error)

FindStaticPageBySlug retrieves a StaticPage from the database by its slug. It performs a case-insensitive match on the slug parameter. Returns a pointer to the StaticPage and an error if any occurred.

func (*StaticPage) TableName

func (m *StaticPage) TableName() string

TableName returns the name of the collection associated with the StaticPage model.

Jump to

Keyboard shortcuts

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