...

Package pkgerx

import "github.com/ory/x/pkgerx"
Overview
Index

Overview ▾

Variables

var SQLTemplateFuncs = map[string]interface{}{
    "identifier": Identifier,
}

func Identifier

func Identifier(i string) (string, error)

func MustRead

func MustRead(f pkging.File, err error) []byte

MustRead reads a pkging.File or panics.

func Read

func Read(f pkging.File, err error) ([]byte, error)

Read reads a pkging.File or returns an error

func WithMigrationContentMiddleware

func WithMigrationContentMiddleware(middleware func(content string, err error) (string, error)) func(*MigrationBox) *MigrationBox

func WithTemplateValues

func WithTemplateValues(v map[string]interface{}) func(*MigrationBox) *MigrationBox

type MigrationBox

MigrationBox is a wrapper around pkger.Dir and Migrator. This will allow you to run migrations from migrations packed inside of a compiled binary.

type MigrationBox struct {
    pop.Migrator

    Dir pkger.Dir
    // contains filtered or unexported fields
}

func NewMigrationBox

func NewMigrationBox(dir pkger.Dir, c *pop.Connection, l *logrusx.Logger, opts ...func(*MigrationBox) *MigrationBox) (*MigrationBox, error)

NewMigrationBox from a packr.Dir and a Connection.

migrations, err := NewMigrationBox(pkger.Dir("/migrations"))

type MigrationContent

type MigrationContent func(mf pop.Migration, c *pop.Connection, r io.Reader, usingTemplate bool) (string, error)