aefire

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: Apache-2.0 Imports: 16 Imported by: 5

README

aefire

Convenient functions firebase-sdk for golang on google appengine standard

Documentation

Index

Constants

View Source
const (
	DocumentNotFound = GWError("DocumentNotFound")
)

Variables

View Source
var FAuth *auth.Client
View Source
var FIID *iid.Client

Functions

func BatchMerge

func BatchMerge(b *firestore.WriteBatch, doc *firestore.DocumentRef, pairs ...interface{}) *firestore.WriteBatch

func BatchMergeObj

func BatchMergeObj(b *firestore.WriteBatch, path string, o interface{}) *firestore.WriteBatch

func BatchMergePath

func BatchMergePath(b *firestore.WriteBatch, path string, pairs ...interface{}) *firestore.WriteBatch

func Col

func Col(path string) *firestore.CollectionRef

func DeleteQueryResults

func DeleteQueryResults(q firestore.Query, b *firestore.WriteBatch) error

func Doc

func Doc(path string) *firestore.DocumentRef

func DocMerge

func DocMerge(doc *firestore.DocumentRef, pairs ...interface{}) error

func DocMergeObj

func DocMergeObj(doc *firestore.DocumentRef, o interface{}) error

func FcmToDevices

func FcmToDevices(tokens []string, title, body, link, priority string, datas ...string) map[string]error

func FcmToToken

func FcmToToken(token, title, body, link, priority string, datas ...string) error

func FcmToTopic

func FcmToTopic(topic, title, body, link, priority string, datas ...string) error

func IdTokenAuth

func IdTokenAuth(key string, c echo.Context) (result bool, err error)

func Init

func Init(projectID, credentailFilePath, port string)

func JSONError

func JSONError(c echo.Context, code int, msg string) error

func JsonMap

func JsonMap(c echo.Context, pairs ...interface{}) error

func JsonMsg

func JsonMsg(c echo.Context, msg string) error

func JsonOk

func JsonOk(c echo.Context) error

func LogIfError

func LogIfError(vs ...interface{}) bool

func MapOf

func MapOf(pairs ...interface{}) map[string]interface{}

func NewBatch

func NewBatch() *firestore.WriteBatch

func NewEcho

func NewEcho() *echo.Echo

func PanicIfError

func PanicIfError(vs ...interface{})

func PathTo

func PathTo(path string, to interface{}) error

func Snap

func Snap(path string) *firestore.DocumentSnapshot

func SnapExists

func SnapExists(snap *firestore.DocumentSnapshot) bool

func SnapTo

func SnapTo(snap *firestore.DocumentSnapshot, to interface{}) error

func StringMapOf

func StringMapOf(pairs ...string) map[string]string

func TimeNowRef

func TimeNowRef() *time.Time

func ToJson

func ToJson(v interface{}) string

func ToMap

func ToMap(v interface{}) (m map[string]interface{})

func UpdateQueryResults

func UpdateQueryResults(q firestore.Query, b *firestore.WriteBatch, updates ...interface{}) error

func UpdatesOf

func UpdatesOf(pairs ...interface{}) []firestore.Update

func UserToken

func UserToken(c echo.Context) *auth.Token

func ValidateIdToken

func ValidateIdToken(next echo.HandlerFunc) echo.HandlerFunc

Types

type Device

type Device struct {
	UID         *string    `json:"uid,omitempty" firestore:"uid,omitempty"`
	IID         string     `json:"iid" firestore:"iid"`
	Token       *string    `json:"token,omitempty" firestore:"token,omitempty"`
	PhoneNumber *string    `json:"phoneNumber,omitempty" firestore:"phoneNumber,omitempty"`
	CreatedAt   *time.Time `json:"createdAt" firestore:"createdAt"`
	UserAgent   string     `json:"userAgent" firestore:"userAgent"`
}

func (*Device) DocId

func (d *Device) DocId() string

type GWError

type GWError string

func (GWError) Error

func (e GWError) Error() string

Jump to

Keyboard shortcuts

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