postgres

package
v0.0.0-...-121769d Latest Latest
Warning

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

Go to latest
Published: May 6, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package postgres provides an implementation of diag.Repository using PostgreSQL for underlying database storage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client implements diag.Repository.

func New

func New(dsn string) (*Client, error)

New returns a new Client.

func (*Client) Close

func (c *Client) Close() error

Close uses the underlying database client to close all connections.

func (*Client) FindAllDiagnosisKeys

func (c *Client) FindAllDiagnosisKeys(ctx context.Context) ([]byte, error)

FindAllDiagnosisKeys finds all the Diagnosis Keys and returns them in their binary representation in a buffer.

func (*Client) LastModified

func (c *Client) LastModified(ctx context.Context) (time.Time, error)

LastModified returns the timestamp of the latest uploaded Diagnosis Key.

func (*Client) Ping

func (c *Client) Ping() error

Ping uses the underlying database client to for check connectivity.

func (*Client) StoreDiagnosisKeys

func (c *Client) StoreDiagnosisKeys(ctx context.Context, diagKeys []diag.DiagnosisKey, uploadedAt time.Time) error

StoreDiagnosisKeys persists an array of diagnosis keys in the database.

Jump to

Keyboard shortcuts

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