metro

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FindManyReqItem

type FindManyReqItem struct {
	Name     string
	Line     string
	Distance float32
}

type FindManyResItem

type FindManyResItem struct {
	ID       primitive.ObjectID
	Distance float32
}

type Metro

type Metro struct {
	ID     primitive.ObjectID `bson:"_id,omitempty"`
	Slug   string             `bson:"s,omitempty"`
	AreaID primitive.ObjectID `bson:"a,omitempty"`
	Name   string             `bson:"n,omitempty"`
	Line   string             `bson:"l,omitempty"`
}

type Model

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

func NewModel

func NewModel(db *md.Database) Model

func (Model) FindMany

func (m Model) FindMany(
	ctx context.Context,
	areaID primitive.ObjectID,
	vals []FindManyReqItem,
) (
	res []FindManyResItem,
	err error,
)

func (Model) GetByIDs

func (m Model) GetByIDs(ctx context.Context, ids []primitive.ObjectID) (res []Metro, err error)

func (Model) GetBySlug

func (m Model) GetBySlug(ctx context.Context, slug string) (res Metro, err error)

Jump to

Keyboard shortcuts

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