types

package
v0.0.0-...-c528fcf Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Street      string `json:"street,omitempty"`
	Number      int32  `json:"number,omitempty"`
	City        string `json:"city,omitempty"`
	PostalCode  string `json:"postal_code,omitempty" bson:"postal_code"`
	CountryCode string `json:"country_code,omitempty" bson:"country_code"`
}

type Coordinates

type Coordinates struct {
	Latitude  float64 `json:"lat,omitempty" validate:"number"`
	Longitude float64 `json:"lng,omitempty" validate:"number"`
}

type CreateLocationRequest

type CreateLocationRequest struct {
	Name        string `json:"name" validate:"required,min=5"`
	CreatedBy   string
	Coordinates *Coordinates `json:"coordinates" validate:"required"`
	Address     *Address     `json:"address"`
}

type FindLocationsRequest

type FindLocationsRequest struct {
	PostalCode string
	City       string
	Limit      int
	Offset     int
}

type GeoJSONPoint

type GeoJSONPoint struct {
	Type        string     `bson:"type" json:"type"`
	Coordinates [2]float64 `bson:"coordinates" json:"coordinates"`
}

type Location

type Location struct {
	ID        primitive.ObjectID `bson:"_id,omitempty" json:"id"`
	Name      string             `bson:"name" json:"name"`
	Address   *Address           `bson:"address" json:"address"`
	Geometry  *GeoJSONPoint      `bson:"geometry" json:"geometry,omitempty"`
	CreatedBy string             `bson:"created_by" json:"-"`
	CreatedAt time.Time          `bson:"created_at" json:"created_at"`
	UpdatedAt time.Time          `bson:"updated_at" json:"updated_at"`
}

func (*Location) MarshalBSON

func (l *Location) MarshalBSON() ([]byte, error)

type LookupLocationRequest

type LookupLocationRequest struct {
	*Coordinates
	MaxDistance int `json:"max_distance"`
}

type PaginationRequest

type PaginationRequest struct {
	Limit  string `query:"limit"`
	Offset string `query:"offset"`
}

type Response

type Response struct {
	Data interface{} `json:"data"`
}

type ResponseMeta

type ResponseMeta struct {
	Count int64 `json:"count"`
}

type ResponseWithPagination

type ResponseWithPagination struct {
	Response
	Meta ResponseMeta `json:"_meta"`
}

Jump to

Keyboard shortcuts

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