Documentation
¶
Index ¶
- type ArtMovement
- type ArtMovements
- type Artist
- type ArtistCSV
- type ArtistsMovement
- type ArtistsNationality
- type ArtistsSchool
- type Date
- type Genre
- type Image
- type Media
- type Nationalities
- type Nationality
- type Painting
- type PaintingSchool
- type PaintingSchools
- type PaintingsGenre
- type PaintingsMedias
- type PaintingsStyle
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArtMovement ¶
type ArtMovements ¶
type ArtMovements struct {
ArtMovements []string
}
func (*ArtMovements) UnmarshalCSV ¶
func (paintingSchools *ArtMovements) UnmarshalCSV(csv string) (err error)
type Artist ¶
type Artist struct { gorm.Model Name string `gorm:"type:varchar(128);not null;unique" json:"name"` OriginalName string `gorm:"type:varchar(128)" json:"original_name"` Nationalities []*Nationality `gorm:"many2many:artists_nationalities;association_autocreate:false"` PaintingSchools []*PaintingSchool `gorm:"many2many:artists_schools;association_autocreate:false"` ArtMovements []*ArtMovement `gorm:"many2many:artists_movements;association_autocreate:false"` Paintings []*Painting `gorm:"foreignkey:artist_id"` BirthDate time.Time `gorm:"type:date" json:"birth_date"` DeathDate time.Time `gorm:"type:date" json:"death_date"` }
type ArtistCSV ¶
type ArtistCSV struct { ID int `csv:"id"` Name string `csv:"name"` OriginalName string `csv:"original_name"` Nationalities Nationalities `csv:"nationalities"` PaintingSchools PaintingSchools `csv:"painting_schools"` ArtMovements ArtMovements `csv:"art_movements"` BirthDate Date `csv:"birth_date"` DeathDate Date `csv:"death_date"` }
type ArtistsMovement ¶
type ArtistsMovement struct { ArtistID uint `sql:"type:int REFERENCES artists(id)" json:"artist_id"` Artist *Artist `gorm:"foreignkey:id"` ArtMovementID uint `sql:"type:int REFERENCES art_movements(id)" json:"art_movement_id"` ArtMovement *ArtMovement `gorm:"foreignkey:id"` }
type ArtistsNationality ¶
type ArtistsNationality struct { ArtistID uint `sql:"type:int REFERENCES artists(id)" json:"artist_id"` Artist *Artist `gorm:"foreignkey:id"` NationalityID uint `sql:"type:int REFERENCES nationality(id)" json:"nationality_id"` Nationality *Nationality `gorm:"foreignkey:id"` }
type ArtistsSchool ¶
type ArtistsSchool struct { ArtistID uint `sql:"type:int REFERENCES artists(id)" json:"artist_id"` Artist *Artist `gorm:"foreignkey:id"` PaintingSchoolID uint `sql:"type:int REFERENCES painting_schools(id)" json:"painting_school_id"` PaintingSchool *PaintingSchool `gorm:"foreignkey:id"` }
type Date ¶
func (*Date) MarshalCSV ¶
MarshalCSV converts the internal date as CSV string
func (*Date) UnmarshalCSV ¶
UnmarshalCSV converts CSV string as the internal date
type Image ¶
type Image struct { gorm.Model Location string `gorm:"type:varchar(255);not null;unique" json:"name"` Width int `gorm:"type:int;" json:"width"` Height int `gorm:"type:int;" json:"height"` Painting *Painting `gorm:"foreignkey:id"` PaintingID uint `sql:"type:int REFERENCES paintings(id)" json:"painting_id"` }
type Nationalities ¶
type Nationalities struct {
Nationalities []string
}
func (*Nationalities) UnmarshalCSV ¶
func (nationalities *Nationalities) UnmarshalCSV(csv string) (err error)
type Nationality ¶
type Painting ¶
type Painting struct { gorm.Model Name string `gorm:"type:varchar(128);not null;unique_index:artist_painting" json:"name"` OriginalName string `gorm:"type:varchar(128)" json:"original_name"` Artist *Artist `gorm:"foreignkey:id"` ArtistID uint `gorm:"unique_index:artist_painting" sql:"type:int REFERENCES artists(id)" json:"artist_id"` Width int `gorm:"type:int" json:"width"` Height int `gorm:"type:int" json:"height"` Copyright string `gorm:"type:varchar(64)" json:"copyright"` Genres []*Genre `gorm:"many2many:paintings_genres;association_autocreate:false"` Styles []*ArtMovement `gorm:"many2many:paintings_styles;association_autocreate:false"` Medias []*Media `gorm:"many2many:paintings_medias;association_autocreate:false"` Images []*Image `gorm:"foreignkey:painting_id"` }
type PaintingSchool ¶
type PaintingSchools ¶
type PaintingSchools struct {
PaintingSchools []string
}
func (*PaintingSchools) UnmarshalCSV ¶
func (paintingSchools *PaintingSchools) UnmarshalCSV(csv string) (err error)
type PaintingsGenre ¶
type PaintingsMedias ¶
type PaintingsStyle ¶
type PaintingsStyle struct { PaintingID uint `sql:"type:int REFERENCES paintings(id)" json:"painting_id"` Painting *Painting `gorm:"foreignkey:id"` ArtMovementID uint `sql:"type:int REFERENCES art_movements(id)" json:"art_movement_id"` ArtMovement *ArtMovement `gorm:"foreignkey:id"` }
Click to show internal directories.
Click to hide internal directories.