config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Attach

func Attach(ctx context.Context, cfg Config) context.Context

func Load

func Load(ctx context.Context, path string) (context.Context, error)

func Merge

func Merge(ctx context.Context, src Config) (context.Context, error)

func MergeFlags

func MergeFlags(ctx context.Context, flags *pflag.FlagSet) (context.Context, error)

Types

type Config

type Config struct {
	Prefix string `json:",omitempty"`

	Connection ConnectionConfig
	Migration  MigrationConfig
}

func FromContext

func FromContext(ctx context.Context) Config

type ConnectionConfig

type ConnectionConfig struct {
	URI      string `json:",omitempty"`
	Database string `json:",omitempty"`
}

type MigrationConfig

type MigrationConfig struct {
	Directory string `json:",omitempty"`
	Format    string `json:",omitempty"`
	Command   string `json:",omitempty"`
}

Jump to

Keyboard shortcuts

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