db

package
v0.0.0-...-0a0123b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProviderSet = wire.NewSet(
	NewConfig,
	New,
)

Functions

func OpenDB

func OpenDB(c Config) (*sql.DB, error)

func OpenGorm

func OpenGorm(c Config, db *sql.DB) (*gorm.DB, error)

TODO breadchris clean this up

Types

type Config

type Config struct {
	DSN                          string `yaml:"dsn"`
	BackupName                   string `yaml:"backup_name"`
	Endpoint                     string `yaml:"endpoint"`
	AwsAccessKeyID               string `yaml:"aws_access_key_id"`
	AwsSecretAccessKey           string `yaml:"aws_secret_access_key"`
	AdminEmail                   string `yaml:"admin_email"`
	AdminPassword                string `yaml:"admin_password"`
	GoogleApplicationCredentials string `yaml:"google_application_credentials"`

	BackupsEnabled bool
	BackupsConfig  string `yaml:"backups"`
}

func NewConfig

func NewConfig(provider config.Provider) (Config, error)

func NewDefaultConfig

func NewDefaultConfig() Config

type Service

type Service struct {
	DB *gorm.DB
	// contains filtered or unexported fields
}

func New

func New(c Config, bc bucket.Config) (*Service, error)

func (*Service) GetCurrentCompetition

func (s *Service) GetCurrentCompetition() (string, *chalgen.Graph, error)

func (*Service) InitializeAdmin

func (s *Service) InitializeAdmin()

func (*Service) Migrate

func (s *Service) Migrate() error

func (*Service) Restore

func (s *Service) Restore(ctx context.Context, replica *litestream.Replica) (err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL