database

package
v0.0.0-...-8886596 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

func Open

func Open(path string, logger logger.Logger) (*Database, error)

func (*Database) Close

func (db *Database) Close() error

func (*Database) Find

func (db *Database) Find(holder interface{}, query string, args ...interface{}) ([]interface{}, error)

func (*Database) FindAllWires

func (db *Database) FindAllWires() ([]*WireModel, error)

func (*Database) GetConnection

func (db *Database) GetConnection() (*sql.Conn, error)

func (*Database) GetOrCreateIdentity

func (db *Database) GetOrCreateIdentity(name string) (*IdentityModel, error)

func (*Database) Insert

func (db *Database) Insert(model interface{}) error

func (*Database) Migrate

func (db *Database) Migrate() error

type IdentityModel

type IdentityModel struct {
	Id            string    `db:"id"`
	CreatedAt     time.Time `db:"created_at"`
	Name          string    `db:"name"`
	PrivateKey    []byte    `db:"private_key"`
	DisplayedName string    `db:"displayed_name"`
}

func (*IdentityModel) PreInsert

func (i *IdentityModel) PreInsert(s gorp.SqlExecutor) error

type WireModel

type WireModel struct {
	Id         string    `db:"id"`
	CreatedAt  time.Time `db:"created_at"`
	Name       string    `db:"name"`
	PrivateKey []byte    `db:"private_key"`
	OtpSecret  []byte    `db:"otp_secret"`
}

func (*WireModel) PreInsert

func (w *WireModel) PreInsert(s gorp.SqlExecutor) error

Jump to

Keyboard shortcuts

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