division

package
v0.0.0-...-c2300e3 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package division ...

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("division not found")
)

Set of error variables for CRUD operations.

Functions

This section is empty.

Types

type Core

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

func NewCore

func NewCore(log *logger.Logger, store Storer) *Core

func (*Core) QueryByID

func (c *Core) QueryByID(ctx context.Context, divisionID int) (Division, error)

func (*Core) QueryByParentID

func (c *Core) QueryByParentID(ctx context.Context, id int) ([]Division, error)

func (*Core) QueryProvinces

func (c *Core) QueryProvinces(ctx context.Context) ([]Division, error)

type Division

type Division struct {
	ID       int
	ParentID int
	Code     int
	Level    uint8
	Name     string
}

type Storer

type Storer interface {
	QueryByID(ctx context.Context, id int) (Division, error)
	QueryByParentID(ctx context.Context, id int) ([]Division, error)
	QueryLevel1s(ctx context.Context) ([]Division, error)
}

Directories

Path Synopsis
stores
divisionjson
Package divisionjson ...
Package divisionjson ...

Jump to

Keyboard shortcuts

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