Documentation ¶
Index ¶
- Constants
- func IsValidDevicePlatform(platform int) bool
- type Api
- type Asset
- type BlockUser
- type BlockUsers
- type Device
- type Devices
- type ErrorRoomUser
- type InvalidParam
- type Message
- type Messages
- type PayloadImage
- type PayloadLocation
- type PayloadText
- type PayloadUsers
- type ProblemDetail
- type RequestBlockUserIds
- type RequestRoomUserIds
- type ResponseMessages
- type ResponseRoomUser
- type Room
- type RoomForUser
- type RoomType
- type RoomUser
- type RoomUsers
- type Rooms
- type Subscription
- type User
- type UserForRoom
- type UserMini
- type UserUnreadCount
- type Users
Constants ¶
View Source
const ( PLATFORM_IOS = iota + 1 PLATFORM_ANDROID )
View Source
const ( MESSAGE_TYPE_TEXT = "text" MESSAGE_TYPE_IMAGE = "image" )
View Source
const ( ERROR_NAME_INVALID_JSON = "invalid-json" ERROR_NAME_INVALID_PARAM = "invalid-param" ERROR_NAME_DATABASE_ERROR = "database-error" ERROR_NAME_NOTIFICATION_ERROR = "notification-error" ERROR_NAME_OPERATION_NOT_PERMITTED = "operation-not-permitted" )
Variables ¶
This section is empty.
Functions ¶
func IsValidDevicePlatform ¶ added in v0.2.0
Types ¶
type Api ¶ added in v0.6.0
type Api struct { Id uint64 `json:"-" db:"id"` Name string `json:"name" db:"name,notnull"` Key string `json:"key" db:"key,notnull"` Secret string `json:"secret" db:"secret,notnull"` Created int64 `json:"created" db:"created,notnull"` Expired int64 `json:"expired" db:"expired,notnull"` }
func (*Api) MarshalJSON ¶ added in v0.6.0
type BlockUser ¶ added in v0.7.0
type BlockUser struct { UserId string `json:"userId" db:"user_id,notnull"` BlockUserId string `json:"blockUserId" db:"block_user_id,notnull"` Created int64 `json:"created" db:"created,notnull"` }
func (*BlockUser) MarshalJSON ¶ added in v0.7.0
type BlockUsers ¶ added in v0.7.0
type BlockUsers struct {
BlockUsers []string `json:"blockUsers"`
}
type Device ¶ added in v0.2.0
type Device struct { UserId string `json:"userId,omitempty" db:"user_id,notnull"` Platform int `json:"platform,omitempty" db:"platform,notnull"` Token string `json:"token,omitempty" db:"token,notnull"` NotificationDeviceId string `json:"notificationDeviceId,omitempty" db:"notification_device_id"` }
func (*Device) IsValid ¶ added in v0.2.0
func (d *Device) IsValid() *ProblemDetail
type ErrorRoomUser ¶
type ErrorRoomUser struct { UserId string `json:"userId,omitempty"` Error *ProblemDetail `json:"error"` }
type InvalidParam ¶
type Message ¶
type Message struct { Id uint64 `json:"-" db:"id"` MessageId string `json:"messageId" db:"message_id,notnull"` RoomId string `json:"roomId" db:"room_id,notnull"` UserId string `json:"userId" db:"user_id,notnull"` Type string `json:"type,omitempty" db:"type"` EventName string `json:"eventName,omitempty" db:"-"` Payload utils.JSONText `json:"payload" db:"payload"` Created int64 `json:"created" db:"created,notnull"` Modified int64 `json:"modified" db:"modified,notnull"` Deleted int64 `json:"-" db:"deleted,notnull"` }
func (*Message) BeforeSave ¶ added in v0.2.0
func (m *Message) BeforeSave()
func (*Message) IsValid ¶ added in v0.2.0
func (m *Message) IsValid() *ProblemDetail
func (*Message) MarshalJSON ¶ added in v0.4.0
type PayloadImage ¶
type PayloadLocation ¶
type PayloadText ¶
type PayloadText struct {
Text string `json:"text"`
}
type PayloadUsers ¶
type PayloadUsers struct {
Users []string `json:"users"`
}
type ProblemDetail ¶
type ProblemDetail struct { Type string `json:"type,omitempty"` Title string `json:"title"` Status int `json:"status,omitempty"` Detail string `json:"detail,omitempty"` Instance string `json:"instance,omitempty"` ErrorName string `json:"errorName"` InvalidParams []InvalidParam `json:"invalidParams,omitempty"` Error error `json:"-"` }
type RequestBlockUserIds ¶ added in v0.7.0
type RequestBlockUserIds struct {
UserIds []string `json:"userIds,omitempty"`
}
func (*RequestBlockUserIds) IsValid ¶ added in v0.7.0
func (reqUIDs *RequestBlockUserIds) IsValid(userId string) *ProblemDetail
func (*RequestBlockUserIds) RemoveDuplicate ¶ added in v0.7.0
func (reqUIDs *RequestBlockUserIds) RemoveDuplicate()
type RequestRoomUserIds ¶ added in v0.2.0
type RequestRoomUserIds struct {
UserIds []string `json:"userIds,omitempty" db:"-"`
}
func (*RequestRoomUserIds) IsValid ¶ added in v0.2.0
func (rus *RequestRoomUserIds) IsValid(method string, r *Room) *ProblemDetail
func (*RequestRoomUserIds) RemoveDuplicate ¶ added in v0.2.0
func (rus *RequestRoomUserIds) RemoveDuplicate()
type ResponseMessages ¶
type ResponseMessages struct { MessageIds []string `json:"messageIds,omitempty"` Errors []*ProblemDetail `json:"errors,omitempty"` }
type ResponseRoomUser ¶
type ResponseRoomUser struct { RoomUsers []RoomUser `json:"roomUsers,omitempty"` Errors []ErrorRoomUser `json:"errors,omitempty"` }
type Room ¶
type Room struct { Id uint64 `json:"-" db:"id"` RoomId string `json:"roomId" db:"room_id,notnull"` UserId string `json:"userId" db:"user_id,notnull"` Name string `json:"name" db:"name,notnull"` PictureUrl string `json:"pictureUrl,omitempty" db:"picture_url"` InformationUrl string `json:"informationUrl,omitempty" db:"information_url"` MetaData utils.JSONText `json:"metaData" db:"meta_data"` AvailableMessageTypes string `json:"availableMessageTypes,omitempty" db:"available_message_types"` Type *RoomType `json:"type,omitempty" db:"type,notnull"` LastMessage string `json:"lastMessage" db:"last_message"` LastMessageUpdated int64 `json:"lastMessageUpdated" db:"last_message_updated,notnull"` MessageCount int64 `json:"messageCount" db:"-"` NotificationTopicId string `json:"notificationTopicId,omitempty" db:"notification_topic_id"` IsCanLeft *bool `json:"isCanLeft,omitempty" db:"is_can_left,notnull"` IsShowUsers *bool `json:"isShowUsers,omitempty" db:"is_show_users,notnull"` Created int64 `json:"created" db:"created,notnull"` Modified int64 `json:"modified" db:"modified,notnull"` Deleted int64 `json:"-" db:"deleted,notnull"` Users []*UserForRoom `json:"users,omitempty" db:"-"` RequestRoomUserIds }
func (*Room) BeforeSave ¶ added in v0.2.0
func (r *Room) BeforeSave()
func (*Room) IsValid ¶ added in v0.2.0
func (r *Room) IsValid() *ProblemDetail
func (*Room) MarshalJSON ¶ added in v0.4.0
func (*Room) Put ¶ added in v0.2.0
func (r *Room) Put(put *Room) *ProblemDetail
type RoomForUser ¶
type RoomForUser struct { // from room RoomId string `json:"roomId" db:"room_id"` UserId string `json:"userId" db:"user_id"` Name string `json:"name" db:"name"` PictureUrl string `json:"pictureUrl,omitempty" db:"picture_url"` InformationUrl string `json:"informationUrl,omitempty" db:"information_url"` MetaData utils.JSONText `json:"metaData" db:"meta_data"` Type *RoomType `json:"type,omitempty" db:"type"` LastMessage string `json:"lastMessage" db:"last_message"` LastMessageUpdated int64 `json:"lastMessageUpdated" db:"last_message_updated"` IsCanLeft *bool `json:"isCanLeft,omitempty" db:"is_can_left,notnull"` Created int64 `json:"created" db:"created"` Modified int64 `json:"modified" db:"modified"` Users []*UserMini `json:"users" db:"-"` // from RoomUser RuUnreadCount int64 `json:"ruUnreadCount" db:"ru_unread_count"` RuMetaData utils.JSONText `json:"ruMetaData" db:"ru_meta_data"` RuCreated int64 `json:"ruCreated" db:"ru_created"` RuModified int64 `json:"ruModified" db:"ru_modified"` }
func (*RoomForUser) MarshalJSON ¶ added in v0.4.0
func (rfu *RoomForUser) MarshalJSON() ([]byte, error)
type RoomUser ¶
type RoomUser struct { RoomId string `json:"roomId" db:"room_id,notnull"` UserId string `json:"userId" db:"user_id,notnull"` UnreadCount *int64 `json:"unreadCount" db:"unread_count"` MetaData utils.JSONText `json:"metaData" db:"meta_data"` Created int64 `json:"created" db:"created,notnull"` Modified int64 `json:"modified" db:"modified,notnull"` }
func (*RoomUser) BeforeSave ¶ added in v0.2.0
func (ru *RoomUser) BeforeSave()
func (*RoomUser) IsValid ¶ added in v0.2.0
func (ru *RoomUser) IsValid() *ProblemDetail
func (*RoomUser) MarshalJSON ¶ added in v0.4.0
type Subscription ¶ added in v0.2.0
type Subscription struct { RoomId string `json:"roomId" db:"room_id,notnull"` UserId string `json:"userId" db:"user_id,notnull"` Platform int `json:"platform" db:"platform,notnull"` NotificationSubscriptionId string `json:"notificationSubscriptionId" db:"notification_subscription_id"` Deleted int64 `json:"-" db:"deleted,notnull"` }
type User ¶
type User struct { Id uint64 `json:"-" db:"id"` UserId string `json:"userId" db:"user_id,notnull"` Name string `json:"name" db:"name,notnull"` PictureUrl string `json:"pictureUrl,omitempty" db:"picture_url"` InformationUrl string `json:"informationUrl,omitempty" db:"information_url"` UnreadCount *uint64 `json:"unreadCount,omitempty" db:"unread_count,notnull"` MetaData utils.JSONText `json:"metaData,omitempty" db:"meta_data"` IsPublic *bool `json:"isPublic,omitempty" db:"is_public,notnull"` IsCanBlock *bool `json:"isCanBlock,omitempty" db:"is_can_block,notnull"` IsShowUsers *bool `json:"isShowUsers,omitempty" db:"is_show_users,notnull"` AccessToken string `json:"accessToken,omitempty" db:"access_token"` Created int64 `json:"created,omitempty" db:"created,notnull"` Modified int64 `json:"modified,omitempty" db:"modified,notnull"` Deleted int64 `json:"-" db:"deleted,notnull"` Rooms []*RoomForUser `json:"rooms,omitempty" db:"-"` Devices []*Device `json:"devices,omitempty" db:"-"` Blocks []string `json:"blocks,omitempty" db:"-"` }
func (*User) BeforeSave ¶ added in v0.2.0
func (u *User) BeforeSave()
func (*User) IsValid ¶ added in v0.2.0
func (u *User) IsValid() *ProblemDetail
func (*User) MarshalJSON ¶ added in v0.4.0
type UserForRoom ¶
type UserForRoom struct { // from User UserId string `json:"userId" db:"user_id"` Name string `json:"name" db:"name"` PictureUrl string `json:"pictureUrl,omitempty" db:"picture_url"` InformationUrl string `json:"informationUrl,omitempty" db:"information_url"` MetaData utils.JSONText `json:"metaData" db:"meta_data"` IsCanLeft *bool `json:"isCanBlock,omitempty" db:"is_can_block,notnull"` IsShowUsers *bool `json:"isShowUsers,omitempty" db:"is_show_users,notnull"` Created int64 `json:"created" db:"created"` Modified int64 `json:"modified" db:"modified"` // from RoomUser RuUnreadCount int64 `json:"ruUnreadCount" db:"ru_unread_count"` RuMetaData utils.JSONText `json:"ruMetaData" db:"ru_meta_data"` RuCreated int64 `json:"ruCreated" db:"ru_created"` RuModified int64 `json:"ruModified" db:"ru_modified"` }
func (*UserForRoom) MarshalJSON ¶ added in v0.4.0
func (ufr *UserForRoom) MarshalJSON() ([]byte, error)
type UserUnreadCount ¶ added in v0.7.1
type UserUnreadCount struct {
UnreadCount *uint64 `json:"unreadCount" db:"unread_count"`
}
Click to show internal directories.
Click to hide internal directories.