Documentation ¶
Index ¶
- func ArtFormQuery(dao *daos.Dao) *dbx.SelectQuery
- func ArtTypeQuery(dao *daos.Dao) *dbx.SelectQuery
- func ArtistQuery(dao *daos.Dao) *dbx.SelectQuery
- func ArtworkQuery(dao *daos.Dao) *dbx.SelectQuery
- func GuestbookQuery(dao *daos.Dao) *dbx.SelectQuery
- func SchoolQuery(dao *daos.Dao) *dbx.SelectQuery
- func StaticPageQuery(dao *daos.Dao) *dbx.SelectQuery
- type ArtForm
- type ArtPeriod
- type ArtType
- type Artist
- type Artwork
- type Feedback
- type GlossaryItem
- type GuestbookEntry
- type Music_composer
- type Music_song
- type Postcard
- type School
- type StaticPage
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 ¶
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 ¶
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).
type ArtPeriod ¶
type ArtType ¶
type ArtType struct { models.BaseModel Name string `db:"name" json:"name"` Slug string `db:"slug" json:"slug"` }
func GetArtTypeBySlug ¶
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 ¶
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).
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 GetArtistBySlug ¶
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 ¶
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).
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 ¶
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
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.
type Feedback ¶
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 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 ¶
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 ¶
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.
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.