Documentation ¶
Index ¶
- Constants
- type Genre
- func (genre *Genre) BeforeCreate(transaction *gorm.DB) error
- func (genre *Genre) BeforeDelete(transaction *gorm.DB) error
- func (genre *Genre) BeforeUpdate(transaction *gorm.DB) error
- func (genre *Genre) FromProto(protoGenre *proto.Genre)
- func (genre *Genre) PrimaryKey() uint64
- func (genre *Genre) TableName() string
- func (genre *Genre) ToProto() *proto.Genre
- func (genre *Genre) UpdatedFields(updateID bool, updatedFields ...string) map[string]interface{}
- type Language
- func (language *Language) BeforeCreate(transaction *gorm.DB) error
- func (language *Language) BeforeDelete(transaction *gorm.DB) error
- func (language *Language) BeforeUpdate(transaction *gorm.DB) error
- func (language *Language) FromProto(protoLanguage *proto.Language)
- func (language *Language) PrimaryKey() uint64
- func (language *Language) TableName() string
- func (language *Language) ToProto() *proto.Language
- func (language *Language) UpdatedFields(updateID bool, updatedFields ...string) map[string]interface{}
- type Movie
- func (movie *Movie) BeforeCreate(transaction *gorm.DB) error
- func (movie *Movie) BeforeDelete(transaction *gorm.DB) error
- func (movie *Movie) BeforeUpdate(transaction *gorm.DB) error
- func (movie *Movie) FromProto(protoMovie *proto.Movie)
- func (movie *Movie) PrimaryKey() uint64
- func (movie *Movie) TableName() string
- func (movie *Movie) ToProto() *proto.Movie
- func (movie *Movie) UpdatedFields(updateID bool, updatedFields ...string) map[string]interface{}
- type Permission
- func (permission *Permission) BeforeCreate(transaction *gorm.DB) error
- func (permission *Permission) BeforeDelete(transaction *gorm.DB) error
- func (permission *Permission) BeforeUpdate(transaction *gorm.DB) error
- func (permission *Permission) PrimaryKey() uint64
- func (permission *Permission) TableName() string
- func (permission *Permission) UpdatedFields(updateID bool, updatedFields ...string) map[string]interface{}
- type SoftDeleteTimestamps
- type Timestamps
- type User
- func (user *User) BeforeCreate(transaction *gorm.DB) error
- func (user *User) BeforeDelete(transaction *gorm.DB) error
- func (user *User) BeforeUpdate(transaction *gorm.DB) error
- func (user *User) PrimaryKey() uint64
- func (user *User) TableName() string
- func (user *User) UpdatedFields(updateID bool, updatedFields ...string) map[string]interface{}
Constants ¶
const ( KeyGenreID = "id" KeyGenreName = "name" KeyGenreCreatedAt = "created_at" KeyGenreUpdatedAt = "updated_at" )
const ( KeyLanguageID = "id" KeyLanguageIso = "iso" KeyLanguageEnglishName = "english_name" KeyLanguageName = "name" KeyLanguageCreatedAt = "created_at" KeyLanguageUpdatedAt = "updated_at" )
const ( KeyMovieID = "id" KeyMovieTitle = "title" KeyMovieOriginalTitle = "original_title" KeyMovieLocalTitle = "local_title" KeyMovieOriginalLanguage = "original_language" KeyMovieLanguages = "languages" KeyMovieOverview = "overview" KeyMovieTagline = "tagline" KeyMovieGenres = "genres" KeyMovieHomepage = "homepage" KeyMovieRuntime = "runtime" KeyMovieStatus = "status" KeyMovieAdult = "adult" KeyMovieImdbId = "imdb_id" KeyMovieReleaseDate = "release_date" KeyMovieProductionCompanies = "production_companies" KeyMovieProductionCountries = "production_countries" KeyMovieVoteAverage = "vote_average" KeyMovieVoteCount = "vote_count" KeyMoviePopularity = "popularity" KeyMovieBudget = "budget" KeyMovieRevenue = "revenue" KeyMovieBackdrop = "backdrop" KeyMoviePoster = "poster" KeyMovieCreatedAt = "created_at" KeyMovieUpdatedAt = "updated_at" )
const ( KeyPermissionID = "id" KeyPermissionName = "name" KeyPermissionCreatedAt = "created_at" KeyPermissionUpdatedAt = "updated_at" )
const ( KeyUserID = "id" KeyUserUsername = "username" KeyUserEmail = "email" KeyUserEmailVerifiedAt = "email_verified_at" KeyUserPassword = "password" KeyUserRememberToken = "remember_token" KeyUserCreatedAt = "created_at" KeyUserUpdatedAt = "updated_at" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Genre ¶
type Genre struct { ID uint64 `json:"id" gorm:"primary_key"` Name string `json:"name" gorm:"size:255;not null"` Timestamps }
func (*Genre) BeforeCreate ¶
Action which will be executed before new model is added to the database
func (*Genre) BeforeDelete ¶
Action which will be executed before model entry is deleted from the database
func (*Genre) BeforeUpdate ¶
Action which will be executed before model is updated
type Language ¶
type Language struct { ID uint64 `json:"id" gorm:"primary_key"` Iso string `json:"iso_639_1" gorm:"unique;not null" sql:"type:VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_general_ci"` EnglishName string `json:"english_name" gorm:"not null" sql:"type:VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci"` Name string `json:"name" gorm:"not null" sql:"type:VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci"` Timestamps }
func (*Language) BeforeCreate ¶
Action which will be executed before new model is added to the database
func (*Language) BeforeDelete ¶
Action which will be executed before model entry is deleted from the database
func (*Language) BeforeUpdate ¶
Action which will be executed before model is updated
func (*Language) PrimaryKey ¶
Get primary key of the table
type Movie ¶
type Movie struct { ID uint64 `json:"id" gorm:"size:10;not null;not_auto_increment"` Title string `json:"title" gorm:"size:255;not null"` OriginalTitle string `json:"original_title" gorm:"size:255;not null"` LocalTitle string `json:"local_title" gorm:"size:255"` OriginalLanguage string `json:"original_language" gorm:"size:255"` Languages json.RawMessage `json:"languages" gorm:"type:json" sql:"type:longtext"` Overview string `json:"overview" sql:"type:longtext"` Tagline string `json:"tagline" gorm:"size:255"` Genres json.RawMessage `json:"genres" gorm:"type:json" sql:"type:longtext"` Homepage string `json:"homepage" gorm:"size:255"` Runtime uint64 `json:"runtime" gorm:"size:10"` Status uint64 `json:"status" gorm:"size:10"` Adult bool `json:"adult" gorm:"default:false"` ImdbId string `json:"imdb_id" gorm:"size:255"` ReleaseDate string `json:"release_date" gorm:"size:255"` ProductionCompanies json.RawMessage `json:"production_companies" gorm:"type:json" sql:"type:longtext"` ProductionCountries json.RawMessage `json:"production_countries" gorm:"type:json" sql:"type:longtext"` VoteAverage float64 `json:"vote_average" sql:"type:double"` VoteCount uint64 `json:"vote_count" gorm:"size:10"` Popularity float64 `json:"popularity" sql:"type:double"` Budget uint64 `json:"budget" gorm:"size:10"` Revenue uint64 `json:"revenue" gorm:"size:10"` Backdrop string `json:"backdrop" gorm:"size:255"` Poster string `json:"poster" gorm:"size:255"` Timestamps }
func (*Movie) BeforeCreate ¶
Action which will be executed before new model is added to the database
func (*Movie) BeforeDelete ¶
Action which will be executed before model entry is deleted from the database
func (*Movie) BeforeUpdate ¶
Action which will be executed before model is updated
type Permission ¶
type Permission struct { ID uint64 `gorm:"primary_key"` Name string `gorm:"size:255"` Timestamps }
func (*Permission) BeforeCreate ¶
func (permission *Permission) BeforeCreate(transaction *gorm.DB) error
Action which will be executed before new model is added to the database
func (*Permission) BeforeDelete ¶
func (permission *Permission) BeforeDelete(transaction *gorm.DB) error
Action which will be executed before model entry is deleted from the database
func (*Permission) BeforeUpdate ¶
func (permission *Permission) BeforeUpdate(transaction *gorm.DB) error
Action which will be executed before model is updated
func (*Permission) PrimaryKey ¶
func (permission *Permission) PrimaryKey() uint64
Get primary key of the table
func (*Permission) TableName ¶
func (permission *Permission) TableName() string
Provide the table name for Gorm
func (*Permission) UpdatedFields ¶
func (permission *Permission) UpdatedFields(updateID bool, updatedFields ...string) map[string]interface{}
Get list of updated fields
type SoftDeleteTimestamps ¶
type SoftDeleteTimestamps struct { Timestamps DeletedAt *time.Time `json:"deleted_at" gorm:"default:null"` }
type Timestamps ¶
type Timestamps struct { CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
func (*Timestamps) BeforeSave ¶
func (timestamp *Timestamps) BeforeSave() error
func (*Timestamps) BeforeUpdate ¶
func (timestamp *Timestamps) BeforeUpdate() error
type User ¶
type User struct { ID uint64 `gorm:"primary_key"` Username string `gorm:"unique;size:255"` Email string `gorm:"unique;size:255"` EmailVerifiedAt *time.Time `gorm:"default:null"` Password string `gorm:"size:255"` RememberToken string `gorm:"size:100"` Timestamps }
func (*User) BeforeCreate ¶
Action which will be executed before new model is added to the database
func (*User) BeforeDelete ¶
Action which will be executed before model entry is deleted from the database
func (*User) BeforeUpdate ¶
Action which will be executed before model is updated