Documentation
¶
Index ¶
- Variables
- func MysqlDSN(addr, user, password, dbName string) string
- type MigrationsStatus
- type Program
- func (pg *Program) AddAllUsersToCommunity(community string) error
- func (pg *Program) ChangeUserPassword(user, password string) error
- func (pg *Program) Close() error
- func (pg *Program) Config() *config.Config
- func (pg *Program) DeleteUnusedCommunities(days uint, dryRun bool) error
- func (pg *Program) DeleteUser(user string, purge bool) error
- func (pg *Program) FixPostHotScores() error
- func (pg *Program) HardReset() error
- func (pg *Program) MakeUserAdmin(username string, isAdmin bool) error
- func (pg *Program) MakeUserMod(community, user string, isMod bool) error
- func (pg *Program) Migrate(log bool, steps int) error
- func (pg *Program) MigrationsStatus() (MigrationsStatus, error)
- func (pg *Program) NewBadgeType(name string) error
- func (pg *Program) OpenDatabase() (*sql.DB, error)
- func (pg *Program) Serve() error
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrMigrationsTableNotFound = errors.New("migrations table not found")
)
Functions ¶
Types ¶
type MigrationsStatus ¶
type Program ¶
type Program struct {
// contains filtered or unexported fields
}
func NewProgram ¶
func (*Program) AddAllUsersToCommunity ¶
func (*Program) ChangeUserPassword ¶
func (*Program) DeleteUnusedCommunities ¶
func (*Program) FixPostHotScores ¶
func (*Program) MakeUserAdmin ¶
func (*Program) MakeUserMod ¶
func (*Program) Migrate ¶
If steps is 0, all migrations are run. Otherwise, steps migrations are run up or down depending on steps > 0 or not.
func (*Program) MigrationsStatus ¶
func (pg *Program) MigrationsStatus() (MigrationsStatus, error)
MigrationsStatus returns the status of the current database migrations. If the migrations table is not found, ErrMigrationsTableNotFound is returned. If the migrations table is found but it's empty, sql.ErrNoRows is returned.
func (*Program) NewBadgeType ¶
func (*Program) OpenDatabase ¶
OpenDatabase opens the database. If it was opened previously, the existing sql.DB object is returned.
Click to show internal directories.
Click to hide internal directories.