Documentation
¶
Index ¶
Constants ¶
View Source
const ( // AuthorImported indicates the author was imported from an external source. AuthorImported = 1 << iota // AuthorHasMultipleTitles is a convenience value indicating the author has multiple titles. AuthorHasMultipleTitles )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Author ¶
type Author struct {
ID int `marlow:"column=system_id&autoIncrement=true"`
Name string `marlow:"column=name"`
UniversityID sql.NullInt64 `marlow:"column=university_id"`
ReaderRating float64 `marlow:"column=rating"`
AuthorFlags uint8 `marlow:"column=flags&bitmask"`
Birthday time.Time `marlow:"column=birthday"`
Deceased mysql.NullTime `marlow:"column=deceased"`
// contains filtered or unexported fields
}
Author represents an author of a book.
type Book ¶
type Book struct {
ID int `marlow:"column=system_id&autoIncrement=true"`
Title string `marlow:"column=title"`
AuthorID int `marlow:"column=author"`
SeriesID sql.NullInt64 `marlow:"column=series"`
YearPublished int `marlow:"column=year_published" json:"year_published"`
// contains filtered or unexported fields
}
Book represents a book in the example application
type DatabaseConfig ¶
type DatabaseConfig struct {
Postgres struct {
Username string
Password string
Database string
Hostname string
Port string
}
SQLite struct {
Filename string
}
}
DatabaseConfig is a convenience type for storing the configuration necessary for the example app db connections.
type DatabaseConnections ¶
type DatabaseConnections struct {
Config *DatabaseConfig
// contains filtered or unexported fields
}
DatabaseConnections represent the different connection types used by the example app.
func (*DatabaseConnections) Close ¶
func (db *DatabaseConnections) Close() error
Close will attempt to close the open database connections.
func (*DatabaseConnections) Initialize ¶
func (db *DatabaseConnections) Initialize() error
Initialize opens the various database connection types and seeds their database tables.
type Genre ¶
type Genre struct {
ID uint `marlow:"column=id&autoIncrement=true"`
Name string `marlow:"column=name"`
ParentID sql.NullInt64 `marlow:"column=parent_id"`
// contains filtered or unexported fields
}
Genre records are used to group and describe a types of books.
type MultiAuto ¶
type MultiAuto struct {
ID uint `marlow:"column=id&autoIncrement=true"`
Status string `marlow:"column=status&autoIncrement=true"`
Name string `marlow:"column=name"`
CreatedAt time.Time `marlow:"column=created_at"`
DeletedAt pq.NullTime `marlow:"column=deleted_at"`
// contains filtered or unexported fields
}
MultiAuto represents a record w/ mutliple auto-increment directives on a postgres model.
Click to show internal directories.
Click to hide internal directories.