postgres

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

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

Go to latest
Published: Jan 26, 2023 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultURL = "postgres://localhost:5432/ledger"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DebugHook

type DebugHook struct{}

func (DebugHook) AfterQuery

func (DebugHook) AfterQuery(ctx context.Context, event *pg.QueryEvent) error

func (DebugHook) BeforeQuery

func (DebugHook) BeforeQuery(ctx context.Context, event *pg.QueryEvent) (context.Context, error)

type Postgres

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

func Connect

func Connect(opt *pg.Options) (*Postgres, error)

Connect parses a database URL into options that can be used to connect to PostgreSQL.

func (*Postgres) Check

func (p *Postgres) Check(ctx context.Context) error

func (*Postgres) Insert

func (p *Postgres) Insert(ctx context.Context, token ledger.Token) error

type SecretToken

type SecretToken struct {
	Data ledger.Token `pg:"data,pk"`
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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