postgres

package
v0.0.0-...-22e5c7f Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2021 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 Client

type Client struct {
	DB *sql.DB
}

Client represents the postgres client.

func NewClient

func NewClient(dataSource string, maxConnections int) (*Client, error)

NewClient returns a postgres database client to interact with.

func (*Client) CodeAlreadyExists

func (c *Client) CodeAlreadyExists(code string) (bool, error)

CodeAlreadyExists searches for the existence of an entry.

func (*Client) CreateScrap

func (c *Client) CreateScrap(ss scrapmon.Scrap) (int, error)

CreateScrap saves a Scrap's info in the database.

func (*Client) GetLatestCreatedScrapCode

func (c *Client) GetLatestCreatedScrapCode() (*string, error)

func (*Client) GetScrapByCode

func (c *Client) GetScrapByCode(code string) (*scrapmon.Scrap, error)

GetScrapByCode Gets a scrapped Scrap from the database

func (*Client) Purge

func (c *Client) Purge() error

func (*Client) UpdateScrapByCode

func (c *Client) UpdateScrapByCode(ss scrapmon.Scrap) error

func (*Client) UpdateScrapStatusByCode

func (c *Client) UpdateScrapStatusByCode(code string, status scrapmon.ScrapStatus) error

Jump to

Keyboard shortcuts

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