Versions in this module Expand all Collapse all v0 v0.3.2 Oct 27, 2022 Changes in this version type Client + func (client *Client) SetProduction(production bool) type ClientOptions + Production string type File + MetaData map[string]interface{} v0.3.1 Nov 5, 2021 v0.3.0 Oct 20, 2021 Changes in this version type Client + func (client *Client) RPC(name string, params interface{}, results interface{}, runOptions ...RunOption) error + func (client *Client) Run(name string, params interface{}, runOptions ...RunOption) (interface{}, error) + type CloudEngine interface + AfterDelete func(class string, fn func(*ClassHookRequest) error) + AfterSave func(class string, fn func(*ClassHookRequest) error) + AfterUpdate func(class string, fn func(*ClassHookRequest) error) + BeforeDelete func(class string, fn func(*ClassHookRequest) (interface{}, error)) + BeforeSave func(class string, fn func(*ClassHookRequest) (interface{}, error)) + BeforeUpdate func(class string, fn func(*ClassHookRequest) (interface{}, error)) + Define func(name string, fn func(*FunctionRequest) (interface{}, error), ...) + Handler func() http.Handler + Init func(client *Client) + OnIMClientOffline func(fn func(*RealtimeHookRequest) error) + OnIMClientOnline func(fn func(*RealtimeHookRequest) error) + OnIMConversationAdd func(fn func(*RealtimeHookRequest) (interface{}, error)) + OnIMConversationAdded func(fn func(*RealtimeHookRequest) error) + OnIMConversationRemove func(fn func(*RealtimeHookRequest) (interface{}, error)) + OnIMConversationRemoved func(fn func(*RealtimeHookRequest) error) + OnIMConversationStart func(fn func(*RealtimeHookRequest) (interface{}, error)) + OnIMConversationStarted func(fn func(*RealtimeHookRequest) error) + OnIMConversationUpdate func(fn func(*RealtimeHookRequest) (interface{}, error)) + OnIMMessageReceived func(fn func(*RealtimeHookRequest) (interface{}, error)) + OnIMMessageSent func(fn func(*RealtimeHookRequest) error) + OnIMMessageUpdate func(fn func(*RealtimeHookRequest) (interface{}, error)) + OnIMReceiversOffline func(fn func(*RealtimeHookRequest) (interface{}, error)) + OnLogin func(fn func(*ClassHookRequest) error) + OnVerified func(verifyType string, fn func(*ClassHookRequest) error) + RPC func(name string, params interface{}, results interface{}, runOptions ...RunOption) error + Run func(name string, params interface{}, runOptions ...RunOption) (interface{}, error) + var Engine CloudEngine type Query + func (q *Query) Exists(key string) *Query + func (q *Query) NotExists(key string) *Query + func (q *Query) NotMatchesQuery(key string, query *Query) *Query v0.2.0 May 26, 2021 Changes in this version + type CloudError struct + Code int + Message string + StatusCode int + func (err CloudError) Error() string type Files + func (ref *Files) NewQuery() *Query + func (ref *Files) UploadFromLocalFile(file *File, path string, authOptions ...AuthOption) error type Roles + func (ref *Roles) NewQuery() *Query type User + Email string + EmailVerified bool + MobilePhoneNumber string + MobilePhoneVerified bool + Username string type Users + func (ref *Users) LogInByEmail(email, password string) (*User, error) + func (ref *Users) NewQuery() *Query + func (ref *Users) SignUpByEmail(email, password string) (*User, error) v0.1.0 Jan 25, 2021 Changes in this version + const Version + func AfterDelete(class string, fn func(*ClassHookRequest) error) + func AfterSave(class string, fn func(*ClassHookRequest) error) + func AfterUpdate(class string, fn func(*ClassHookRequest) error) + func BeforeDelete(class string, fn func(*ClassHookRequest) (interface{}, error)) + func BeforeSave(class string, fn func(*ClassHookRequest) (interface{}, error)) + func BeforeUpdate(class string, fn func(*ClassHookRequest) (interface{}, error)) + func Define(name string, fn func(*FunctionRequest) (interface{}, error), ...) + func Error(message string) *functionError + func ErrorWithCode(code int, message string) *functionError + func Handler(handler http.Handler) http.Handler + func OnIMClientOffline(fn func(*RealtimeHookRequest) error) + func OnIMClientOnline(fn func(*RealtimeHookRequest) error) + func OnIMConversationAdd(fn func(*RealtimeHookRequest) (interface{}, error)) + func OnIMConversationAdded(fn func(*RealtimeHookRequest) error) + func OnIMConversationRemove(fn func(*RealtimeHookRequest) (interface{}, error)) + func OnIMConversationRemoved(fn func(*RealtimeHookRequest) error) + func OnIMConversationStart(fn func(*RealtimeHookRequest) (interface{}, error)) + func OnIMConversationStarted(fn func(*RealtimeHookRequest) error) + func OnIMConversationUpdate(fn func(*RealtimeHookRequest) (interface{}, error)) + func OnIMMessageReceived(fn func(*RealtimeHookRequest) (interface{}, error)) + func OnIMMessageSent(fn func(*RealtimeHookRequest) error) + func OnIMMessageUpdate(fn func(*RealtimeHookRequest) (interface{}, error)) + func OnIMReceiversOffline(fn func(*RealtimeHookRequest) (interface{}, error)) + func OnLogin(fn func(*ClassHookRequest) error) + func OnVerified(verifyType string, fn func(*ClassHookRequest) error) + func RPC(name string, params interface{}, results interface{}, runOptions ...RunOption) error + func Run(name string, object interface{}, runOptions ...RunOption) (interface{}, error) + type ACL struct + func NewACL() *ACL + func NewACLWithUser(user *User) *ACL + func (acl *ACL) GetPublicReadAccess() bool + func (acl *ACL) GetPublicWriteAccess() bool + func (acl *ACL) GetReadAccess(user *User) bool + func (acl *ACL) GetRoleReadAccess(role *Role) bool + func (acl *ACL) GetRoleWriteAccess(role *Role) bool + func (acl *ACL) GetWriteAccess(user *User) bool + func (acl *ACL) SetPublicReadAccess(allowed bool) + func (acl *ACL) SetPublicWriteAccess(allowed bool) + func (acl *ACL) SetReadAccess(user *User, allowed bool) + func (acl *ACL) SetRoleReadAccess(role *Role, allowed bool) + func (acl *ACL) SetRoleWriteAccess(role *Role, allowed bool) + func (acl *ACL) SetWriteAccess(user *User, allowed bool) + type AuthData struct + func NewAuthData() *AuthData + func (auth *AuthData) Get(provider string) map[string]interface{} + func (auth *AuthData) Set(provider string, data map[string]interface{}) + func (auth *AuthData) SetAnonymous(data map[string]interface{}) + type AuthOption interface + func UseMasterKey(useMasterKey bool) AuthOption + func UseSessionToken(sessionToken string) AuthOption + func UseUser(user *User) AuthOption + type Class struct + Name string + func (ref *Class) Create(object interface{}, authOptions ...AuthOption) (*ObjectRef, error) + func (ref *Class) ID(id string) *ObjectRef + func (ref *Class) NewQuery() *Query + type ClassHookRequest struct + Meta map[string]string + Object *Object + User *User + func (r *ClassHookRequest) UpdatedKeys() []string + type Client struct + Files Files + Roles Roles + Users Users + func NewClient(options *ClientOptions) *Client + func NewEnvClient() *Client + func (client *Client) Class(name string) *Class + func (client *Client) File(id string) *FileRef + func (client *Client) Object(object interface{}) *ObjectRef + func (client *Client) Role(id string) *RoleRef + func (client *Client) User(user interface{}) *UserRef + type ClientOptions struct + AppID string + AppKey string + MasterKey string + ServerURL string + type DefineOption interface + func WithInternal() DefineOption + func WithoutFetchUser() DefineOption + type File struct + Bucket string + Key string + MIME string + Meatadata map[string]interface{} + Name string + Provider string + Size int64 + URL string + type FileRef struct + ID string + func (ref *FileRef) Destroy(authOptions ...AuthOption) error + func (ref *FileRef) Get(file *File, authOptions ...AuthOption) error + type Files struct + func (ref *Files) Upload(file *File, reader io.ReadSeeker, authOptions ...AuthOption) error + func (ref *Files) UploadFromFile(path string, authOptions ...AuthOption) (*File, error) + func (ref *Files) UploadFromURL(file *File, authOptions ...AuthOption) error + type FunctionRequest struct + CurrentUser *User + Meta map[string]string + Params interface{} + SessionToken string + type GeoPoint struct + Latitude float64 + Longitude float64 + func (point *GeoPoint) KilometersTo(target *GeoPoint) float64 + func (point *GeoPoint) MilesTo(target *GeoPoint) float64 + func (point *GeoPoint) RadiansTo(target *GeoPoint) float64 + type Object struct + CreatedAt time.Time + ID string + UpdatedAt time.Time + func (object *Object) ACL() *ACL + func (object *Object) Bool(key string) bool + func (object *Object) Bytes(key string) []byte + func (object *Object) Clone(dst interface{}) error + func (object *Object) Date(key string) *time.Time + func (object *Object) File(key string) *File + func (object *Object) Float(key string) float64 + func (object *Object) GeoPoint(key string) *GeoPoint + func (object *Object) Get(key string) interface{} + func (object *Object) Included() bool + func (object *Object) Int(key string) int64 + func (object *Object) IsPointer() bool + func (object *Object) Raw() map[string]interface{} + func (object *Object) String(key string) string + type ObjectRef struct + ID string + func (ref *ObjectRef) Destroy(authOptions ...AuthOption) error + func (ref *ObjectRef) Get(object interface{}, authOptions ...AuthOption) error + func (ref *ObjectRef) Set(key string, value interface{}, authOptions ...AuthOption) error + func (ref *ObjectRef) Update(diff interface{}, authOptions ...AuthOption) error + func (ref *ObjectRef) UpdateWithQuery(diff interface{}, query *Query, authOptions ...AuthOption) error + type Op struct + func OpAdd(objects interface{}) Op + func OpAddRelation(objects interface{}) Op + func OpAddUnique(objects interface{}) Op + func OpBitAnd(value interface{}) Op + func OpBitOr(value interface{}) Op + func OpBitXor(value interface{}) Op + func OpDecrement(amount interface{}) Op + func OpDelete() Op + func OpIncrement(amount interface{}) Op + func OpRemove(objects interface{}) Op + func OpRemoveRelation(objects interface{}) Op + type ParseResponseError struct + ParseError error + ResponseHeader http.Header + ResponseText string + StatusCode int + URL string + func (err *ParseResponseError) Error() string + type Query struct + func (q *Query) And(queries ...*Query) *Query + func (q *Query) Contains(key, substring string) *Query + func (q *Query) ContainsAll(key string, objects interface{}) *Query + func (q *Query) Count(authOptions ...AuthOption) (int, error) + func (q *Query) EqualTo(key string, value interface{}) *Query + func (q *Query) Find(objects interface{}, authOptions ...AuthOption) error + func (q *Query) First(object interface{}, authOptions ...AuthOption) error + func (q *Query) GreaterThan(key string, value interface{}) *Query + func (q *Query) GreaterThanOrEqualTo(key string, value interface{}) *Query + func (q *Query) In(key string, data interface{}) *Query + func (q *Query) Include(keys ...string) *Query + func (q *Query) IncludeACL() *Query + func (q *Query) LessThan(key string, value interface{}) *Query + func (q *Query) LessThanOrEqualTo(key string, value interface{}) *Query + func (q *Query) Limit(limit int) *Query + func (q *Query) MatchesKeyQuery(key, queryKey string, query *Query) *Query + func (q *Query) MatchesQuery(key string, query *Query) *Query + func (q *Query) Near(key string, point *GeoPoint) *Query + func (q *Query) NotEqualTo(key string, value interface{}) *Query + func (q *Query) NotIn(key string, data interface{}) *Query + func (q *Query) Or(queries ...*Query) *Query + func (q *Query) Order(keys ...string) *Query + func (q *Query) Regexp(key, expr, options string) *Query + func (q *Query) Select(keys ...string) *Query + func (q *Query) Skip(count int) *Query + func (q *Query) StartsWith(key, prefix string) *Query + func (q *Query) WithinGeoBox(key string, southwest *GeoPoint, northeast *GeoPoint) *Query + func (q *Query) WithinKilometers(key string, point *GeoPoint) *Query + func (q *Query) WithinMiles(key string, point *GeoPoint) *Query + func (q *Query) WithinRadians(key string, point *GeoPoint) *Query + type RealtimeHookRequest struct + Meta map[string]string + Params map[string]interface{} + type Relation struct + func NewRelation(key, parentClass string) *Relation + func (relation *Relation) Add(objects ...interface{}) + func (relation *Relation) Remove(objects ...interface{}) + type Role struct + Name string + type RoleRef struct + ID string + func (ref *RoleRef) Destroy(authOptions ...AuthOption) error + func (ref *RoleRef) Get(authOption ...AuthOption) (*Role, error) + func (ref *RoleRef) Set(field string, value interface{}, authOptions ...AuthOption) error + func (ref *RoleRef) Update(data map[string]interface{}, authOptions ...AuthOption) error + func (ref *RoleRef) UpdateWithQuery(data map[string]interface{}, authOptions ...AuthOption) error + type Roles struct + type RunOption interface + func WithRemote() RunOption + func WithSessionToken(token string) RunOption + func WithUser(user *User) RunOption + type ServerResponseError struct + Code int + Err string + StatusCode int + URL string + func (err *ServerResponseError) Error() string + type User struct + SessionToken string + type UserQuery struct + func (q *UserQuery) And(queries ...*UserQuery) *UserQuery + func (q *UserQuery) Contains(key, substring string) *UserQuery + func (q *UserQuery) ContainsAll(key string, objects interface{}) *UserQuery + func (q *UserQuery) Count(authOptions ...AuthOption) (int, error) + func (q *UserQuery) EqualTo(key string, value interface{}) *UserQuery + func (q *UserQuery) Find(users interface{}, authOptions ...AuthOption) error + func (q *UserQuery) First(user interface{}, authOptions ...AuthOption) error + func (q *UserQuery) GreaterThan(key string, value interface{}) *UserQuery + func (q *UserQuery) GreaterThanOrEqualTo(key string, value interface{}) *UserQuery + func (q *UserQuery) In(key string, data interface{}) *UserQuery + func (q *UserQuery) Include(keys ...string) *UserQuery + func (q *UserQuery) LessThan(key string, value interface{}) *UserQuery + func (q *UserQuery) LessThanOrEqualTo(key string, value interface{}) *UserQuery + func (q *UserQuery) Limit(limit int) *UserQuery + func (q *UserQuery) MatchesKeyQuery(key, queryKey string, query *UserQuery) *UserQuery + func (q *UserQuery) MatchesQuery(key string, query *UserQuery) *UserQuery + func (q *UserQuery) Near(key string, point *GeoPoint) *UserQuery + func (q *UserQuery) NotEqualTo(key string, value interface{}) *UserQuery + func (q *UserQuery) NotIn(key string, data interface{}) *UserQuery + func (q *UserQuery) Or(queries ...*Query) *UserQuery + func (q *UserQuery) Order(keys ...string) *UserQuery + func (q *UserQuery) Regexp(key, expr, options string) *UserQuery + func (q *UserQuery) Select(keys ...string) *UserQuery + func (q *UserQuery) SizeEqualTo(key string, count int) *UserQuery + func (q *UserQuery) Skip(count int) *UserQuery + func (q *UserQuery) StartsWith(key, prefix string) *UserQuery + func (q *UserQuery) WithinGeoBox(key string, point *GeoPoint) *UserQuery + func (q *UserQuery) WithinKilometers(key string, point *GeoPoint) *UserQuery + func (q *UserQuery) WithinMiles(key string, point *GeoPoint) *UserQuery + func (q *UserQuery) WithinRadians(key string, point *GeoPoint) *UserQuery + type UserRef struct + ID string + func (ref *UserRef) Destroy(authOptions ...AuthOption) error + func (ref *UserRef) Get(user interface{}, authOptions ...AuthOption) error + func (ref *UserRef) Set(key string, value interface{}, authOptions ...AuthOption) error + func (ref *UserRef) Update(diff interface{}, authOptions ...AuthOption) error + func (ref *UserRef) UpdateWithQuery(diff interface{}, query *UserQuery, authOptions ...AuthOption) error + type Users struct + func (ref *Users) Become(sessionToken string) (*User, error) + func (ref *Users) ID(id string) *UserRef + func (ref *Users) LogIn(username, password string) (*User, error) + func (ref *Users) LogInByMobilePhoneNumber(number, smsCode string) (*User, error) + func (ref *Users) NewUserQuery() *UserQuery + func (ref *Users) RequestEmailVerify(email string, authOptions ...AuthOption) error + func (ref *Users) RequestLoginSMSCode(number string, authOptions ...AuthOption) error + func (ref *Users) RequestMobilePhoneVerify(number string, authOptions ...AuthOption) error + func (ref *Users) RequestPasswordReset(email string, authOptions ...AuthOption) error + func (ref *Users) RequestPasswordResetBySMSCode(number string, authOptions ...AuthOption) error + func (ref *Users) ResetPasswordBySMSCode(number, smsCode, password string, authOptions ...AuthOption) error + func (ref *Users) SignUp(username, password string) (*User, error) + func (ref *Users) SignUpByMobilePhone(number, smsCode string) (*User, error)