platform

package
v0.9.12 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTask

func CreateTask(ctx context.Context, handler string, payload interface{}) (*taskspb.Task, error)

CreateTask is used to schedule a background task using the default queue. The payload can be any struct and will be marshalled into a json string.

func ErrorResponse

func ErrorResponse(c echo.Context, status int, err error) error

ErrorResponse reports the error and responds with an ErrorObject

func NewHttpContext

func NewHttpContext(c echo.Context) context.Context

NewHttpContext creates a new context for appengine execution FIXME make this more pluggable or change outright

func PageViewMiddleware

func PageViewMiddleware(next echo.HandlerFunc) echo.HandlerFunc

PageViewMiddleware logs page views to Google Analytics

func PostToAnalytics

func PostToAnalytics(request *http.Request, values *map[string]string) error

PostToAnalytics send the values to Google Analytics

func ReportError

func ReportError(e error)

func SendEmail

func SendEmail(sender, recipient, subject, body string) error

func StandardResponse

func StandardResponse(c echo.Context, status int, res interface{}) error

StandardResponse is the default way to respond to API requests

func TrackEvent

func TrackEvent(request *http.Request, category, action, label string, value int) error

TrackEvent post an event to analytics

Types

type Event

type Event struct {
	Category string
	Action   string
	Label    string
	Value    int
}

Event contains, events

Jump to

Keyboard shortcuts

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