goosex

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: Apache-2.0 Imports: 7 Imported by: 9

Documentation

Overview

Package goosex provides shared functions used with goose to help reduce code duplication. This provides the ability to import the migrate command into individual applications and run migrations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MigrateUp added in v0.0.12

func MigrateUp(uri string, fsys fs.FS)

MigrateUp will run migrations and is provided as an easy way to ensure migrations are ran in test suites

func RegisterCobraCommand

func RegisterCobraCommand(cmd *cobra.Command, setupFunc func())

RegisterCobraCommand will add a migrate command to the cobra command provided that provides a wrapper for running goose commands.

func SetBaseFS

func SetBaseFS(fsys fs.FS)

SetBaseFS accepts an embedded golang filesystem and sets that as the location for goose migration files.

func SetDBURI

func SetDBURI(uri string)

SetDBURI accepts a URI and saves it for use by goose during migrations

func SetLogger

func SetLogger(l *zap.SugaredLogger)

SetLogger accepts a zap logger and sets it as the logger for goose output

Types

This section is empty.

Jump to

Keyboard shortcuts

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