models

package
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2022 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const URL_SERVICE = "https://nominatim.openstreetmap.org/reverse?lat=%s&lon=%s&format=jsonv2"

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	Index    string      `json:"index"`
	NamePlug string      `json:"plug"`
	Coord    *GeoCoord   `json:"coord"`
	Loc      *Location   `json:"location"`
	Body     interface{} `json:"body"`
}

func ToData

func ToData(data map[string]interface{}) (*Data, error)

type GClient

type GClient struct {
	Srv *gmail.Service

	Email  string
	Config oauth2.Config
	Token  oauth2.Token
}

type GData

type GData struct {
	ContentType             string
	ContentTransferEncoding string
	Name                    string
	Data                    string
}

type GeoCoord

type GeoCoord struct {
	Latitude  string `json:"lat"`
	Longitude string `json:"lon"`
}

type GmailClients

type GmailClients struct {
	Clients []*GClient
}

func InitSmtpClients

func InitSmtpClients(config *configuration.Config) (*GmailClients, error)

func (*GmailClients) SendInSequence

func (clients *GmailClients) SendInSequence(to string, data []*GData) error

type Location

type Location struct {
	Coord       *GeoCoord `json:"coord"`
	Country     string    `json:"country"`
	CountryCode string    `json:"country_code"`
	State       string    `json:"state"`
	City        string    `json:"city"`
}

func GetLocation

func GetLocation(coord *GeoCoord) (*Location, error)

func (*Location) GetPath

func (location *Location) GetPath() string

Jump to

Keyboard shortcuts

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