persistence

package
v0.0.0-...-bc0ddd8 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const ParamPoolSize = paramPrefix + "poolSize"

Variables

This section is empty.

Functions

func Close

func Close()

func GetConnection

func GetConnection(ctx context.Context) *sql.DB

func Middleware

func Middleware(selector SelectorFunc) func(http.Handler) http.Handler

func Migrate

func Migrate(dbUrl string) error

func Setup

func Setup(dbUrls []NamedUrl) error

func WithConnection

func WithConnection(ctx context.Context, dbName string) (context.Context, error)

Types

type NamedUrl

type NamedUrl struct {
	Name string
	Url  *url.URL
}

func (NamedUrl) StrippedUrl

func (nu NamedUrl) StrippedUrl() *url.URL

StrippedUrl returns a copy of the URL with all query parameters starting with "_x-" removed.

type SelectorFunc

type SelectorFunc func(r *http.Request) string

Jump to

Keyboard shortcuts

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