fnm

package
v0.0.0-...-074ee30 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ItemFilterSpec = []*data.FilterSpec{
	{Field: "name", Name: "Name", Type: data.FtProp},
	{Field: "description", Name: "Description", Type: data.FtProp},
	{Field: "created", Name: "Created", Type: data.FtProp},
	{Field: "updated", Name: "Updated", Type: data.FtProp},
}
View Source
var UserFilterSpec = []*data.FilterSpec{
	{Field: "name", Name: "Name", Type: data.FtProp},

	{Field: "status", Name: "Status", Type: data.FtProp},
}

Functions

func Commands

func Commands() []*cli.Command

func GenerateRandomFilter

func GenerateRandomFilter(
	gtx context.Context, dataType string) (*data.Filter, error)

func GetDataForRandomFilter

func GetDataForRandomFilter(
	gtx context.Context,
	dataType string,
	out any) error

func GetRandomFilter

func GetRandomFilter(
	gtx context.Context,
	dataType string,
	filterSpecs []*data.FilterSpec,
	filterValues *data.FilterValues) (*data.Filter, error)

func PgCreateFill

func PgCreateFill(gtx context.Context) error

Types

type FkItem

type FkItem struct {
	Id          int       `db:"id" fake:"skip"`
	Name        string    `db:"name" fake:"{name}"`
	Description string    `db:"description" fake:"{sentence:3}"`
	Created     time.Time `db:"created"`
	Updated     time.Time `db:"updated"`
}

type FkUser

type FkUser struct {
	Id        int              `db:"id" fake:"skip"`
	Name      string           `db:"name" fake:"{name}"`
	FirstName string           `db:"first_name" fake:"{firstname}"`
	LastName  string           `db:"last_name" fake:"{lastname}"`
	Email     string           `db:"email" fake:"{email}"`
	Age       int              `db:"age" fake:"{number:1,100}"`
	Tags      data.Vec[string] `db:"tags" fakesize:"2"`
	Status    string           `db:"status" fake:"{randomstring:[active,inactive]}"`
	Created   time.Time        `db:"created"`
	Updated   time.Time        `db:"updated"`
}

Jump to

Keyboard shortcuts

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