hswaw/site: add spaceapi
Change-Id: I81b223981c47ccdbfc8fe637e2f0cc11fce8c317
diff --git a/hswaw/site/calendar/BUILD.bazel b/hswaw/site/calendar/BUILD.bazel
index 297fde3..fcdac53 100644
--- a/hswaw/site/calendar/BUILD.bazel
+++ b/hswaw/site/calendar/BUILD.bazel
@@ -3,12 +3,12 @@
go_library(
name = "go_default_library",
srcs = [
- "load.go",
"event.go",
+ "load.go",
"time.go",
],
importpath = "code.hackerspace.pl/hscloud/hswaw/site/calendar",
- visibility = ["//visibility:private"],
+ visibility = ["//hswaw/site:__subpackages__"],
deps = [
"@com_github_arran4_golang_ical//:go_default_library",
"@com_github_golang_glog//:go_default_library",
diff --git a/hswaw/site/calendar/load.go b/hswaw/site/calendar/load.go
index 5ea9198..5b36b9c 100644
--- a/hswaw/site/calendar/load.go
+++ b/hswaw/site/calendar/load.go
@@ -14,8 +14,8 @@
)
const (
- // eventsURL is the calendar from which we load public Hackerspace events.
- eventsURL = "https://owncloud.hackerspace.pl/remote.php/dav/public-calendars/g8toktZrA9fyAHNi/?export"
+ // EventsURL is the calendar from which we load public Hackerspace events.
+ EventsURL = "https://owncloud.hackerspace.pl/remote.php/dav/public-calendars/g8toktZrA9fyAHNi/?export"
)
// eventsBySooner sorts upcoming events so the one that happens the soonest
@@ -107,13 +107,13 @@
// relative to the given time 'now' as per the Warsaw Hackerspace public
// calender (from owncloud.hackerspace.pl).
func GetUpcomingEvents(ctx context.Context, now time.Time) ([]*UpcomingEvent, error) {
- r, err := http.NewRequestWithContext(ctx, "GET", eventsURL, nil)
+ r, err := http.NewRequestWithContext(ctx, "GET", EventsURL, nil)
if err != nil {
- return nil, fmt.Errorf("NewRequest(%q): %w", eventsURL, err)
+ return nil, fmt.Errorf("NewRequest(%q): %w", EventsURL, err)
}
res, err := http.DefaultClient.Do(r)
if err != nil {
- return nil, fmt.Errorf("Do(%q): %w", eventsURL, err)
+ return nil, fmt.Errorf("Do(%q): %w", EventsURL, err)
}
defer res.Body.Close()
return parseUpcomingEvents(now, res.Body)