database

package
v0.0.0-...-cea2a68 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PostgresFromEnv

func PostgresFromEnv() (*sql.DB, error)

Types

type PostgresRepository

type PostgresRepository struct {
	DB *sql.DB
}

func (*PostgresRepository) ScrapeableProjects

func (r *PostgresRepository) ScrapeableProjects(workScore uint32, limit int) ([]*Project, error)

type Project

type Project struct {
	ID         string
	UserId     string
	ImportPath string
	WorkScore  int32
	Created    time.Time
	Paused     time.Time
}

type Scrape

type Scrape struct {
	ID        string
	Error     string
	WorkScore int32
	Started   time.Time
	Finished  time.Time
}

type User

type User struct {
	ID      string
	Email   string
	Created time.Time
}

type WorkerRepository

type WorkerRepository interface {
	// TODO(adam): docs, but the idea is:
	// - one transaction
	//   - grab N projects from `projects` table (by nonce) without 'started_at is not null and finished_at is null'
	//   - insert new rows into scrapes
	ScrapeableProjects(workScore uint32, limit int) ([]*Project, error)
}

Jump to

Keyboard shortcuts

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