Documentation ¶
Index ¶
- Variables
- func IsObjectNotFound(err error) bool
- type Anonymous
- type AuthData
- type Error
- type Facebook
- type Installation
- type ObjectResponse
- type ParseClass
- func (c *ParseClass) Create(data interface{}, result interface{}) error
- func (c *ParseClass) Delete(objectID string) error
- func (c *ParseClass) Select(objectID string, result interface{}) error
- func (c *ParseClass) SelectQuery(query map[string]interface{}, result interface{}) error
- func (c *ParseClass) Update(objectID string, data interface{}, result interface{}) error
- type ParseClient
- type ParseConfig
- type ParseSession
- func (s *ParseSession) DeleteUser(userID string) error
- func (s *ParseSession) GetMe() (user User, err error)
- func (s *ParseSession) GetMeInto(user interface{}) error
- func (s *ParseSession) GetUser(userObjectID string) (user User, err error)
- func (s *ParseSession) GetUserByMaster(userObjectID string) (user User, err error)
- func (s *ParseSession) GetUserInto(userObjectID string, user interface{}) (err error)
- func (s *ParseSession) GetUserIntoByMaster(userObjectID string, user interface{}) (err error)
- func (s *ParseSession) Login(username string, password string) (user User, err error)
- func (s *ParseSession) NewClass(className string) *ParseClass
- func (s *ParseSession) PushNotification(query map[string]interface{}, data interface{}) error
- func (s *ParseSession) Signup(data interface{}) (user User, err error)
- func (s *ParseSession) UpdateUser(userObjectID string, data interface{}) (*ObjectResponse, error)
- func (s *ParseSession) UpdateUserByMaster(userObjectID string, data interface{}) (*ObjectResponse, error)
- func (s *ParseSession) UploadInstallation(data Installation, result interface{}) error
- type Pointer
- type PushNotificationQuery
- type Signup
- type Twitter
- type User
Constants ¶
This section is empty.
Variables ¶
var ( // ErrObjectNotFound Error code indicating the specified object doesn't exist. ErrObjectNotFound = errors.New("object not found") )
Functions ¶
func IsObjectNotFound ¶
IsObjectNotFound check the error "not found" or not
Types ¶
type AuthData ¶
type AuthData struct { Facebook *Facebook `json:"facebook,omitempty"` Twitter *Twitter `json:"twitter,omitempty"` Anonymous *Anonymous `json:"anonymous,omitempty"` }
AuthData data type
type Facebook ¶
type Facebook struct { ID string `json:"id,omitempty"` AccessToken string `json:"access_token,omitempty"` Expiration time.Time `json:"expiration_date,omitempty"` }
Facebook data type
type Installation ¶
type Installation struct { ObjectID string `json:"objectId,omitempty"` GCMSenderID string `json:"GCMSenderID,omitempty"` AppIdentifier string `json:"appIdentifier,omitempty"` AppName string `json:"appName,omitempty"` AppVersion string `json:"appVersion,omitempty"` Badge string `json:"badge,omitempty"` Channels []string `json:"channels,omitempty"` DeviceToken string `json:"deviceToken,omitempty"` DeviceType string `json:"deviceType,omitempty"` InstallationID string `json:"installationId,omitempty"` ParseVersion string `json:"parseVersion,omitempty"` PushType string `json:"pushType,omitempty"` TimeZone string `json:"timeZone,omitempty"` User Pointer `json:"user,omitempty"` CreatedAt time.Time `json:"createdAt,omitempty"` UpdatedAt time.Time `json:"updatedAt,omitempty"` }
Installation data type
type ObjectResponse ¶
type ObjectResponse struct { ObjectID string `json:"objectId,omitempty"` CreatedAt time.Time `json:"createdAt,omitempty"` UpdatedAt time.Time `json:"updatedAt,omitempty"` }
ObjectResponse data type
type ParseClass ¶
type ParseClass struct { Session *ParseSession Name string ClassURL string UseMaster bool }
ParseClass is an object that contains the ParseSession
func (*ParseClass) Create ¶
func (c *ParseClass) Create(data interface{}, result interface{}) error
Create creates class from data
func (*ParseClass) Delete ¶
func (c *ParseClass) Delete(objectID string) error
Delete deletes class by ID
func (*ParseClass) Select ¶
func (c *ParseClass) Select(objectID string, result interface{}) error
Select gets class data information
func (*ParseClass) SelectQuery ¶
func (c *ParseClass) SelectQuery(query map[string]interface{}, result interface{}) error
Select gets class data information by custom query
func (*ParseClass) Update ¶
func (c *ParseClass) Update(objectID string, data interface{}, result interface{}) error
Update updates class by ID
type ParseClient ¶
type ParseClient struct { URL string ApplicationID string RESTAPIKey string MasterKey string TimeOut time.Duration }
ParseClient is the client to access Parse REST API
func NewClientWithConfig ¶
func NewClientWithConfig(config ParseConfig) (*ParseClient, error)
NewClientWithConfig creates Parse Client with configuration
func (*ParseClient) NewSession ¶
func (p *ParseClient) NewSession(sessionToken string) *ParseSession
NewSession creates a new session from the client
type ParseConfig ¶
type ParseConfig struct { URL string ApplicationID string RESTAPIKey string MasterKey string TimeOut time.Duration }
ParseConfig is the configuration for initializing ParseClient
type ParseSession ¶
type ParseSession struct { SessionToken string // contains filtered or unexported fields }
ParseSession is the client which has SessionToken as user authentication.
func NewSession ¶
func NewSession(sessionToken string) (*ParseSession, error)
NewSession create a new session from default client
func (*ParseSession) DeleteUser ¶
func (s *ParseSession) DeleteUser(userID string) error
DeleteUser deletes user by ID
func (*ParseSession) GetMe ¶
func (s *ParseSession) GetMe() (user User, err error)
GetMe gets self user information
func (*ParseSession) GetMeInto ¶
func (s *ParseSession) GetMeInto(user interface{}) error
GetMeInto gets self user information into provided object
func (*ParseSession) GetUser ¶
func (s *ParseSession) GetUser(userObjectID string) (user User, err error)
GetUser gets user information
func (*ParseSession) GetUserByMaster ¶
func (s *ParseSession) GetUserByMaster(userObjectID string) (user User, err error)
GetUserByMaster gets user information by use master key
func (*ParseSession) GetUserInto ¶
func (s *ParseSession) GetUserInto(userObjectID string, user interface{}) (err error)
GetUserInto gets user information into provided object
func (*ParseSession) GetUserIntoByMaster ¶
func (s *ParseSession) GetUserIntoByMaster(userObjectID string, user interface{}) (err error)
GetUserIntoByMaster gets user information into provided object by use master key
func (*ParseSession) Login ¶
func (s *ParseSession) Login(username string, password string) (user User, err error)
Login with data
func (*ParseSession) NewClass ¶
func (s *ParseSession) NewClass(className string) *ParseClass
NewClass creates a new class from the session
func (*ParseSession) PushNotification ¶
func (s *ParseSession) PushNotification(query map[string]interface{}, data interface{}) error
PushNotification sends push-notifiaction each device via parse
func (*ParseSession) Signup ¶
func (s *ParseSession) Signup(data interface{}) (user User, err error)
Signup new user
func (*ParseSession) UpdateUser ¶
func (s *ParseSession) UpdateUser(userObjectID string, data interface{}) (*ObjectResponse, error)
UpdateUser update user information
func (*ParseSession) UpdateUserByMaster ¶
func (s *ParseSession) UpdateUserByMaster(userObjectID string, data interface{}) (*ObjectResponse, error)
UpdateUserByMaster update user information by use master key
func (*ParseSession) UploadInstallation ¶
func (s *ParseSession) UploadInstallation(data Installation, result interface{}) error
UploadInstallation stores the subscription data for installations
type Pointer ¶
type Pointer struct { Type string `json:"__type"` ClassName string `json:"className"` ObjectID string `json:"objectId"` }
Pointer data type
type PushNotificationQuery ¶
type PushNotificationQuery struct { Where map[string]interface{} `json:"where"` Data interface{} `json:"data"` }
PushNotificationQuery data type
type Signup ¶
type Signup struct { UserName string `json:"username"` Password string `json:"password"` AuthData *AuthData `json:"authData,omitempty"` }
Signup data type
type Twitter ¶
type Twitter struct { ID string `json:"id,omitempty"` ScreenName string `json:"screen_name,omitempty"` ConsumerKey string `json:"consumer_key,omitempty"` ConsumerSecret string `json:"consumer_secret,omitempty"` AuthToken string `json:"auth_token,omitempty"` AuthTokenSecret string `json:"auth_token_secret,omitempty"` }
Twitter data type
type User ¶
type User struct { ObjectID string `json:"objectId,omitempty"` Email string `json:"email,omitempty"` UserName string `json:"username,omitempty"` Phone string `json:"phone,omitempty"` EmailVerified bool `json:"emailVerified,omitempty"` SessionToken string `json:"sessionToken,omitempty"` AuthData *AuthData `json:"authData,omitempty"` CreatedAt time.Time `json:"createdAt,omitempty"` UpdatedAt time.Time `json:"updatedAt,omitempty"` }
User data type