seeder

package module
v0.0.0-...-9af63f3 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	File       string `yaml:"file"`
	SQL        string `yaml:"sql"`
	Key        string `yaml:"key"`
	Bucket     string `yaml:"bucket"`
	ObjectName string `yaml:"object-name"`
	Option     Option `yaml:"option"`
}

type HelpFunc

type HelpFunc func(w io.Writer)

type IRegistry

type IRegistry interface {
	ListKnownTypes() []string
	RegisterSeeder(s SeedFunc, type_ string)
	RegisterSeederHelp(f HelpFunc, type_ string)
	RunSeeder(ctx context.Context, type_ string, cfg Config) error
	ShowSeederHelp(type_ string, w io.Writer)
}

func DefaultRegistry

func DefaultRegistry() IRegistry

type Option

type Option struct {
	ContentType     string `yaml:"content-type"`
	ContentEncoding string `yaml:"content-encoding"`
}

type SeedFunc

type SeedFunc func(ctx context.Context, cfg Config) error

type Seeder

type Seeder struct {
	State []State
}

type Spec

type Spec struct {
	Seeder Seeder `yaml:"seeder"`
}

type State

type State struct {
	Name   string `yaml:"name"`
	Type   string `yaml:"type"`
	Config []Config
}

Directories

Path Synopsis
cmd
internal
s3

Jump to

Keyboard shortcuts

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