Skip to content

Intevation/najukoffer

 
 

Repository files navigation

README

Requirements

go get -u -v github.com/go-sql-driver/mysql
go get -u -v github.com/dgrijalva/jwt-go
go get -u -v github.com/go-sql-driver/mysql
go get -u -v github.com/joho/godotenv
go get -u -v github.com/paulmach/go.geojson
go get -u -v github.com/rs/cors

Building on file save

while inotifywait -e close_write *.go; do go build ; done

JWT

Generate token with jwt-generator

jwt-generator gen -s secret -u user
  • -s the secret / signingKey
  • -u the user to have for the token

Get data

curl -H "Token: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" localhost:3000/this_week

Build on save

while inotifywait -e close_write *.go; do go build ; done

mysql snippets

SELECT DATE_ADD(curdate(), INTERVAL 6 MONTH);
SELECT thema,DATE_FORMAT(von,'%d.%m.%Y %H:%i') as von,DATE_FORMAT(bis,'%d.%m.%Y %H:%i') as bis,typ,plz,ort,bundesland,beschreibung,eingetragen_von,eingetragen_von_kontakt,X,Y FROM dates_with_location WHERE date(von) between curdate() and DATE_ADD(curdate(), INTERVAL 6 MONTH);
SELECT thema,DATE_FORMAT(von,'%d.%m.%Y %H:%i') as von,DATE_FORMAT(bis,'%d.%m.%Y %H:%i') as bis,typ,plz,ort,bundesland,beschreibung,eingetragen_von,eingetragen_von_kontakt,X,Y FROM dates_with_location WHERE date(von) between curdate() and DATE_ADD(curdate(), INTERVAL 6 MONTH) and TYP REGEXP 'NAJU';
CREATE OR REPLACE VIEW next_6month AS SELECT thema,DATE_FORMAT(von,'%d.%m.%Y %H:%i') as von,DATE_FORMAT(bis,'%d.%m.%Y %H:%i') as bis,typ,plz,ort,bundesland,beschreibung,eingetragen_von,eingetragen_von_kontakt,X,Y FROM dates_with_location WHERE date(von) between curdate() and DATE_ADD(curdate(), INTERVAL 6 MONTH);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 99.5%
  • Shell 0.5%