rest

package
Version: v0.0.0-...-ca33a47 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2018 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompleteRouterSetup

func CompleteRouterSetup(app *firebase.App) (handler http.Handler)

CompleteRouterSetup Sets up all routing used by the backend, function public for tests wanting to do full E2E tests

func DeleteTrack

func DeleteTrack(app *firebase.App, trackID string, uid string) (httpCode int, err error)

DeleteTrack deletes the track from storage and firestore

func GetTrack

func GetTrack(app *firebase.App, trackID string, uid string) (data []byte, err error)

GetTrack gets a track file from the Firebase Storage based on TrackID in metadata

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.

func (DbHandler) Bind

func (dbHandler DbHandler) Bind(r *mux.Router)

Bind sets up the routes to the mux router.

type MuxRouteBinder

type MuxRouteBinder interface {
	Bind(r *mux.Router)
}

MuxRouteBinder contains methods for binding routes to a router.

Jump to

Keyboard shortcuts

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