sql

package
v0.0.0-...-b3d0198 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package sql provides SQL implementations of the storage interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Postgres

type Postgres struct {
	Database string
	User     string
	Password string
	Host     string
	Port     uint16

	SSL PostgresSSL `json:"ssl" yaml:"ssl"`

	ConnectionTimeout int // Seconds

	// database/sql tunables, see
	// https://golang.org/pkg/database/sql/#DB.SetConnMaxLifetime and below
	// Note: defaults will be set if these are 0
	MaxOpenConns    int // default: 5
	MaxIdleConns    int // default: 5
	ConnMaxLifetime int // Seconds, default: not set
}

Postgres options for creating an SQL db.

func (*Postgres) Open

func (p *Postgres) Open(logger log.Logger) (storage.Storage, error)

Open creates a new storage implementation backed by Postgres.

type PostgresSSL

type PostgresSSL struct {
	Mode   string
	CAFile string
	// Files for client auth.
	KeyFile  string
	CertFile string
}

PostgresSSL represents SSL options for Postgres databases.

type SQLite3

type SQLite3 struct {
	// File to
	File string `json:"file"`
}

SQLite3 options for creating an SQL db.

func (*SQLite3) Open

func (s *SQLite3) Open(logger log.Logger) (storage.Storage, error)

Open creates a new storage implementation backed by SQLite3

Jump to

Keyboard shortcuts

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