protocol

package
Version: v0.0.0-...-489b206 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 4, 2019 License: Unlicense Imports: 0 Imported by: 3

Documentation

Index

Constants

View Source
const (
	REQUEST_GET_MESSAGES = iota
	REQUEST_SEND_MESSAGE
	REQUEST_GET_TIMELINE
	REQUEST_ADD_TO_TIMELINE
	REQUEST_GET_USERS_LIST
	REQUEST_ADD_FRIEND
	REQUEST_CONFIRM_FRIENDSHIP
	REQUEST_GET_MESSAGES_USERS
	REQUEST_GET_FRIENDS
	REQUEST_GET_PROFILE
	REQUEST_UPDATE_PROFILE
	REQUEST_GET_TIMELINE_FOR_HASH

	REPLY_ERROR = iota
	REPLY_MESSAGES_LIST
	REPLY_GENERIC
	REPLY_GET_TIMELINE
	REPLY_GET_MESSAGES_USERS
	REPLY_GET_FRIENDS
	REPLY_GET_PROFILE

	MAX_MESSAGES_LIMIT   = 100
	MAX_TIMELINE_LIMIT   = 100
	MAX_USERS_LIST_LIMIT = 100
	MAX_FRIENDS_LIMIT    = 100

	MSG_TYPE_OUT = true
	MSG_TYPE_IN  = false

	SEX_TYPE_MALE   = 1
	SEX_TYPE_FEMALE = 2

	FAMILY_POSITION_SINGLE  = 1
	FAMILY_POSITION_MARRIED = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseReply

type BaseReply struct {
	SeqId int
	Type  string
}

Request types

func (*BaseReply) SetReplyType

func (p *BaseReply) SetReplyType(t string)

func (*BaseReply) SetSeqId

func (p *BaseReply) SetSeqId(id int)

type BaseRequest

type BaseRequest struct {
	SeqId   int
	Type    string
	ReqData string
}

Request types

type JSUserInfo

type JSUserInfo struct {
	Name string
	Id   string
}

Request types

type JSUserListInfo

type JSUserListInfo struct {
	JSUserInfo
	IsFriend            bool
	FriendshipConfirmed bool
}

Request types

type Message

type Message struct {
	Id           uint64
	UserFrom     string
	UserFromName string
	Ts           string
	IsOut        bool
	Text         string
}

Request types

type Reply

type Reply interface {
	SetSeqId(int)
	SetReplyType(string)
}

Request types

type ReplyError

type ReplyError struct {
	BaseReply
	Message string
}

Reply types

type ReplyGeneric

type ReplyGeneric struct {
	BaseReply
	Success bool
}

Reply types

type ReplyGetFriends

type ReplyGetFriends struct {
	BaseReply
	Users          []JSUserInfo
	FriendRequests []JSUserInfo
}

Reply types

type ReplyGetMessagesUsers

type ReplyGetMessagesUsers struct {
	BaseReply
	Users []JSUserInfo
}

Reply types

type ReplyGetProfile

type ReplyGetProfile struct {
	BaseReply
	Name            string
	Birthdate       string
	Sex             int
	Description     string
	CityId          uint64 `json:",string"`
	CityName        string
	FamilyPosition  int
	FriendsCount    uint64
	IsFriend        bool
	RequestAccepted bool
}

Reply types

type ReplyGetTimeline

type ReplyGetTimeline struct {
	BaseReply
	Messages []TimelineMessage
}

Reply types

type ReplyMessagesList

type ReplyMessagesList struct {
	BaseReply
	Messages []Message
}

Reply types

type ReplyUsersList

type ReplyUsersList struct {
	BaseReply
	Users []JSUserListInfo
}

Reply types

type RequestAddFriend

type RequestAddFriend struct {
	FriendId string
}

Request types

type RequestAddToTimeline

type RequestAddToTimeline struct {
	Text string
}

Request types

type RequestConfirmFriendship

type RequestConfirmFriendship struct {
	FriendId string
}

Request types

type RequestGetFriends

type RequestGetFriends struct {
	Limit uint64
}

Request types

type RequestGetMessages

type RequestGetMessages struct {
	UserTo  uint64 `json:",string"`
	DateEnd string
	Limit   uint64
}

Request types

type RequestGetMessagesUsers

type RequestGetMessagesUsers struct {
	Limit uint64
}

Request types

type RequestGetProfile

type RequestGetProfile struct {
	UserId uint64 `json:",string"`
}

Request types

type RequestGetTimeline

type RequestGetTimeline struct {
	DateEnd string
	Limit   uint64
}

Request types

type RequestGetTimelineForHash

type RequestGetTimelineForHash struct {
	Hash    string
	DateEnd uint64 `json:",string"`
	Limit   uint64
}

Request types

type RequestGetUsersList

type RequestGetUsersList struct {
	MinId  uint64 `json:",string"`
	Limit  uint64
	Search string
}

Request types

type RequestSendMessage

type RequestSendMessage struct {
	UserTo uint64 `json:",string"`
	Text   string
}

Request types

type RequestUpdateProfile

type RequestUpdateProfile struct {
	Name           string
	Birthdate      string
	Sex            int
	CityName       string
	FamilyPosition int
}

Request types

type ResponseError

type ResponseError struct {
	BaseReply
	UserMsg string
	Err     error
}

Request types

type TimelineMessage

type TimelineMessage struct {
	Id       uint64
	UserId   string
	UserName string
	Text     string
	Ts       string
}

Request types

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL