Documentation
¶
Index ¶
- func RunMigrations(db *gorm.DB) error
- type Database
- func (db *Database) CreateSite(ctx context.Context, site *models.Site) error
- func (db *Database) DeleteSite(ctx context.Context, site *models.Site) error
- func (db *Database) GetSiteById(ctx context.Context, site *models.Site) (models.Site, error)
- func (db *Database) GetSiteByName(ctx context.Context, site *models.Site) (models.Site, error)
- func (db *Database) UpdateSite(ctx context.Context, site *models.Site) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunMigrations ¶
RunMigrations is a helper function to run the migrations for the database.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database is the database adapter for the builder server.
func NewDatabase ¶
NewDatabase creates a new Database instance.
func (*Database) CreateSite ¶
CreateSite creates a new site with the given name.
func (*Database) DeleteSite ¶
DeleteSite deletes the site with the given name.
func (*Database) GetSiteById ¶
GetSiteById returns the site with the given id.
func (*Database) GetSiteByName ¶
GetSiteByName returns the site with the given name.
Click to show internal directories.
Click to hide internal directories.