sql

package
v0.0.0-...-c3b95e6 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: Apache-2.0 Imports: 18 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 MySQL

type MySQL struct {
	NetworkDB

	SSL SSL `json:"ssl" yaml:"ssl"`
	// contains filtered or unexported fields
}

MySQL options for creating a MySQL db.

func (*MySQL) Open

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

Open creates a new storage implementation backed by MySQL.

type NetworkDB

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

	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
}

NetworkDB contains options common to SQL databases accessed over network.

type Postgres

type Postgres struct {
	NetworkDB

	SSL SSL `json:"ssl" yaml:"ssl"`
}

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 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

type SSL

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

SSL represents SSL options for network databases.

Jump to

Keyboard shortcuts

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