db

package
v0.0.0-...-41663d2 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DomainSummary

type DomainSummary struct {
	Domain         string
	PositionsCount int
}

DomainSummary represents a total number of positions for domain.

type Position

type Position struct {
	URL      string  `db:"url" json:"url"`
	Position int     `db:"position" json:"position"`
	Keyword  string  `db:"keyword" json:"keyword"`
	Volume   int     `db:"volume" json:"volume"`
	Results  int     `db:"results" json:"results"`
	CPC      float64 `db:"cpc" json:"cpc"`
	Updated  string  `db:"updated" json:"updated"`
}

Position represents a single domain's position.

type PositionRepo

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

PositionRepo represents a data access layer to 'position' table.

func NewPositionRepo

func NewPositionRepo(log *zap.Logger, conn *sqlx.DB) *PositionRepo

NewPositionRepo returns new instance of PositionRepo.

func (*PositionRepo) GetPositions

func (pr *PositionRepo) GetPositions(ctx context.Context, domain, orderBy string, limit, offset int) ([]*Position, error)

GetPositions returns a slice of positions for the given domain.

func (*PositionRepo) GetSummary

func (pr *PositionRepo) GetSummary(ctx context.Context, domain string) (int, error)

GetSummary returns a total number of positions for the given domain.

Jump to

Keyboard shortcuts

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