Documentation ¶
Index ¶
- Constants
- func NewClient(appId, appKey, masterKey string) *leanClient
- type ACLMap
- type AVObject
- type Agent
- type AndroidData
- type Collection
- func (this Collection) Create(obj interface{}) *Agent
- func (this Collection) DeleteObjectById(objectId string) *QueryAgent
- func (this Collection) GetObjectById(objectId string) *Agent
- func (this Collection) Query() *QueryAgent
- func (this Collection) Scan(cursor, key string) *QueryAgent
- func (this Collection) UpdateObjectById(objectId string, obj interface{}) *UpdateAgent
- type ComplexData
- type File
- type IOSData
- type IOSLocalAlert
- type IOSStandardData
- type Installation
- type LeanByte
- type LeanClassesBase
- type LeanFile
- type LeanPointer
- type LeanRelation
- type LeanTime
- type Push
- type QueryAgent
- func (this *QueryAgent) Limit(l int) *QueryAgent
- func (this *QueryAgent) Order(s string) *QueryAgent
- func (this *QueryAgent) Skip(s int) *QueryAgent
- func (this *QueryAgent) WithCount() *QueryAgent
- func (this *QueryAgent) WithCql(cql string) *QueryAgent
- func (this *QueryAgent) WithKeys(key string) *QueryAgent
- func (this *QueryAgent) WithQuery(q *query.Query) *QueryAgent
- type RequestMobilePhoneVerify
- type UpdateAgent
- type User
- type WinPhoneData
Constants ¶
const ( //v1.1 api classes url base //all url will not end with /,should append it by yourself UrlBase = "https://api.leancloud.cn/1.1" ClasssesUrlBase = UrlBase + "/classes" )
const ( VoiceSMS = "void" TextSMS = "sms" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
func (*Agent) ScanResponse ¶
func (*Agent) UseMasterKey ¶
if you wanna use master key, use it
func (*Agent) UseSessionToken ¶
func (*Agent) UseSignature ¶
if you wanna use signature instead of key directlly , use this
type AndroidData ¶
type AndroidData struct { Alert string `json:"alert"` Title string `json:"title"` Silent bool `json:"silent,omitempty"` //this should be empty unless you have a custom Receiver Action string `json:"action,omitempty"` }
You can still add more keys into this struct using this struct as a anonymous field
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
func (Collection) DeleteObjectById ¶
func (this Collection) DeleteObjectById(objectId string) *QueryAgent
you can also specialfy the query parameter, if you don't provide the id, you will delete the objects by query
func (Collection) GetObjectById ¶
func (this Collection) GetObjectById(objectId string) *Agent
get an object by objectId
func (Collection) Query ¶
func (this Collection) Query() *QueryAgent
func (Collection) Scan ¶
func (this Collection) Scan(cursor, key string) *QueryAgent
leave cursor and key empty if they are empty
func (Collection) UpdateObjectById ¶
func (this Collection) UpdateObjectById(objectId string, obj interface{}) *UpdateAgent
you can also specialfy the query parameter, if you don't provide the id, you will update the object by query
type ComplexData ¶
type ComplexData struct { //the interface should be a IOSData or any struct with an anonymous file of IOSData IOS interface{} `json:"ios,omitempty"` //the interface should be a AndroidData or any struct with an anonymous file of AndroidData Android AndroidData `json:"android,omitempty"` WP WinPhoneData `json:"wp,omitempty"` }
type File ¶
type File struct { LeanClassesBase Name string `json:"name,omitempty"` FileType string `json:"mime_type,omitempty"` Key string `json:"key,omitempty"` Type string `json:"__type,omitempty"` Url string `json:"url,omitempty"` Bucket string `json:"bucket,omitempty"` MetaData map[string]interface{} `json:"metaData,omitempty"` }
be attention that EmailVerified and MobilePhoneVerified can be nil
type IOSData ¶
type IOSData struct { //Alert can be eiterh a string or a IOSLocalAlert Alert interface{} `json:"alter"` Category string `json:"category,omitempty"` //Badge can be either a int or a "Increment" Badge interface{} `json:"badge,omitempty"` Sound string `json:"sound,omitempty"` ContentAvailable int `json:"content-available,omitempty"` MutableContent int `json:"mutable-content,omitempty"` }
You can still add more keys into this struct using this struct as a anonymous field
type IOSLocalAlert ¶
type IOSLocalAlert struct { Title string `json:"title,omitempty"` TitleLocKey string `json:"title-loc-key,omitempty"` SubTitle string `json:"sub-title,omitempty"` SubTitleLocKey string `json:"sub=title-loc-key,omitempty"` Body string `json:"body,omitempty"` ActionLocKey string `json:"action-loc-key,omitempty"` LocKey string `json:"loc-key,omitempty"` LocArgs []string `json:"loc-args,omitempty"` LauchImage string `json:"lauch-image,omitempty"` }
type IOSStandardData ¶
type IOSStandardData struct { //Alert in IOSData should be a IOSLocalAlert Aps IOSData `json:"aps"` }
You can still add more keys into this struct using this struct as a anonymous field
type Installation ¶
type Installation struct { LeanClassesBase Badage string `json:"badge,omitempty"` Channels []string `json:"channels,omitempty"` DeviceProfile string `json:"deviceProfile,omitempty"` DeviceToken string `json:"deviceToken,omitempty"` DeviceType string `json:"deviceType,omitempty"` ID string `json:"ID,omitempty"` InstallationId string `json:"installationId,omitempty"` SubscriptionUri string `json:"subscriptionUri,omitempty"` TimeZone string `json:"timeZone,omitempty"` }
type LeanByte ¶
type LeanByte struct {
// contains filtered or unexported fields
}
{ "__type": "Bytes", "base64": "5b6I5aSa55So5oi36KGo56S65b6I5Zac5qyi5oiR5Lus55qE5paH5qGj6aOO5qC877yM5oiR5Lus5bey5bCGIExlYW5DbG91ZCDmiYDmnInmlofmoaPnmoQgTWFya2Rvd24g5qC85byP55qE5rqQ56CB5byA5pS+5Ye65p2l44CC" }
func NewLeanByte ¶
func (LeanByte) MarshalJSON ¶
func (*LeanByte) UnmarshalJSON ¶
convet json into TimeStamp, we take only the unix timestamp seconds
type LeanClassesBase ¶
type LeanPointer ¶
type LeanPointer struct {
// contains filtered or unexported fields
}
{ "__type": "Pointer", "className": "Post", "objectId": "55a39634e4b0ed48f0c1845c" }
func (LeanPointer) MarshalJSON ¶
func (t LeanPointer) MarshalJSON() ([]byte, error)
type LeanRelation ¶
type LeanRelation struct {
ClassName string `json:'className'`
}
relation can only modify by AddRelation or RemoveRelation. and the api return only this struct
type LeanTime ¶
func NewLeanTime ¶
func (LeanTime) MarshalJSON ¶
2015-07-14T02:31:50.100Z convet TimeStamp into json, we take only the unix timestamp seconds
func (*LeanTime) UnmarshalJSON ¶
convet json into TimeStamp, we take only the unix timestamp seconds
type Push ¶
type Push struct { LeanClassesBase Channels []string `json:"channels,omitempty"` Data interface{} `json:"data"` ExpirationInterval int `json:"expirationInterval,omitempty"` ExpirationTime int `json:"expirationTime,omitempty"` Prod string `json:"prod,omitempty"` PushTime time.Time `json:"pushTime,omitempty"` Where interface{} `json:"where,omitempty"` }
type QueryAgent ¶
type QueryAgent struct {
Agent
}
func (*QueryAgent) Limit ¶
func (this *QueryAgent) Limit(l int) *QueryAgent
func (*QueryAgent) Order ¶
func (this *QueryAgent) Order(s string) *QueryAgent
func (*QueryAgent) Skip ¶
func (this *QueryAgent) Skip(s int) *QueryAgent
func (*QueryAgent) WithCount ¶
func (this *QueryAgent) WithCount() *QueryAgent
func (*QueryAgent) WithCql ¶
func (this *QueryAgent) WithCql(cql string) *QueryAgent
func (*QueryAgent) WithKeys ¶
func (this *QueryAgent) WithKeys(key string) *QueryAgent
func (*QueryAgent) WithQuery ¶
func (this *QueryAgent) WithQuery(q *query.Query) *QueryAgent
type RequestMobilePhoneVerify ¶
type RequestMobilePhoneVerify struct { Number string `json:"mobilePhoneNumber"` TTL int `json:"ttl,omitempty"` AppName string `json:"name,omitempty"` Op string `json:"op,omitempty"` SmsType string `json:"smsType,omitempty"` }
Number is the phone number TTL is default to 10 minutes AppName is default to the app name of you lean cloud application Op is default to verifying SmsType is default to TextSMS, set SmsType to VoiceSMS if you wanna send a voice sms
type UpdateAgent ¶
type UpdateAgent struct {
QueryAgent
}
type User ¶
type User struct { LeanClassesBase Salt string `json:"salt,omitemptyy"` Email string `json:"email, omitempty"` SessionToken string `json:"sessionToken, omitempty"` Passowrd string `json:"password,omitempty"` Username string `json:"username,omitempty"` EmailVerified *bool `json:"emailVerified, omitempty"` MobilePhoneNumber string `json:"mobilePhoneNumber, omitempty"` AuthData map[string]interface{} `json:"authData, omitempty"` MobilePhoneVerified *bool `json:"mobilePhoneVerified, omitempty"` }
be attention that EmailVerified and MobilePhoneVerified can be nil
type WinPhoneData ¶
type WinPhoneData struct { Alert string `json:"alert"` Title string `json:"title"` WpParam string `json:"wp-param"` }
don't add custome key because wp doesn't support it