data

package
v2.4.2-beta.3+incompat... Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CRUDResult

type CRUDResult struct {
	Name    string
	Success bool
	Error   string
}

type Coffee

type Coffee struct {
	Name    string
	Species string
	Regions string
	Comment string
}

type ConnURL

type ConnURL struct {
	DBName   string
	Host     string
	Password string
	Port     int
	SSL      string
	User     string
}

ConnURL creates a connection string URL for connecting to postgres.

func (*ConnURL) URL

func (c *ConnURL) URL() string

URL returns a connection string URL.

type DB

type DB struct {
	*sql.DB
}

DB returns a pointer to a sql.DB entity.

func NewDB

func NewDB(connURL string) (*DB, error)

NewDB returns a new database entity.

func (*DB) AddCoffee

func (db *DB) AddCoffee(c Coffee) error

func (*DB) AllCoffee

func (db *DB) AllCoffee() ([]Coffee, error)

func (*DB) AllExtensions

func (db *DB) AllExtensions() ([]Extension, error)

func (*DB) Coffee

func (db *DB) Coffee(name string) (Coffee, error)

func (*DB) CoffeeDeleteAll

func (db *DB) CoffeeDeleteAll() error

func (*DB) Databases

func (db *DB) Databases() ([]Database, error)

func (*DB) InitDDL

func (db *DB) InitDDL() error

func (*DB) InstalledExtensions

func (db *DB) InstalledExtensions() ([]Extension, error)

func (*DB) Roles

func (db *DB) Roles() ([]Role, error)

func (*DB) RunCRUD

func (db *DB) RunCRUD() []CRUDResult

func (*DB) Settings

func (db *DB) Settings() ([]Setting, error)

type Database

type Database struct {
	Name string
}

type Extension

type Extension struct {
	DefaultVersion   string
	InstalledVersion string
	Name             string
}

type Role

type Role struct {
	Name        string
	Super       bool
	Inherit     bool
	CreateRole  bool
	CreateDB    bool
	Login       bool
	ConnLimit   int
	Replication bool
	BypassRLS   bool
}

type Setting

type Setting struct {
	Name  string
	Value string
}

Jump to

Keyboard shortcuts

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