infra

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTx

func GetTx(ctx context.Context) (*sqlx.Tx, bool)

func NewDb

func NewDb() (*sqlx.DB, error)

Types

type TrancoAPIImpl added in v0.0.2

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

func NewTrancoAPIImpl added in v0.0.2

func NewTrancoAPIImpl() *TrancoAPIImpl

func (TrancoAPIImpl) GetIDByDate added in v0.0.2

func (t TrancoAPIImpl) GetIDByDate(date time.Time) (tranco.ListMetadata, error)

type TrancoCsvImpl

type TrancoCsvImpl struct {
}

func NewTrancoCsvImpl

func NewTrancoCsvImpl() *TrancoCsvImpl

func (TrancoCsvImpl) Get

func (t TrancoCsvImpl) Get(url url.URL) ([]model.SiteRanking, error)

type TrancoDailyRankRepositoryImpl

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

func NewTrancoDailyRankRepositoryImpl

func NewTrancoDailyRankRepositoryImpl(db util.Crudable) *TrancoDailyRankRepositoryImpl

func (TrancoDailyRankRepositoryImpl) GetDailyRanksByDateRange

func (t TrancoDailyRankRepositoryImpl) GetDailyRanksByDateRange(ctx context.Context, domain string, start time.Time, end time.Time) ([]model.DailyRank, error)

type TrancoDomainRepositoryImpl

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

func NewTrancoDomainRepositoryImpl

func NewTrancoDomainRepositoryImpl(db *sqlx.DB) *TrancoDomainRepositoryImpl

func (TrancoDomainRepositoryImpl) GetIDByDomain added in v0.0.2

func (t TrancoDomainRepositoryImpl) GetIDByDomain(ctx context.Context, domain string) (int, error)

func (TrancoDomainRepositoryImpl) Save

func (t TrancoDomainRepositoryImpl) Save(ctx context.Context, domain string) (int, error)

type TrancoListRepositoryImpl

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

func NewTrancoListRepositoryImpl

func NewTrancoListRepositoryImpl(db *sqlx.DB) *TrancoListRepositoryImpl

func (TrancoListRepositoryImpl) DeleteByID added in v0.0.2

func (t TrancoListRepositoryImpl) DeleteByID(ctx context.Context, id string) error

func (TrancoListRepositoryImpl) ExistsID added in v0.0.2

func (t TrancoListRepositoryImpl) ExistsID(ctx context.Context, id string) (bool, error)

func (TrancoListRepositoryImpl) FindByCreatedOnLessThan added in v0.0.2

func (t TrancoListRepositoryImpl) FindByCreatedOnLessThan(ctx context.Context, date time.Time) ([]model.TrancoList, error)

func (TrancoListRepositoryImpl) Save

type TrancoRankingsRepositoryImpl

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

func NewTrancoRankingsRepositoryImpl

func NewTrancoRankingsRepositoryImpl(batchSize int, db util.Crudable) *TrancoRankingsRepositoryImpl

func (TrancoRankingsRepositoryImpl) BulkSave

func (TrancoRankingsRepositoryImpl) DeleteByListID added in v0.0.2

func (t TrancoRankingsRepositoryImpl) DeleteByListID(ctx context.Context, listID string) error

func (TrancoRankingsRepositoryImpl) Save

type Tx

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

func NewTransaction

func NewTransaction(db *sqlx.DB) *Tx

func (*Tx) DoInTx

func (t *Tx) DoInTx(ctx context.Context, f func(ctx context.Context) (interface{}, error)) (interface{}, error)

Jump to

Keyboard shortcuts

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