polygon

package
v0.0.0-...-fb5fdcc Latest Latest
Warning

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

Go to latest
Published: Dec 14, 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 Inquirer

type Inquirer interface {
	Limit(limit int)
	Offset(offset int)
	Order(order ...string)
	IDEQ(id int)
	IDIn(ids ...int)
	RegionIDEQ(regionID string)
}

type Polygon

type Polygon struct {
	ID       int
	RegionID string
	Lng      float64
	Lat      float64
}

type PolygonRepo

type PolygonRepo interface {
	Count(ctx context.Context, options ...Query) int
	FindList(ctx context.Context, options ...Query) ([]*Polygon, error)
	FindOne(ctx context.Context, options ...Query) (*Polygon, error)
	Save(ctx context.Context, data *Polygon) (*Polygon, error)
	Remove(ctx context.Context, options ...Query) error
	Truncate(ctx context.Context) error
}

type PolygonUsecase

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

func NewPolygonUsecase

func NewPolygonUsecase(repo PolygonRepo) *PolygonUsecase

func (*PolygonUsecase) FindOne

func (a *PolygonUsecase) FindOne(ctx context.Context, id int) (*Polygon, error)

func (*PolygonUsecase) FindOneWithInstance

func (a *PolygonUsecase) FindOneWithInstance(ctx context.Context, queries ...Query) (*Polygon, error)

func (*PolygonUsecase) List

func (a *PolygonUsecase) List(ctx context.Context) ([]*Polygon, error)

func (*PolygonUsecase) Remove

func (a *PolygonUsecase) Remove(ctx context.Context) error

func (*PolygonUsecase) Save

func (a *PolygonUsecase) Save(ctx context.Context, data *Polygon) (*Polygon, error)

func (*PolygonUsecase) Truncate

func (a *PolygonUsecase) Truncate(ctx context.Context) error

type Query

type Query func(Inquirer)

func Cache

func Cache(ttl int) Query

func IDEQ

func IDEQ(id int) Query

func IDIn

func IDIn(ids ...int) Query

func Limit

func Limit(limit int) Query

func Offset

func Offset(offset int) Query

func Order

func Order(orders ...string) Query

func RegionIDEQ

func RegionIDEQ(regionID string) Query

Jump to

Keyboard shortcuts

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