modulepackage
5.0.5+incompatible
Repository: https://github.com/f0ster/parse.git
Documentation: pkg.go.dev
# README
#Parse
This package provides a client for Parse's REST API. So far, it supports most of the query operations provided by Parse's Javascript library, with a few exceptions (listed below under TODO).
###Installation
go get github.com/kylemcc/parse
###Documentation Full documentation is provided by godoc.org
###Usage:
package main
import (
"fmt"
"time"
"github.com/kylemcc/parse"
)
func main() {
parse.Initialize("APP_ID", "REST_KEY", "MASTER_KEY") // master key is optional
user := parse.User{}
q, err := parse.NewQuery(&user)
if err != nil {
panic(err)
}
q.EqualTo("email", "[email protected]")
q.GreaterThan("numFollowers", 10).OrderBy("-createdAt") // API is chainable
err := q.First()
if err != nil {
if pe, ok := err.(parse.ParseError); ok {
fmt.Printf("Error querying parse: %d - %s\n", pe.Code(), pe.Message())
}
}
fmt.Printf("Retrieved user with id: %s\n", u.Id)
q2, _ := parse.NewQuery(&parse.User{})
q2.GreaterThan("createdAt", time.Date(2014, 01, 01, 0, 0, 0, 0, time.UTC))
rc := make(chan *parse.User)
// .Each will retrieve all results for a query and send them to the provided channel
// The iterator returned allows for early cancelation of the iteration process, and
// stores any error that triggers early termination
iterator, err := q2.Each(rc)
for u := range rc{
fmt.Printf("received user: %v\n", u)
// Do something
if err := process(u); err != nil {
// Cancel if there was an error
iterator.Cancel()
}
}
// An error occurred - not all rows were processed
if it.Error() != nil {
panic(it.Error())
}
}
###TODO
- Missing query operations
- Related to
- Missing CRUD operations:
- Update
- Field ops (__op):
- AddRelation
- RemoveRelation
- Field ops (__op):
- Update
- Roles
- Cloud Functions
- Background Jobs
- Analytics
- File upload/retrieval
- Batch operations
# Functions
No description provided by the author
CreateParseClient the parse library with your API keys.
No description provided by the author
Create a new Push Notifaction
See the Push Notification Guide for more details: https://www.parse.com/docs/push_guide#sending/REST.
NewPushQuery Convenience function for creating a new query for use in SendPush.
Create a new query instance.
Create a new update request for the Parse object represented by v.
Register a type so that it can be handled when populating struct values.
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Variables
Returned when a query returns no results.
# Structs
No description provided by the author
No description provided by the author
A base type containing fields common to all Parse types
Embed this struct in custom types to avoid having to declare these fields everywhere.
No description provided by the author
Represents the Parse File type.
Represents the Parse GeoPoint type.
Represents the built-in Parse "Installation" class.
.
No description provided by the author
Represents a Parse Pointer type.
No description provided by the author
Represents the built-in Parse "User" class.
# Interfaces
No description provided by the author
No description provided by the author
Interface representing a Parse Push notification and the various options for sending a push notification.
No description provided by the author
No description provided by the author
No description provided by the author