helper

package
v0.0.0-...-e2ae35c Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONMarshal

func JSONMarshal(t interface{}) ([]byte, error)

JSONMarshal encodes

func OperatePoints

func OperatePoints()

OperatePoints parsing data from csv

Types

type Address

type Address struct {
	City        string `bson:"city" json:"city"`
	Name        string `bson:"name" json:"name"`
	Description string `bson:"description" json:"description"`
}

Address struct

func NewAddress

func NewAddress(city, name, description string) *Address

NewAddress new exemplar

type Cash

type Cash struct {
	Type       *CodeName   `bson:"type" json:"type"`
	Currencies *Currencies `bson:"currencies" json:"currencies"`
}

Cash struct

func NewCash

func NewCash(row []string) *Cash

NewCash creates cash object

type CodeName

type CodeName struct {
	Code string `bson:"code" json:"code"`
	Name string `bson:"name" json:"name"`
}

CodeName struct

type Currencies

type Currencies struct {
	In  []CodeName `bson:"in" json:"in"`
	Out []CodeName `bson:"out" json:"out"`
}

Currencies struct

type ListOfPoint

type ListOfPoint struct {
	List []Point `json:"list"`
}

ListOfPoint struct

type Location

type Location struct {
	Type        string    `bson:"type" json:"type"`
	Coordinates []float64 `bson:"coordinates" json:"coordinates"`
	Distance    float64   `bson:"distance" json:"distance"`
}

Location struct

func NewLocation

func NewLocation(locType, coordinates string) *Location

NewLocation locations

type Point

type Point struct {
	ID        bson.ObjectId `bson:"_id" json:"_id"`
	Code      string        `bson:"code" json:"code"`
	Name      string        `bson:"name" json:"name"`
	Address   *Address      `bson:"address" json:"address"`
	Cash      *Cash         `bson:"cash" json:"cash"`
	Issuer    *CodeName     `bson:"issuer" json:"issuer"`
	Location  *Location     `bson:"location" json:"location"`
	Type      *CodeName     `bson:"type" json:"type"`
	Schedules []*Schedule   `bson:"schedules" json:"schedules"`
	IsNew     bool          `bson:"-" json:"isNew"`
}

Point model

func NewPoint

func NewPoint(row []string) *Point

NewPoint function returns new point

type Schedule

type Schedule struct {
	Type        CodeName  `bson:"type" json:"type"`
	WorkingMode CodeName  `bson:"workingMode" json:"workingMode"`
	Workdays    []WorkDay `bson:"workdays" json:"workdays"`
}

Schedule struct

func NewSchedule

func NewSchedule(row []string) *Schedule

NewSchedule returns schedule

type WorkDay

type WorkDay struct {
	DayOfWeek string `bson:"dayOfWeek" json:"dayOfWeek"`
	IsHoliday bool   `bson:"isHoliday" json:"isHoliday"`
	OpensAt   string `bson:"opensAt,omitempty" json:"opensAt,omitempty"`
	ClosesAt  string `bson:"closesAt,omitempty" json:"closesAt,omitempty"`
}

WorkDay struct

func GetWorkDays

func GetWorkDays(row []string) (workDays []WorkDay, workingTime string)

GetWorkDays calc working days

Jump to

Keyboard shortcuts

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