Documentation ¶
Overview ¶
Package protocol is a generated protocol buffer package.
It is generated from these files:
protocol.proto
It has these top-level messages:
AyiHeaderV2 Hello CreateEvent CancelEvent InviteUsers CancelUsersInvitation ConfirmAttendance ModifyEvent VoteChange UserPosition UserPositionRange CreateUserAccount LinkAccount NewAuthToken AccessToken InstanceIDToken SyncGroups CreateFriendRequest ConfirmFriendRequest EventCancelled EventExpired InvitationCancelled AttendanceStatus EventChangeProposed VotingStatus ChangeAccepted ChangeDiscarded Ok Error TimeInfo ReadEvent EventListRequest EventsList FriendsList GroupsList FriendRequestsList
Index ¶
- Constants
- Variables
- func WriteBytes(data []byte, conn net.Conn) (int, error)
- type AccessToken
- type AttendanceStatus
- type AuthType
- type AyiHeader
- type AyiHeaderV2
- func (*AyiHeaderV2) Descriptor() ([]byte, []int)
- func (h *AyiHeaderV2) GetSize() uint
- func (h *AyiHeaderV2) GetToken() uint16
- func (h *AyiHeaderV2) GetType() PacketType
- func (h *AyiHeaderV2) GetVersion() uint32
- func (h *AyiHeaderV2) Marshal(writer io.Writer) error
- func (h *AyiHeaderV2) ParseHeader(reader io.Reader) error
- func (*AyiHeaderV2) ProtoMessage()
- func (m *AyiHeaderV2) Reset()
- func (h *AyiHeaderV2) SetSize(size uint)
- func (h *AyiHeaderV2) SetToken(token uint16)
- func (h *AyiHeaderV2) SetType(packet_type PacketType)
- func (h *AyiHeaderV2) SetVersion(version uint32)
- func (m *AyiHeaderV2) String() string
- type AyiPacket
- func (packet *AyiPacket) DecodeMessage() (Message, error)
- func (packet *AyiPacket) HasPayload() bool
- func (packet *AyiPacket) Id() uint16
- func (packet *AyiPacket) IsResponse() bool
- func (packet *AyiPacket) Marshal() []byte
- func (packet *AyiPacket) ResponseId() uint16
- func (packet *AyiPacket) SetMessage(message Message)
- func (packet *AyiPacket) String() string
- func (packet *AyiPacket) Type() PacketType
- func (packet *AyiPacket) Version() uint32
- type CancelEvent
- type CancelUsersInvitation
- type ChangeAccepted
- type ChangeDiscarded
- type ConfirmAttendance
- type ConfirmFriendRequest
- type ConfirmFriendRequest_FriendRequestResponse
- type CreateEvent
- type CreateFriendRequest
- type CreateUserAccount
- type Error
- type EventCancelled
- type EventChangeProposed
- type EventExpired
- type EventListRequest
- type EventsList
- type FriendRequestsList
- type FriendsList
- type GroupsList
- type Hello
- type InstanceIDToken
- type InvitationCancelled
- type InviteUsers
- type LinkAccount
- type Message
- type MessageBuilder
- type ModifyEvent
- type NewAuthToken
- type Ok
- type PacketBuilder
- func (mb *PacketBuilder) AttendanceStatus(event_id int64, participants map[int64]*core.EventParticipant) *AyiPacket
- func (mb *PacketBuilder) AttendanceStatusWithNumGuests(event_id int64, participants map[int64]*core.EventParticipant, num_guests int) *AyiPacket
- func (mb *PacketBuilder) ClockResponse() *AyiPacket
- func (mb *PacketBuilder) Error(msg_type PacketType, error_code int32) *AyiPacket
- func (mb *PacketBuilder) Event(event *core.Event) *AyiPacket
- func (mb *PacketBuilder) EventCancelled(who_id int64, event *core.Event) *AyiPacket
- func (mb *PacketBuilder) EventCreated(event *core.Event) *AyiPacket
- func (mb *PacketBuilder) EventExpired(event_id int64) *AyiPacket
- func (mb *PacketBuilder) EventModified(event *core.Event) *AyiPacket
- func (mb *PacketBuilder) EventsHistoryList(events_list []*core.Event, startWindow int64, endWindow int64) *AyiPacket
- func (mb *PacketBuilder) EventsList(events_list []*core.Event) *AyiPacket
- func (mb *PacketBuilder) FacebookFriendsList(friends_list []*core.Friend) *AyiPacket
- func (mb *PacketBuilder) FriendRequestReceived(request *core.FriendRequest) *AyiPacket
- func (mb *PacketBuilder) FriendRequestsList(requests_list []*core.FriendRequest) *AyiPacket
- func (mb *PacketBuilder) FriendsList(friends_list []*core.Friend) *AyiPacket
- func (mb *PacketBuilder) GroupsList(groups_list []*core.Group) *AyiPacket
- func (mb *PacketBuilder) InvitationReceived(event *core.Event) *AyiPacket
- func (mb *PacketBuilder) NewAccessToken(user_id int64, auth_token string) *AyiPacket
- func (mb *PacketBuilder) Ok(msg_type PacketType) *AyiPacket
- func (mb *PacketBuilder) Ping() *AyiPacket
- func (mb *PacketBuilder) Pong() *AyiPacket
- func (mb *PacketBuilder) UserAccessGranted(user_id int64, auth_token string) *AyiPacket
- func (mb *PacketBuilder) UserAccount(user *core.UserAccount) *AyiPacket
- type PacketType
- type ReadEvent
- type SyncGroups
- type TimeInfo
- type UserPosition
- type UserPositionRange
- type VoteChange
- type VotingStatus
Constants ¶
const ( E_NO_ERROR int32 = iota E_INVALID_USER_OR_PASSWORD // Auth, AuthNewToken E_EMAIL_EXISTS // Create User Account E_FB_EXISTS // Create User Account E_FB_INVALID_ACCESS_TOKEN // Create User Account E_INVALID_INPUT // Create User Account E_MALFORMED_MESSAGE // User Friend E_EVENT_PARTICIPANTS_REQUIRED E_OPERATION_FAILED E_INVALID_EVENT_OR_PARTICIPANT E_INVALID_PARTICIPANT E_EVENT_OUT_OF_CREATE_WINDOW E_EVENT_INVALID_START_DATE E_EVENT_INVALID_END_DATE E_INPUT_INVALID_EMAIL_ADDRESS E_INPUT_INVALID_USER_NAME E_EVENT_NOT_WRITABLE E_UNAUTHORIZED E_INVALID_EVENT E_EVENT_AUTHOR_MISMATCH E_ACCESS_DENIED E_EMPTY_LIST E_FRIEND_NOT_FOUND E_ALREADY_FRIENDS E_FRIEND_REQUEST_ALREADY_SENT E_SERVER_MAINTENANCE E_ACCOUNT_NOT_LINKED_TO_FACEBOOK E_FORBIDDEN E_INPUT_INVALID_PASSWORD )
const ( MAX_WRITE_TIMEOUT = 15 * time.Second VERSION_1 = 0 // Use old packet v1 VERSION_2 = 1 // Use new header format pb based VERSION_3 = 2 // Same header but different behaviour )
Variables ¶
var ( ErrConnectionClosed = errors.New("connection closed") ErrTimeout = errors.New("input/output timeout") ErrInvalidSocket = errors.New("invalid connection socket") ErrMaxPayloadExceeded = errors.New("max payload exceeded") ErrIncompleteWrite = errors.New("incomplete write") ErrUnknownMessage = errors.New("unknown message") ErrNoPayload = errors.New("packet conveys no message") )
var AuthType_name = map[int32]string{
0: "A_NATIVE",
1: "A_FACEBOOK",
}
var AuthType_value = map[string]int32{
"A_NATIVE": 0,
"A_FACEBOOK": 1,
}
var ConfirmFriendRequest_FriendRequestResponse_name = map[int32]string{
0: "CANCEL",
1: "CONFIRM",
}
var ConfirmFriendRequest_FriendRequestResponse_value = map[string]int32{
"CANCEL": 0,
"CONFIRM": 1,
}
Functions ¶
Types ¶
type AccessToken ¶
type AccessToken struct { UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId" json:"user_id,omitempty"` AuthToken string `protobuf:"bytes,2,opt,name=auth_token,json=authToken" json:"auth_token,omitempty"` }
ACCESS GRANTED / USER AUTH / GET ACCESS TOKEN
func (*AccessToken) Descriptor ¶
func (*AccessToken) Descriptor() ([]byte, []int)
func (*AccessToken) ProtoMessage ¶
func (*AccessToken) ProtoMessage()
func (*AccessToken) Reset ¶
func (m *AccessToken) Reset()
func (*AccessToken) String ¶
func (m *AccessToken) String() string
type AttendanceStatus ¶
type AttendanceStatus struct { EventId int64 `protobuf:"varint,1,opt,name=event_id,json=eventId" json:"event_id,omitempty"` AttendanceStatus []*core.EventParticipant `protobuf:"bytes,2,rep,name=attendance_status,json=attendanceStatus" json:"attendance_status,omitempty"` NumGuests int32 `protobuf:"varint,3,opt,name=num_guests,json=numGuests" json:"num_guests,omitempty"` }
ATTENDANCE STATUS
func (*AttendanceStatus) Descriptor ¶
func (*AttendanceStatus) Descriptor() ([]byte, []int)
func (*AttendanceStatus) GetAttendanceStatus ¶
func (m *AttendanceStatus) GetAttendanceStatus() []*core.EventParticipant
func (*AttendanceStatus) ProtoMessage ¶
func (*AttendanceStatus) ProtoMessage()
func (*AttendanceStatus) Reset ¶
func (m *AttendanceStatus) Reset()
func (*AttendanceStatus) String ¶
func (m *AttendanceStatus) String() string
type AyiHeaderV2 ¶
type AyiHeaderV2 struct { Version uint32 `protobuf:"varint,1,opt,name=version" json:"version,omitempty"` Token uint32 `protobuf:"varint,2,opt,name=token" json:"token,omitempty"` Type uint32 `protobuf:"varint,3,opt,name=type" json:"type,omitempty"` PayloadSize uint32 `protobuf:"varint,4,opt,name=payloadSize" json:"payloadSize,omitempty"` }
Header
func (*AyiHeaderV2) Descriptor ¶
func (*AyiHeaderV2) Descriptor() ([]byte, []int)
func (*AyiHeaderV2) GetSize ¶
func (h *AyiHeaderV2) GetSize() uint
func (*AyiHeaderV2) GetToken ¶
func (h *AyiHeaderV2) GetToken() uint16
func (*AyiHeaderV2) GetType ¶
func (h *AyiHeaderV2) GetType() PacketType
func (*AyiHeaderV2) GetVersion ¶
func (h *AyiHeaderV2) GetVersion() uint32
func (*AyiHeaderV2) ParseHeader ¶
func (h *AyiHeaderV2) ParseHeader(reader io.Reader) error
func (*AyiHeaderV2) ProtoMessage ¶
func (*AyiHeaderV2) ProtoMessage()
func (*AyiHeaderV2) Reset ¶
func (m *AyiHeaderV2) Reset()
func (*AyiHeaderV2) SetSize ¶
func (h *AyiHeaderV2) SetSize(size uint)
func (*AyiHeaderV2) SetToken ¶
func (h *AyiHeaderV2) SetToken(token uint16)
func (*AyiHeaderV2) SetType ¶
func (h *AyiHeaderV2) SetType(packet_type PacketType)
func (*AyiHeaderV2) SetVersion ¶
func (h *AyiHeaderV2) SetVersion(version uint32)
func (*AyiHeaderV2) String ¶
func (m *AyiHeaderV2) String() string
type AyiPacket ¶
An AyiPacket is a network container for a message
func ReadPacket ¶
Reads a packet from net.Conn. This function reads packets with header formated as v1 or v2.
func (*AyiPacket) DecodeMessage ¶
Decodes a packet in order to get a message. If the message is unknown a nil message is returned
func (*AyiPacket) HasPayload ¶
func (*AyiPacket) IsResponse ¶
func (*AyiPacket) ResponseId ¶
func (*AyiPacket) SetMessage ¶
func (*AyiPacket) Type ¶
func (packet *AyiPacket) Type() PacketType
type CancelEvent ¶
type CancelEvent struct { EventId int64 `protobuf:"varint,1,opt,name=event_id,json=eventId" json:"event_id,omitempty"` Reason string `protobuf:"bytes,2,opt,name=reason" json:"reason,omitempty"` }
CANCEL EVENT
func (*CancelEvent) Descriptor ¶
func (*CancelEvent) Descriptor() ([]byte, []int)
func (*CancelEvent) ProtoMessage ¶
func (*CancelEvent) ProtoMessage()
func (*CancelEvent) Reset ¶
func (m *CancelEvent) Reset()
func (*CancelEvent) String ¶
func (m *CancelEvent) String() string
type CancelUsersInvitation ¶
type CancelUsersInvitation struct { EventId int64 `protobuf:"varint,1,opt,name=event_id,json=eventId" json:"event_id,omitempty"` Participants []int64 `protobuf:"varint,2,rep,packed,name=participants" json:"participants,omitempty"` }
CANCEL USERS INVITATION
func (*CancelUsersInvitation) Descriptor ¶
func (*CancelUsersInvitation) Descriptor() ([]byte, []int)
func (*CancelUsersInvitation) ProtoMessage ¶
func (*CancelUsersInvitation) ProtoMessage()
func (*CancelUsersInvitation) Reset ¶
func (m *CancelUsersInvitation) Reset()
func (*CancelUsersInvitation) String ¶
func (m *CancelUsersInvitation) String() string
type ChangeAccepted ¶
type ChangeAccepted struct { EventId int64 `protobuf:"varint,1,opt,name=event_id,json=eventId" json:"event_id,omitempty"` ChangeId int32 `protobuf:"varint,2,opt,name=change_id,json=changeId" json:"change_id,omitempty"` }
CHANGE ACCEPTED
func (*ChangeAccepted) Descriptor ¶
func (*ChangeAccepted) Descriptor() ([]byte, []int)
func (*ChangeAccepted) ProtoMessage ¶
func (*ChangeAccepted) ProtoMessage()
func (*ChangeAccepted) Reset ¶
func (m *ChangeAccepted) Reset()
func (*ChangeAccepted) String ¶
func (m *ChangeAccepted) String() string
type ChangeDiscarded ¶
type ChangeDiscarded struct { EventId int64 `protobuf:"varint,1,opt,name=event_id,json=eventId" json:"event_id,omitempty"` ChangeId int32 `protobuf:"varint,2,opt,name=change_id,json=changeId" json:"change_id,omitempty"` }
CHANGE DISCARDED
func (*ChangeDiscarded) Descriptor ¶
func (*ChangeDiscarded) Descriptor() ([]byte, []int)
func (*ChangeDiscarded) ProtoMessage ¶
func (*ChangeDiscarded) ProtoMessage()
func (*ChangeDiscarded) Reset ¶
func (m *ChangeDiscarded) Reset()
func (*ChangeDiscarded) String ¶
func (m *ChangeDiscarded) String() string
type ConfirmAttendance ¶
type ConfirmAttendance struct { EventId int64 `protobuf:"varint,1,opt,name=event_id,json=eventId" json:"event_id,omitempty"` ActionCode core.AttendanceResponse `protobuf:"varint,2,opt,name=action_code,json=actionCode,enum=core.AttendanceResponse" json:"action_code,omitempty"` }
CONFIRM ATTENDANCE
func (*ConfirmAttendance) Descriptor ¶
func (*ConfirmAttendance) Descriptor() ([]byte, []int)
func (*ConfirmAttendance) ProtoMessage ¶
func (*ConfirmAttendance) ProtoMessage()
func (*ConfirmAttendance) Reset ¶
func (m *ConfirmAttendance) Reset()
func (*ConfirmAttendance) String ¶
func (m *ConfirmAttendance) String() string
type ConfirmFriendRequest ¶
type ConfirmFriendRequest struct { FriendId int64 `protobuf:"varint,1,opt,name=friend_id,json=friendId" json:"friend_id,omitempty"` Response ConfirmFriendRequest_FriendRequestResponse `protobuf:"varint,2,opt,name=response,enum=protocol.ConfirmFriendRequest_FriendRequestResponse" json:"response,omitempty"` }
CONFIRM FRIEND REQUEST
func (*ConfirmFriendRequest) Descriptor ¶
func (*ConfirmFriendRequest) Descriptor() ([]byte, []int)
func (*ConfirmFriendRequest) ProtoMessage ¶
func (*ConfirmFriendRequest) ProtoMessage()
func (*ConfirmFriendRequest) Reset ¶
func (m *ConfirmFriendRequest) Reset()
func (*ConfirmFriendRequest) String ¶
func (m *ConfirmFriendRequest) String() string
type ConfirmFriendRequest_FriendRequestResponse ¶
type ConfirmFriendRequest_FriendRequestResponse int32
const ( ConfirmFriendRequest_CANCEL ConfirmFriendRequest_FriendRequestResponse = 0 ConfirmFriendRequest_CONFIRM ConfirmFriendRequest_FriendRequestResponse = 1 )
func (ConfirmFriendRequest_FriendRequestResponse) EnumDescriptor ¶
func (ConfirmFriendRequest_FriendRequestResponse) EnumDescriptor() ([]byte, []int)
func (ConfirmFriendRequest_FriendRequestResponse) String ¶
func (x ConfirmFriendRequest_FriendRequestResponse) String() string
type CreateEvent ¶
type CreateEvent struct { Message string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"` CreatedDate int64 `protobuf:"varint,2,opt,name=created_date,json=createdDate" json:"created_date,omitempty"` StartDate int64 `protobuf:"varint,3,opt,name=start_date,json=startDate" json:"start_date,omitempty"` EndDate int64 `protobuf:"varint,4,opt,name=end_date,json=endDate" json:"end_date,omitempty"` Participants []int64 `protobuf:"varint,5,rep,packed,name=participants" json:"participants,omitempty"` Picture []byte `protobuf:"bytes,6,opt,name=picture,proto3" json:"picture,omitempty"` }
CREATE EVENT
func (*CreateEvent) Descriptor ¶
func (*CreateEvent) Descriptor() ([]byte, []int)
func (*CreateEvent) ProtoMessage ¶
func (*CreateEvent) ProtoMessage()
func (*CreateEvent) Reset ¶
func (m *CreateEvent) Reset()
func (*CreateEvent) String ¶
func (m *CreateEvent) String() string
type CreateFriendRequest ¶
type CreateFriendRequest struct {
Email string `protobuf:"bytes,1,opt,name=email" json:"email,omitempty"`
}
CREATE FRIEND REQUEST
func (*CreateFriendRequest) Descriptor ¶
func (*CreateFriendRequest) Descriptor() ([]byte, []int)
func (*CreateFriendRequest) ProtoMessage ¶
func (*CreateFriendRequest) ProtoMessage()
func (*CreateFriendRequest) Reset ¶
func (m *CreateFriendRequest) Reset()
func (*CreateFriendRequest) String ¶
func (m *CreateFriendRequest) String() string
type CreateUserAccount ¶
type CreateUserAccount struct { Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Email string `protobuf:"bytes,2,opt,name=email" json:"email,omitempty"` Password string `protobuf:"bytes,3,opt,name=password" json:"password,omitempty"` Phone string `protobuf:"bytes,4,opt,name=phone" json:"phone,omitempty"` Fbid string `protobuf:"bytes,5,opt,name=fbid" json:"fbid,omitempty"` Fbtoken string `protobuf:"bytes,6,opt,name=fbtoken" json:"fbtoken,omitempty"` Picture []byte `protobuf:"bytes,7,opt,name=picture,proto3" json:"picture,omitempty"` }
CREATE USER ACCOUNT
func (*CreateUserAccount) Descriptor ¶
func (*CreateUserAccount) Descriptor() ([]byte, []int)
func (*CreateUserAccount) ProtoMessage ¶
func (*CreateUserAccount) ProtoMessage()
func (*CreateUserAccount) Reset ¶
func (m *CreateUserAccount) Reset()
func (*CreateUserAccount) String ¶
func (m *CreateUserAccount) String() string
type Error ¶
type Error struct { Type uint32 `protobuf:"varint,1,opt,name=type" json:"type,omitempty"` Error int32 `protobuf:"varint,2,opt,name=error" json:"error,omitempty"` }
ERROR
func (*Error) Descriptor ¶
func (*Error) ProtoMessage ¶
func (*Error) ProtoMessage()
type EventCancelled ¶
type EventCancelled struct { WhoId int64 `protobuf:"varint,1,opt,name=who_id,json=whoId" json:"who_id,omitempty"` EventId int64 `protobuf:"varint,2,opt,name=event_id,json=eventId" json:"event_id,omitempty"` Reason string `protobuf:"bytes,3,opt,name=reason" json:"reason,omitempty"` Event *core.Event `protobuf:"bytes,4,opt,name=event" json:"event,omitempty"` }
EVENT CANCELLED
func (*EventCancelled) Descriptor ¶
func (*EventCancelled) Descriptor() ([]byte, []int)
func (*EventCancelled) GetEvent ¶
func (m *EventCancelled) GetEvent() *core.Event
func (*EventCancelled) ProtoMessage ¶
func (*EventCancelled) ProtoMessage()
func (*EventCancelled) Reset ¶
func (m *EventCancelled) Reset()
func (*EventCancelled) String ¶
func (m *EventCancelled) String() string
type EventChangeProposed ¶
type EventChangeProposed struct { EventId int64 `protobuf:"varint,1,opt,name=event_id,json=eventId" json:"event_id,omitempty"` ChangeId int32 `protobuf:"varint,2,opt,name=change_id,json=changeId" json:"change_id,omitempty"` StartDate int64 `protobuf:"varint,3,opt,name=start_date,json=startDate" json:"start_date,omitempty"` EndDate int64 `protobuf:"varint,4,opt,name=end_date,json=endDate" json:"end_date,omitempty"` Message string `protobuf:"bytes,5,opt,name=message" json:"message,omitempty"` }
EVENT CHANGE DATE PROPOSED EVENT CHANGE MESSAGE PROPOSED EVENT CHANGE PROPOSED
func (*EventChangeProposed) Descriptor ¶
func (*EventChangeProposed) Descriptor() ([]byte, []int)
func (*EventChangeProposed) ProtoMessage ¶
func (*EventChangeProposed) ProtoMessage()
func (*EventChangeProposed) Reset ¶
func (m *EventChangeProposed) Reset()
func (*EventChangeProposed) String ¶
func (m *EventChangeProposed) String() string
type EventExpired ¶
type EventExpired struct {
EventId int64 `protobuf:"varint,1,opt,name=event_id,json=eventId" json:"event_id,omitempty"`
}
EVENT EXPIRED
func (*EventExpired) Descriptor ¶
func (*EventExpired) Descriptor() ([]byte, []int)
func (*EventExpired) ProtoMessage ¶
func (*EventExpired) ProtoMessage()
func (*EventExpired) Reset ¶
func (m *EventExpired) Reset()
func (*EventExpired) String ¶
func (m *EventExpired) String() string
type EventListRequest ¶
type EventListRequest struct { StartWindow int64 `protobuf:"varint,1,opt,name=start_window,json=startWindow" json:"start_window,omitempty"` EndWindow int64 `protobuf:"varint,2,opt,name=end_window,json=endWindow" json:"end_window,omitempty"` UserCoordinates *core.Location `protobuf:"bytes,3,opt,name=user_coordinates,json=userCoordinates" json:"user_coordinates,omitempty"` RangeInMeters uint32 `protobuf:"varint,4,opt,name=range_in_meters,json=rangeInMeters" json:"range_in_meters,omitempty"` }
LIST AUTHORED EVENTS LIST PRIVATE EVENTS LIST PUBLIC EVENTS HISTORY AUTHORED EVENTS HISTORY PRIVATE EVENTS HISTORY PUBLIC EVENTS
func (*EventListRequest) Descriptor ¶
func (*EventListRequest) Descriptor() ([]byte, []int)
func (*EventListRequest) GetUserCoordinates ¶
func (m *EventListRequest) GetUserCoordinates() *core.Location
func (*EventListRequest) ProtoMessage ¶
func (*EventListRequest) ProtoMessage()
func (*EventListRequest) Reset ¶
func (m *EventListRequest) Reset()
func (*EventListRequest) String ¶
func (m *EventListRequest) String() string
type EventsList ¶
type EventsList struct { Event []*core.Event `protobuf:"bytes,1,rep,name=event" json:"event,omitempty"` StartWindow int64 `protobuf:"varint,2,opt,name=startWindow" json:"startWindow,omitempty"` EndWindow int64 `protobuf:"varint,3,opt,name=endWindow" json:"endWindow,omitempty"` }
EVENTS LIST
func (*EventsList) Descriptor ¶
func (*EventsList) Descriptor() ([]byte, []int)
func (*EventsList) GetEvent ¶
func (m *EventsList) GetEvent() []*core.Event
func (*EventsList) ProtoMessage ¶
func (*EventsList) ProtoMessage()
func (*EventsList) Reset ¶
func (m *EventsList) Reset()
func (*EventsList) String ¶
func (m *EventsList) String() string
type FriendRequestsList ¶
type FriendRequestsList struct {
FriendRequests []*core.FriendRequest `protobuf:"bytes,1,rep,name=friendRequests" json:"friendRequests,omitempty"`
}
FRIEND REQUESTS LIST
func (*FriendRequestsList) Descriptor ¶
func (*FriendRequestsList) Descriptor() ([]byte, []int)
func (*FriendRequestsList) GetFriendRequests ¶
func (m *FriendRequestsList) GetFriendRequests() []*core.FriendRequest
func (*FriendRequestsList) ProtoMessage ¶
func (*FriendRequestsList) ProtoMessage()
func (*FriendRequestsList) Reset ¶
func (m *FriendRequestsList) Reset()
func (*FriendRequestsList) String ¶
func (m *FriendRequestsList) String() string
type FriendsList ¶
type FriendsList struct {
Friends []*core.Friend `protobuf:"bytes,1,rep,name=friends" json:"friends,omitempty"`
}
FRIENDS LIST
func (*FriendsList) Descriptor ¶
func (*FriendsList) Descriptor() ([]byte, []int)
func (*FriendsList) GetFriends ¶
func (m *FriendsList) GetFriends() []*core.Friend
func (*FriendsList) ProtoMessage ¶
func (*FriendsList) ProtoMessage()
func (*FriendsList) Reset ¶
func (m *FriendsList) Reset()
func (*FriendsList) String ¶
func (m *FriendsList) String() string
type GroupsList ¶
type GroupsList struct {
Groups []*core.Group `protobuf:"bytes,1,rep,name=groups" json:"groups,omitempty"`
}
GROUPS LIST
func (*GroupsList) Descriptor ¶
func (*GroupsList) Descriptor() ([]byte, []int)
func (*GroupsList) GetGroups ¶
func (m *GroupsList) GetGroups() []*core.Group
func (*GroupsList) ProtoMessage ¶
func (*GroupsList) ProtoMessage()
func (*GroupsList) Reset ¶
func (m *GroupsList) Reset()
func (*GroupsList) String ¶
func (m *GroupsList) String() string
type Hello ¶
type Hello struct { ProtocolVersion uint32 `protobuf:"varint,1,opt,name=protocol_version,json=protocolVersion" json:"protocol_version,omitempty"` ClientVersion string `protobuf:"bytes,2,opt,name=client_version,json=clientVersion" json:"client_version,omitempty"` Platform string `protobuf:"bytes,3,opt,name=platform" json:"platform,omitempty"` PlatformVersion string `protobuf:"bytes,4,opt,name=platform_version,json=platformVersion" json:"platform_version,omitempty"` Language string `protobuf:"bytes,5,opt,name=language" json:"language,omitempty"` }
Hello
func (*Hello) Descriptor ¶
func (*Hello) ProtoMessage ¶
func (*Hello) ProtoMessage()
type InstanceIDToken ¶
type InstanceIDToken struct {
Token string `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"`
}
INSTANCE ID TOKEN
func (*InstanceIDToken) Descriptor ¶
func (*InstanceIDToken) Descriptor() ([]byte, []int)
func (*InstanceIDToken) ProtoMessage ¶
func (*InstanceIDToken) ProtoMessage()
func (*InstanceIDToken) Reset ¶
func (m *InstanceIDToken) Reset()
func (*InstanceIDToken) String ¶
func (m *InstanceIDToken) String() string
type InvitationCancelled ¶
type InvitationCancelled struct {
EventId int64 `protobuf:"varint,1,opt,name=event_id,json=eventId" json:"event_id,omitempty"`
}
INVITATION CANCELLED
func (*InvitationCancelled) Descriptor ¶
func (*InvitationCancelled) Descriptor() ([]byte, []int)
func (*InvitationCancelled) ProtoMessage ¶
func (*InvitationCancelled) ProtoMessage()
func (*InvitationCancelled) Reset ¶
func (m *InvitationCancelled) Reset()
func (*InvitationCancelled) String ¶
func (m *InvitationCancelled) String() string
type InviteUsers ¶
type InviteUsers struct { EventId int64 `protobuf:"varint,1,opt,name=event_id,json=eventId" json:"event_id,omitempty"` Participants []int64 `protobuf:"varint,2,rep,packed,name=participants" json:"participants,omitempty"` }
INVITE USERS
func (*InviteUsers) Descriptor ¶
func (*InviteUsers) Descriptor() ([]byte, []int)
func (*InviteUsers) ProtoMessage ¶
func (*InviteUsers) ProtoMessage()
func (*InviteUsers) Reset ¶
func (m *InviteUsers) Reset()
func (*InviteUsers) String ¶
func (m *InviteUsers) String() string
type LinkAccount ¶
type LinkAccount struct { UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId" json:"user_id,omitempty"` Provider core.AccountProviderType `protobuf:"varint,2,opt,name=provider,enum=core.AccountProviderType" json:"provider,omitempty"` AccountId string `protobuf:"bytes,3,opt,name=account_id,json=accountId" json:"account_id,omitempty"` AccountToken string `protobuf:"bytes,4,opt,name=account_token,json=accountToken" json:"account_token,omitempty"` }
LINK ACCOUNT
func (*LinkAccount) Descriptor ¶
func (*LinkAccount) Descriptor() ([]byte, []int)
func (*LinkAccount) ProtoMessage ¶
func (*LinkAccount) ProtoMessage()
func (*LinkAccount) Reset ¶
func (m *LinkAccount) Reset()
func (*LinkAccount) String ¶
func (m *LinkAccount) String() string
type MessageBuilder ¶
type MessageBuilder interface { NewAccessToken(userId int64, authToken string) *AyiPacket EventCreated(event *core.Event) *AyiPacket EventCancelled(who_id int64, event *core.Event) *AyiPacket EventExpired(event_id int64) *AyiPacket EventModified(event *core.Event) *AyiPacket InvitationReceived(event *core.Event) *AyiPacket AttendanceStatus(event_id int64, participants map[int64]*core.EventParticipant) *AyiPacket AttendanceStatusWithNumGuests(event_id int64, status map[int64]*core.EventParticipant, num_guests int) *AyiPacket UserAccessGranted(user_id int64, auth_token string) *AyiPacket Ok(msg_type PacketType) *AyiPacket Error(msg_type PacketType, error_code int32) *AyiPacket Ping() *AyiPacket Pong() *AyiPacket Event(event *core.Event) *AyiPacket EventsList(events_list []*core.Event) *AyiPacket EventsHistoryList(events_list []*core.Event, startWindow int64, endWindow int64) *AyiPacket FriendsList(friends_list []*core.Friend) *AyiPacket FacebookFriendsList(friends_list []*core.Friend) *AyiPacket ClockResponse() *AyiPacket UserAccount(user *core.UserAccount) *AyiPacket GroupsList(groups_list []*core.Group) *AyiPacket FriendRequestReceived(request *core.FriendRequest) *AyiPacket FriendRequestsList(requests_list []*core.FriendRequest) *AyiPacket }
Interface
type ModifyEvent ¶
type ModifyEvent struct { EventId int64 `protobuf:"varint,1,opt,name=event_id,json=eventId" json:"event_id,omitempty"` Message string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` StartDate int64 `protobuf:"varint,3,opt,name=start_date,json=startDate" json:"start_date,omitempty"` EndDate int64 `protobuf:"varint,4,opt,name=end_date,json=endDate" json:"end_date,omitempty"` Picture []byte `protobuf:"bytes,5,opt,name=picture,proto3" json:"picture,omitempty"` RemovePicture bool `protobuf:"varint,6,opt,name=remove_picture,json=removePicture" json:"remove_picture,omitempty"` ModifyDate int64 `protobuf:"varint,7,opt,name=modify_date,json=modifyDate" json:"modify_date,omitempty"` Participants []int64 `protobuf:"varint,8,rep,packed,name=participants" json:"participants,omitempty"` }
MODIFY EVENT DATE MODIFY EVENT MESSAGE MODIFY EVENT
func (*ModifyEvent) Descriptor ¶
func (*ModifyEvent) Descriptor() ([]byte, []int)
func (*ModifyEvent) ProtoMessage ¶
func (*ModifyEvent) ProtoMessage()
func (*ModifyEvent) Reset ¶
func (m *ModifyEvent) Reset()
func (*ModifyEvent) String ¶
func (m *ModifyEvent) String() string
type NewAuthToken ¶
type NewAuthToken struct { Pass1 string `protobuf:"bytes,1,opt,name=pass1" json:"pass1,omitempty"` Pass2 string `protobuf:"bytes,2,opt,name=pass2" json:"pass2,omitempty"` Type AuthType `protobuf:"varint,3,opt,name=type,enum=protocol.AuthType" json:"type,omitempty"` }
func (*NewAuthToken) Descriptor ¶
func (*NewAuthToken) Descriptor() ([]byte, []int)
func (*NewAuthToken) ProtoMessage ¶
func (*NewAuthToken) ProtoMessage()
func (*NewAuthToken) Reset ¶
func (m *NewAuthToken) Reset()
func (*NewAuthToken) String ¶
func (m *NewAuthToken) String() string
type Ok ¶
type Ok struct { Type uint32 `protobuf:"varint,1,opt,name=type" json:"type,omitempty"` Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` }
OK
func (*Ok) Descriptor ¶
func (*Ok) ProtoMessage ¶
func (*Ok) ProtoMessage()
type PacketBuilder ¶
type PacketBuilder struct {
// contains filtered or unexported fields
}
func NewPacket ¶
func NewPacket(version uint8) *PacketBuilder
func (*PacketBuilder) AttendanceStatus ¶
func (mb *PacketBuilder) AttendanceStatus(event_id int64, participants map[int64]*core.EventParticipant) *AyiPacket
func (*PacketBuilder) AttendanceStatusWithNumGuests ¶
func (mb *PacketBuilder) AttendanceStatusWithNumGuests(event_id int64, participants map[int64]*core.EventParticipant, num_guests int) *AyiPacket
func (*PacketBuilder) ClockResponse ¶
func (mb *PacketBuilder) ClockResponse() *AyiPacket
func (*PacketBuilder) Error ¶
func (mb *PacketBuilder) Error(msg_type PacketType, error_code int32) *AyiPacket
func (*PacketBuilder) Event ¶
func (mb *PacketBuilder) Event(event *core.Event) *AyiPacket
Create an Event message with all its information, including participants information
func (*PacketBuilder) EventCancelled ¶
func (mb *PacketBuilder) EventCancelled(who_id int64, event *core.Event) *AyiPacket
func (*PacketBuilder) EventCreated ¶
func (mb *PacketBuilder) EventCreated(event *core.Event) *AyiPacket
Notifications
func (*PacketBuilder) EventExpired ¶
func (mb *PacketBuilder) EventExpired(event_id int64) *AyiPacket
func (*PacketBuilder) EventModified ¶
func (mb *PacketBuilder) EventModified(event *core.Event) *AyiPacket
func (*PacketBuilder) EventsHistoryList ¶
func (*PacketBuilder) EventsList ¶
func (mb *PacketBuilder) EventsList(events_list []*core.Event) *AyiPacket
Create a List of events
func (*PacketBuilder) FacebookFriendsList ¶
func (mb *PacketBuilder) FacebookFriendsList(friends_list []*core.Friend) *AyiPacket
func (*PacketBuilder) FriendRequestReceived ¶
func (mb *PacketBuilder) FriendRequestReceived(request *core.FriendRequest) *AyiPacket
func (*PacketBuilder) FriendRequestsList ¶
func (mb *PacketBuilder) FriendRequestsList(requests_list []*core.FriendRequest) *AyiPacket
func (*PacketBuilder) FriendsList ¶
func (mb *PacketBuilder) FriendsList(friends_list []*core.Friend) *AyiPacket
func (*PacketBuilder) GroupsList ¶
func (mb *PacketBuilder) GroupsList(groups_list []*core.Group) *AyiPacket
func (*PacketBuilder) InvitationReceived ¶
func (mb *PacketBuilder) InvitationReceived(event *core.Event) *AyiPacket
func (*PacketBuilder) NewAccessToken ¶
func (mb *PacketBuilder) NewAccessToken(user_id int64, auth_token string) *AyiPacket
func (*PacketBuilder) Ok ¶
func (mb *PacketBuilder) Ok(msg_type PacketType) *AyiPacket
func (*PacketBuilder) UserAccessGranted ¶
func (mb *PacketBuilder) UserAccessGranted(user_id int64, auth_token string) *AyiPacket
func (*PacketBuilder) UserAccount ¶
func (mb *PacketBuilder) UserAccount(user *core.UserAccount) *AyiPacket
type PacketType ¶
type PacketType uint8
const ( M_CREATE_EVENT PacketType = 0x00 + iota M_CANCEL_EVENT M_INVITE_USERS M_CANCEL_USERS_INVITATION M_CONFIRM_ATTENDANCE M_MODIFY_EVENT_DATE M_MODIFY_EVENT_MESSAGE M_MODIFY_EVENT M_VOTE_CHANGE M_USER_POSITION M_USER_POSITION_RANGE M_USER_CREATE_ACCOUNT M_USER_NEW_AUTH_TOKEN M_USER_AUTH M_CHANGE_PROFILE_PICTURE M_CHANGE_EVENT_PICTURE M_SYNC_GROUPS M_CREATE_FRIEND_REQUEST M_CONFIRM_FRIEND_REQUEST M_USER_LINK_ACCOUNT M_IMPORT_FACEBOOK_FRIENDS M_SET_FACEBOOK_ACCESS_TOKEN M_HELLO = 0x3D M_IID_TOKEN = 0x3E M_USE_TLS = 0x3F )
Modifiers
const ( M_EVENT_CREATED PacketType = 0x40 + iota M_EVENT_CANCELLED M_EVENT_EXPIRED M_EVENT_DATE_MODIFIED M_EVENT_MESSAGE_MODIFIED M_EVENT_MODIFIED M_INVITATION_RECEIVED M_INVITATION_CANCELLED M_ATTENDANCE_STATUS M_EVENT_CHANGE_DATE_PROPOSED M_EVENT_CHANGE_MESSAGE_PROPOSED M_EVENT_CHANGE_PROPOSED M_VOTING_STATUS M_VOTING_FINISHED M_CHANGE_ACCEPTED M_CHANGE_DISCARDED M_ACCESS_GRANTED M_FRIEND_REQUEST_RECEIVED M_OK = 0x7E M_ERROR = 0x7F )
Notifications
const ( M_PING PacketType = 0x80 + iota M_READ_EVENT M_LIST_AUTHORED_EVENTS M_LIST_PRIVATE_EVENTS M_LIST_PUBLIC_EVENTS M_HISTORY_AUTHORED_EVENTS M_HISTORY_PRIVATE_EVENTS M_HISTORY_PUBLIC_EVENTS M_GET_USER_FRIENDS M_CLOCK_REQUEST M_GET_USER_ACCOUNT M_GET_ACCESS_TOKEN M_GET_GROUPS M_GET_FRIEND_REQUESTS M_GET_FACEBOOK_FRIENDS )
Requests
const ( M_PONG PacketType = 0xC0 + iota M_EVENT M_EVENTS_LIST M_FRIENDS_LIST M_CLOCK_RESPONSE M_USER_ACCOUNT M_ACCESS_TOKEN M_GROUPS_LIST M_EVENTS_HISTORY_LIST M_FRIEND_REQUESTS_LIST M_FACEBOOK_FRIENDS_LIST )
Responses
type ReadEvent ¶
type ReadEvent struct {
EventId int64 `protobuf:"varint,1,opt,name=event_id,json=eventId" json:"event_id,omitempty"`
}
READ EVENT
func (*ReadEvent) Descriptor ¶
func (*ReadEvent) ProtoMessage ¶
func (*ReadEvent) ProtoMessage()
type SyncGroups ¶
type SyncGroups struct { Owner int64 `protobuf:"varint,1,opt,name=owner" json:"owner,omitempty"` Groups []*core.Group `protobuf:"bytes,2,rep,name=groups" json:"groups,omitempty"` SyncBehaviour core.SyncBehaviour `protobuf:"varint,3,opt,name=sync_behaviour,json=syncBehaviour,enum=core.SyncBehaviour" json:"sync_behaviour,omitempty"` }
SYNC GROUPS
func (*SyncGroups) Descriptor ¶
func (*SyncGroups) Descriptor() ([]byte, []int)
func (*SyncGroups) GetGroups ¶
func (m *SyncGroups) GetGroups() []*core.Group
func (*SyncGroups) ProtoMessage ¶
func (*SyncGroups) ProtoMessage()
func (*SyncGroups) Reset ¶
func (m *SyncGroups) Reset()
func (*SyncGroups) String ¶
func (m *SyncGroups) String() string
type TimeInfo ¶
type TimeInfo struct {
CurrentTime int64 `protobuf:"varint,1,opt,name=current_time,json=currentTime" json:"current_time,omitempty"`
}
PING/PONG/CLOCK_RESPONSE
func (*TimeInfo) Descriptor ¶
func (*TimeInfo) ProtoMessage ¶
func (*TimeInfo) ProtoMessage()
type UserPosition ¶
type UserPosition struct { GlobalCoordinates *core.Location `protobuf:"bytes,1,opt,name=global_coordinates,json=globalCoordinates" json:"global_coordinates,omitempty"` EstimationError float32 `protobuf:"fixed32,2,opt,name=estimation_error,json=estimationError" json:"estimation_error,omitempty"` }
USER POSITION
func (*UserPosition) Descriptor ¶
func (*UserPosition) Descriptor() ([]byte, []int)
func (*UserPosition) GetGlobalCoordinates ¶
func (m *UserPosition) GetGlobalCoordinates() *core.Location
func (*UserPosition) ProtoMessage ¶
func (*UserPosition) ProtoMessage()
func (*UserPosition) Reset ¶
func (m *UserPosition) Reset()
func (*UserPosition) String ¶
func (m *UserPosition) String() string
type UserPositionRange ¶
type UserPositionRange struct {
RangeInMeters float32 `protobuf:"fixed32,1,opt,name=range_in_meters,json=rangeInMeters" json:"range_in_meters,omitempty"`
}
USER POSITION RANGE
func (*UserPositionRange) Descriptor ¶
func (*UserPositionRange) Descriptor() ([]byte, []int)
func (*UserPositionRange) ProtoMessage ¶
func (*UserPositionRange) ProtoMessage()
func (*UserPositionRange) Reset ¶
func (m *UserPositionRange) Reset()
func (*UserPositionRange) String ¶
func (m *UserPositionRange) String() string
type VoteChange ¶
type VoteChange struct { EventId int64 `protobuf:"varint,1,opt,name=event_id,json=eventId" json:"event_id,omitempty"` ChangeId int32 `protobuf:"varint,2,opt,name=change_id,json=changeId" json:"change_id,omitempty"` AcceptChange bool `protobuf:"varint,3,opt,name=accept_change,json=acceptChange" json:"accept_change,omitempty"` }
VOTE CHANGE
func (*VoteChange) Descriptor ¶
func (*VoteChange) Descriptor() ([]byte, []int)
func (*VoteChange) ProtoMessage ¶
func (*VoteChange) ProtoMessage()
func (*VoteChange) Reset ¶
func (m *VoteChange) Reset()
func (*VoteChange) String ¶
func (m *VoteChange) String() string
type VotingStatus ¶
type VotingStatus struct { EventId int64 `protobuf:"varint,1,opt,name=event_id,json=eventId" json:"event_id,omitempty"` ChangeId int32 `protobuf:"varint,2,opt,name=change_id,json=changeId" json:"change_id,omitempty"` StartDate int64 `protobuf:"varint,3,opt,name=start_date,json=startDate" json:"start_date,omitempty"` EndDate int64 `protobuf:"varint,4,opt,name=end_date,json=endDate" json:"end_date,omitempty"` ElapsedTime int64 `protobuf:"varint,5,opt,name=elapsed_time,json=elapsedTime" json:"elapsed_time,omitempty"` VotesReceived uint32 `protobuf:"varint,6,opt,name=votes_received,json=votesReceived" json:"votes_received,omitempty"` VotesTotal uint32 `protobuf:"varint,7,opt,name=votes_total,json=votesTotal" json:"votes_total,omitempty"` Finished bool `protobuf:"varint,8,opt,name=finished" json:"finished,omitempty"` }
VOTING STATUS VOTING FINISHED
func (*VotingStatus) Descriptor ¶
func (*VotingStatus) Descriptor() ([]byte, []int)
func (*VotingStatus) ProtoMessage ¶
func (*VotingStatus) ProtoMessage()
func (*VotingStatus) Reset ¶
func (m *VotingStatus) Reset()
func (*VotingStatus) String ¶
func (m *VotingStatus) String() string