repository

package
v0.0.0-...-67e434f Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Features

type Features interface {
	Repository[model.Feature]

	FindByPoint(ctx context.Context, p model.Point) (result *model.Feature, err error)
}

type Messages

type Messages interface {
	Repository[model.Message]

	FindByFeature(ctx context.Context, f *model.Feature, orderBy string) (result []*model.Message, err error)
}

type Repositories

type Repositories struct {
	Features
	Messages
}

type Repository

type Repository[T any] interface {
	Count(ctx context.Context) (count int64, err error)
	Delete(ctx context.Context, models ...*T) (rowsAffected int64, err error)
	Find(ctx context.Context, limit int, offset int, orderBy string) (result []*T, count int64, err error)
	FindByID(ctx context.Context, id string) (result *T, err error)
	FindByIDs(ctx context.Context, orderBy string, ids []string) (result []*T, err error)
	FindByMap(ctx context.Context, limit int, offset int, orderBy string, conditions map[string]interface{}) (result []*T, count int64, err error)
	FindByStruct(ctx context.Context, limit int, offset int, orderBy string, condition *T) (result []*T, count int64, err error)
	First(ctx context.Context, orderBy string) (result *T, err error)
	Last(ctx context.Context, orderBy string) (result *T, err error)
	Save(ctx context.Context, models ...*T) (rowsAffected int64, err error)
}

Jump to

Keyboard shortcuts

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