seedlingtest

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRegistry

func NewRegistry() *seedling.Registry

func RegisterBasic

func RegisterBasic(tb testing.TB, reg *seedling.Registry, inserters BasicInserters)

func RegisterCompositePK

func RegisterCompositePK(tb testing.TB, reg *seedling.Registry, inserters CompositePKInserters)

func RegisterHasMany

func RegisterHasMany(tb testing.TB, reg *seedling.Registry, inserters HasManyInserters)

func RegisterManyToMany

func RegisterManyToMany(tb testing.TB, reg *seedling.Registry, inserters ManyToManyInserters)

Types

type Article

type Article struct {
	ID    int
	Title string
}

type ArticleTag

type ArticleTag struct {
	ArticleID int
	TagID     int
}

type BasicInserters

type BasicInserters struct {
	Company func(context.Context, seedling.DBTX, Company) (Company, error)
	User    func(context.Context, seedling.DBTX, User) (User, error)
	Project func(context.Context, seedling.DBTX, Project) (Project, error)
	Task    func(context.Context, seedling.DBTX, Task) (Task, error)
}

func DefaultBasicInserters

func DefaultBasicInserters(ids *IDSequence) BasicInserters

type Company

type Company struct {
	ID   int
	Name string
}

type CompositePKInserters

type CompositePKInserters struct {
	Region     func(context.Context, seedling.DBTX, Region) (Region, error)
	Deployment func(context.Context, seedling.DBTX, Deployment) (Deployment, error)
}

func DefaultCompositePKInserters

func DefaultCompositePKInserters(ids *IDSequence) CompositePKInserters

type Department

type Department struct {
	ID   int
	Name string
}

type Deployment

type Deployment struct {
	ID           int
	RegionCode   string
	RegionNumber int
	Name         string
}

type Employee

type Employee struct {
	ID           int
	DepartmentID int
	Name         string
}

type HasManyInserters

type HasManyInserters struct {
	Department func(context.Context, seedling.DBTX, Department) (Department, error)
	Employee   func(context.Context, seedling.DBTX, Employee) (Employee, error)
}

func DefaultHasManyInserters

func DefaultHasManyInserters(ids *IDSequence) HasManyInserters

type IDSequence

type IDSequence struct {
	// contains filtered or unexported fields
}

func NewIDSequence

func NewIDSequence() *IDSequence

func (*IDSequence) Next

func (s *IDSequence) Next() int

type InterfaceModel

type InterfaceModel struct {
	ID       int
	Name     string
	Metadata any
}

type ManyToManyInserters

type ManyToManyInserters struct {
	Article    func(context.Context, seedling.DBTX, Article) (Article, error)
	Tag        func(context.Context, seedling.DBTX, Tag) (Tag, error)
	ArticleTag func(context.Context, seedling.DBTX, ArticleTag) (ArticleTag, error)
}

func DefaultManyToManyInserters

func DefaultManyToManyInserters(ids *IDSequence) ManyToManyInserters

type Project

type Project struct {
	ID        int
	CompanyID int
	Name      string
}

type PtrModel

type PtrModel struct {
	ID       int
	Name     *string
	Optional *int
}

type Region

type Region struct {
	Code   string
	Number int
	Name   string
}

type Tag

type Tag struct {
	ID   int
	Name string
}

type Task

type Task struct {
	ID             int
	ProjectID      int
	AssigneeUserID int
	Title          string
	Status         string
}

type User

type User struct {
	ID        int
	CompanyID int
	Name      string
}

Jump to

Keyboard shortcuts

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