db

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host     string `envconfig:"POSTGRES_HOST"`
	Port     string `envconfig:"POSTGRES_PORT"`
	User     string `envconfig:"POSTGRES_USER"`
	Password string `envconfig:"POSTGRES_PASSWORD"`
	Database string `envconfig:"POSTGRES_DATABASE"`
}

type DbClient

type DbClient struct {
	// contains filtered or unexported fields
}

func NewDbClientFromEnvironment

func NewDbClientFromEnvironment(lg *zap.Logger) (*DbClient, error)

func (*DbClient) AutoMigrate

func (d *DbClient) AutoMigrate(ctx context.Context) error

func (*DbClient) CreateOrUpdateIncidents

func (d *DbClient) CreateOrUpdateIncidents(ctx context.Context, incidents []api.Incident) error

func (*DbClient) GetAllStatusPages

func (d *DbClient) GetAllStatusPages(ctx context.Context) ([]api.StatusPage, error)

func (*DbClient) GetCurrentIncidents added in v0.11.0

func (d *DbClient) GetCurrentIncidents(ctx context.Context, statusPageUrl string) ([]api.Incident, error)

func (*DbClient) GetIncidents

func (d *DbClient) GetIncidents(ctx context.Context, statusPageUrl string) ([]api.Incident, error)

func (*DbClient) GetStatusPage

func (d *DbClient) GetStatusPage(ctx context.Context, url string) (*api.StatusPage, error)

func (*DbClient) InsertStatusPage

func (d *DbClient) InsertStatusPage(ctx context.Context, statusPage api.StatusPage) error

func (*DbClient) SeedStatusPages

func (d *DbClient) SeedStatusPages() error

func (*DbClient) UpdateStatusPage

func (d *DbClient) UpdateStatusPage(ctx context.Context, statusPage api.StatusPage) error

Jump to

Keyboard shortcuts

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