Documentation ¶
Index ¶
- func CompleteRouterSetup(app *firebase.App) (handler http.Handler)
- func DeleteTrack(app *firebase.App, trackID string, uid string) (httpCode int, err error)
- func GetTrack(app *firebase.App, trackID string, uid string) (data []byte, err error)
- func GetTracks(app *firebase.App, query models.FirebaseQuery) (data []models.IgcMetadata, err error)
- func InsertTrackPoint(app *firebase.App, trackID string, uid string, data []models.TrackPoint) (updated models.IgcMetadata, err error)
- func ProcessUploadRequest(app *firebase.App, r *http.Request) (httpCode int, md models.IgcMetadata, err error)
- func TakeOwnership(app *firebase.App, trackID string, uid string) (own models.IgcMetadata, err error)
- func UpdatePrivacy(app *firebase.App, trackID string, uid string, newSetting bool) (updated models.IgcMetadata, err error)
- type Context
- type DbHandler
- type MuxRouteBinder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompleteRouterSetup ¶
CompleteRouterSetup Sets up all routing used by the backend, function public for tests wanting to do full E2E tests
func DeleteTrack ¶
DeleteTrack deletes the track from storage and firestore
func GetTracks ¶
func GetTracks(app *firebase.App, query models.FirebaseQuery) (data []models.IgcMetadata, err error)
GetTracks gets a list of IgcMetadata from Firebase based on query
func InsertTrackPoint ¶
func InsertTrackPoint(app *firebase.App, trackID string, uid string, data []models.TrackPoint) (updated models.IgcMetadata, err error)
InsertTrackPoint Inserts TrackPoint data for caching in the database
func ProcessUploadRequest ¶
func ProcessUploadRequest(app *firebase.App, r *http.Request) (httpCode int, md models.IgcMetadata, err error)
ProcessUploadRequest - Actual processing of the file upload Inspiration: https://astaxie.gitbooks.io/build-web-application-with-golang/content/en/04.5.html
func TakeOwnership ¶
func TakeOwnership(app *firebase.App, trackID string, uid string) (own models.IgcMetadata, err error)
TakeOwnership Takes ownership of a track owned by the ScraperUID
func UpdatePrivacy ¶
func UpdatePrivacy(app *firebase.App, trackID string, uid string, newSetting bool) (updated models.IgcMetadata, err error)
UpdatePrivacy Updates privacy setting to new variable
Types ¶
type Context ¶
type Context struct {
App *firebase.App
}
Context contains the Context of a Client session. Holds a instance of a firebase App.
type DbHandler ¶
type DbHandler struct { Ctx Context InsertTrack string GetTracks string GetTrack string DeleteTrack string UpdatePrivacy string TakeOwnership string InsertTrackPoint string }
DbHandler holds the context and routes for this handler.
type MuxRouteBinder ¶
MuxRouteBinder contains methods for binding routes to a router.