You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
522 B
Go
34 lines
522 B
Go
package plugin
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
gogeouri "git.jlel.se/jlelse/go-geouri"
|
|
"go.goblog.app/app/pkgs/plugintypes"
|
|
)
|
|
|
|
func GetPlugin() plugintypes.Exec {
|
|
return &plugin{}
|
|
}
|
|
|
|
type plugin struct {
|
|
}
|
|
|
|
func (p *plugin) SetApp(_ plugintypes.App) {
|
|
// Ignore
|
|
}
|
|
|
|
func (*plugin) SetConfig(_ map[string]any) {
|
|
// Ignore
|
|
}
|
|
|
|
func (p *plugin) Exec() {
|
|
g, err := gogeouri.Parse("geo:37.786971,-122.399677")
|
|
if err != nil {
|
|
fmt.Println(err.Error())
|
|
return
|
|
}
|
|
fmt.Println("Lon: ", g.Longitude)
|
|
fmt.Println("Lat: ", g.Latitude)
|
|
}
|