aefire

package module
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2020 License: Apache-2.0 Imports: 30 Imported by: 5

README

aefire

Convenient functions firebase-sdk for golang on google appengine standard

Documentation

Index

Constants

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

Variables

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

Functions

func AddComma added in v0.0.18

func AddComma(s string) string

func AddDateHyphen added in v0.0.18

func AddDateHyphen(d, whenEmpty string) string

func AuthCronMiddleware added in v0.0.12

func AuthCronMiddleware(next echo.HandlerFunc) echo.HandlerFunc

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 CountryCodePrefix added in v0.0.14

func CountryCodePrefix(countryCode int) string

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 EndPoint added in v0.0.18

func EndPoint() string

func GAEAppID added in v0.0.18

func GAEAppID() string

func GAEServiceID added in v0.0.18

func GAEServiceID() string

func HMacSha1 added in v0.0.16

func HMacSha1(key, message []byte) (string, error)

func HyphenCorpNum added in v0.0.18

func HyphenCorpNum(s string) string

func HyphenPhoneNum added in v0.0.18

func HyphenPhoneNum(s string) string

func HyphenWhenEmpty added in v0.0.18

func HyphenWhenEmpty(s string) string

func IdTokenAuth

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

func Init

func Init()

func InitWith added in v0.0.3

func InitWith(keyFile string, envPairs ...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 KRTimezone added in v0.0.12

func KRTimezone() *time.Location

func LocalizeAndFormatPhoneNumber added in v0.0.14

func LocalizeAndFormatPhoneNumber(phoneNumber string, countryCode int) (localNumber string)

func LocalizePhoneNumber added in v0.0.14

func LocalizePhoneNumber(phoneNumber string, countryCode int) (localNumber string)

func LogIfError

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

func MD5Base64 added in v0.0.16

func MD5Base64(message []byte) (string, error)

func MapOf

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

func MessageToToken added in v0.0.3

func MessageToToken(token, title, body, priority string, notRegisteredTokenHandler func(fcmToken FcmToken), datas ...string) error

func MessageToTokens added in v0.0.3

func MessageToTokens(tokens []string, title, body, priority string, notRegisteredTokensHandler func([]FcmToken), datas ...string) map[string]error

func MessageToTopic added in v0.0.3

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

func NewBatch

func NewBatch() *firestore.WriteBatch

func NewEcho

func NewEcho() *echo.Echo

func NormalizePhoneNumber added in v0.0.14

func NormalizePhoneNumber(phoneNumber string, countryCode int) string

func PanicIfError

func PanicIfError(vs ...interface{})

func PathMerge added in v0.0.18

func PathMerge(path string, pairs ...interface{}) error

func PathTo

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

func QueryStringField added in v0.0.18

func QueryStringField(q firestore.Query, field string) (fieldValues map[string]string)

func Random added in v0.0.15

func Random(min, max int64) int64

func Round added in v0.0.15

func Round(x, unit float64) float64

func ServiceEndPoint added in v0.0.18

func ServiceEndPoint(serviceID string) string

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 StringMapValuesToSlice added in v0.0.18

func StringMapValuesToSlice(m map[string]string) (s []string)

func TimeNowRef

func TimeNowRef() *time.Time

func Timezone added in v0.0.12

func Timezone(hours, minutes int) *time.Location

func ToJson

func ToJson(v interface{}, indent ...string) string

func ToMap

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

func UID added in v0.0.12

func UID(c echo.Context) string

func UpdateQueryResults

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

func UpdatesOf

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

func UrlValuesOf added in v0.0.17

func UrlValuesOf(args ...string) url.Values

func UserToken

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

func ValidateCorpNum added in v0.0.13

func ValidateCorpNum(n string) bool

func ValidateIdToken

func ValidateIdToken(next echo.HandlerFunc) echo.HandlerFunc

func ValidateLocalCellPhoneNumber added in v0.0.13

func ValidateLocalCellPhoneNumber(phoneNumber string) bool

func ValidateRRN added in v0.0.13

func ValidateRRN(n string) bool

Types

type AEContext added in v0.0.3

type AEContext struct {
	echo.Context
}

func (*AEContext) Header added in v0.0.3

func (a *AEContext) Header(key string) string

func (*AEContext) JSONError added in v0.0.3

func (a *AEContext) JSONError(code int, msg string) error

func (*AEContext) JsonMap added in v0.0.3

func (a *AEContext) JsonMap(pairs ...interface{}) error

func (*AEContext) JsonMsg added in v0.0.3

func (a *AEContext) JsonMsg(msg string) error

func (*AEContext) JsonOk added in v0.0.3

func (a *AEContext) JsonOk() error

func (*AEContext) LastPathSegments added in v0.0.3

func (a *AEContext) LastPathSegments() string

func (*AEContext) PathSegments added in v0.0.3

func (a *AEContext) PathSegments() []string

func (*AEContext) ReqContext added in v0.0.3

func (a *AEContext) ReqContext() context.Context

func (*AEContext) UID added in v0.0.3

func (a *AEContext) UID() string

func (*AEContext) UserRecord added in v0.0.3

func (a *AEContext) UserRecord() *auth.UserRecord

func (*AEContext) UserToken added in v0.0.3

func (a *AEContext) UserToken() *auth.Token

type AEError added in v0.0.3

type AEError string

func (AEError) Error added in v0.0.3

func (e AEError) Error() string

type Credential added in v0.0.3

type Credential struct {
	Type                    string `json:"type"`
	ProjectID               string `json:"project_id"`
	PrivateKeyID            string `json:"private_key_id"`
	PrivateKey              string `json:"private_key"`
	ClientEmail             string `json:"client_email"`
	ClientID                string `json:"client_id"`
	AuthURI                 string `json:"auth_uri"`
	TokenURI                string `json:"token_uri"`
	AuthProviderX509CertURL string `json:"auth_provider_x509_cert_url"`
	ClientX509CertURL       string `json:"client_x509_cert_url"`
}

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 FcmToken added in v0.0.3

type FcmToken string

func (*FcmToken) IID added in v0.0.3

func (t *FcmToken) IID() string

Jump to

Keyboard shortcuts

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