fixtures

package
v0.0.0-...-0ad5b3e Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Faker

type Faker struct {
	*gofakeit.Faker
	// contains filtered or unexported fields
}

func NewFaker

func NewFaker(passwordEncoder password.Encoder) *Faker

func (*Faker) DateUnix

func (f *Faker) DateUnix() interface{}

func (*Faker) GenerateBookmarks

func (*Faker) GenerateBookmarks(prefix string, count int) []string

func (*Faker) GenerateExdates

func (*Faker) GenerateExdates(count int) interface{}

GenerateExdates

func (*Faker) JWT

func (f *Faker) JWT() (string, error)

func (*Faker) NowUnix

func (*Faker) NowUnix() interface{}

func (*Faker) NowUnixAdd

func (*Faker) NowUnixAdd(dStr string) (interface{}, error)

func (*Faker) ObjectID

func (*Faker) ObjectID() interface{}

func (*Faker) Password

func (f *Faker) Password(password string) (string, error)

func (*Faker) ResetUniqueName

func (f *Faker) ResetUniqueName()

func (*Faker) ToObjectID

func (*Faker) ToObjectID(s string) interface{}

ToObjectID converts a string of hex digits to a MongoDB ObjectId

func (*Faker) UniqueName

func (f *Faker) UniqueName() (string, error)

type Loader

type Loader interface {
	Load(ctx context.Context) error
	Clean(ctx context.Context) error
}

func NewLoader

func NewLoader(
	client mongo.DbClient,
	dirs []string,
	parser Parser,
	logger zerolog.Logger,
) Loader

func NewLoaderWithKeepData

func NewLoaderWithKeepData(
	client mongo.DbClient,
	dirs []string,
	parser Parser,
	logger zerolog.Logger,
) Loader

type Parser

type Parser interface {
	Parse(content []byte) (map[string][]interface{}, error)
}

func NewParser

func NewParser(faker *Faker) Parser

Jump to

Keyboard shortcuts

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