backend

package
v0.0.0-...-c783a93 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package core implements the core backend service for the app

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthTokenHandler

func AuthTokenHandler(w http.ResponseWriter, r *http.Request)

AuthTokenHandler verifies the passed token with firebase returns a user object as a JSON if succcessful

func StatusHandler

func StatusHandler(w http.ResponseWriter, r *http.Request)

StatusHandler is used for debugging the app as an admin

Types

type AppError

type AppError struct {
	Error   error
	Message string
	Code    int
}

AppError xports type for a Handler errors

func AddSubs

func AddSubs(w http.ResponseWriter, r *http.Request) *AppError

AddSubs retrieves subscriptions for a given user

func DelSubs

func DelSubs(w http.ResponseWriter, r *http.Request) *AppError

DelSubs retrieves subscriptions for a given user

func GetNotifications

func GetNotifications(w http.ResponseWriter, r *http.Request) *AppError

GetNotifications retrieves notifications sent for a given user

func GetRepos

func GetRepos(w http.ResponseWriter, r *http.Request) *AppError

GetRepos retrieves open issue counts for repositories that a user subscribes to

func GetSubs

func GetSubs(w http.ResponseWriter, r *http.Request) *AppError

GetSubs retrieves subscriptions for a given user

func UpdateSub

func UpdateSub(w http.ResponseWriter, r *http.Request) *AppError

UpdateSub updates subscriptions for a given user

func UserAdd

func UserAdd(w http.ResponseWriter, r *http.Request) *AppError

UserAdd handles creation of a new user

func UserGet

func UserGet(w http.ResponseWriter, r *http.Request) *AppError

UserGet retrieves a given user from the request

func UserUpdate

func UserUpdate(w http.ResponseWriter, r *http.Request) *AppError

UserUpdate updates a user's preferences

type GetHandler

type GetHandler func(http.ResponseWriter, *http.Request) *AppError

GetHandler wraps a handler func with error handling logic http://blog.golang.org/error-handling-and-go

func (GetHandler) ServeHTTP

func (fn GetHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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