Documentation
¶
Index ¶
- Constants
- Variables
- func FriendKeys(m []*Friend) []int64
- func GetDateOption(option DateOption, fromDate time.Time) time.Time
- func IsValidDescription(description string) bool
- func IsValidEndDate(endDate time.Time, referenceDate time.Time) bool
- func IsValidName(name string) bool
- func IsValidPassword(password string) bool
- func IsValidStartDate(startDate time.Time, referenceDate time.Time) bool
- func ParticipantMapKeys(m map[int64]*Participant) []int64
- func UserMapKeys(m map[int64]*UserAccount) []int64
- type AccessToken
- type AccountManager
- func (self *AccountManager) AuthenticateUser(userId int64, authToken string) (bool, error)
- func (m *AccountManager) ChangePassword(user *UserAccount, newPassword string) error
- func (self *AccountManager) ChangeProfilePicture(user *UserAccount, picture []byte) error
- func (m *AccountManager) CreateUserAccount(name string, email string, password string, phone string, fbId string, ...) (*UserAccount, error)
- func (m *AccountManager) GetActiveSessions(forDay time.Time) ([]*api.ActiveSessionInfoDTO, error)
- func (self *AccountManager) GetPushToken(userId int64) (*IIDToken, error)
- func (self *AccountManager) GetUserAccount(userId int64) (*UserAccount, error)
- func (self *AccountManager) GetUserAccountByEmail(email string) (*UserAccount, error)
- func (self *AccountManager) GetUserAccountByFacebook(fbId string) (*UserAccount, error)
- func (self *AccountManager) LinkToFacebook(account *UserAccount, fbId string, fbToken string) error
- func (self *AccountManager) NewAuthCredentialByEmailAndPassword(email string, password string) (*AccessToken, error)
- func (m *AccountManager) NewAuthCredentialByFacebook(fbId string, fbToken string) (*AccessToken, error)
- func (m *AccountManager) NewImageAccessToken(userID int64) (*AccessToken, error)
- func (m *AccountManager) Observe() observer.Stream
- func (m *AccountManager) RefreshSessionActivity(userId int64) error
- func (m *AccountManager) SetFacebookAccessToken(user *UserAccount, accessToken string) error
- func (m *AccountManager) SetPushToken(userID int64, pushToken *IIDToken) error
- type AyiModel
- type DateOption
- type EmailCredential
- type Event
- func (e *Event) AsDTO() *api.EventDTO
- func (e *Event) AuthorID() int64
- func (e *Event) AuthorName() string
- func (e *Event) Clone() *Event
- func (e *Event) CloneWithEmptyParticipants() *Event
- func (e *Event) CreatedDate() time.Time
- func (e *Event) Description() string
- func (e *Event) EndDate() time.Time
- func (e *Event) Equal(other *Event) bool
- func (e *Event) Id() int64
- func (e *Event) InboxPosition() time.Time
- func (e *Event) IsCancelled() bool
- func (e *Event) IsZero() bool
- func (e *Event) ModifiedDate() time.Time
- func (e *Event) NumAttendees() int
- func (e *Event) NumGuests() int
- func (e *Event) PictureDigest() []byte
- func (e *Event) StartDate() time.Time
- func (e *Event) Status() api.EventState
- func (e *Event) Timestamp() int64
- func (e *Event) Title() string
- type EventBuilder
- type EventManager
- func (m *EventManager) BuildEventsHistory() error
- func (m *EventManager) BuildEventsTimeLine() error
- func (m *EventManager) ChangeDeliveryState(userID int64, state api.InvitationStatus, event *Event) (*Participant, error)
- func (m *EventManager) ChangeEventPicture(event *Event, picture []byte) error
- func (m *EventManager) ChangeParticipantResponse(eventID int64, userID int64, response api.AttendanceResponse) (*Participant, error)
- func (m *EventManager) ExtractNewParticipants(extractEvent *Event, baseEvent *Event) map[int64]*Participant
- func (m *EventManager) GetEventForUser(userID int64, eventID int64) (*Event, error)
- func (m *EventManager) GetEventsHistory(userID int64, start time.Time, end time.Time) ([]*Event, error)
- func (m *EventManager) GetRecentEvents(userID int64) ([]*Event, error)
- func (m *EventManager) LoadEvent(eventID int64) (*Event, error)
- func (m *EventManager) NewEvent(author *UserAccount, createdDate time.Time, startDate time.Time, ...) (*Event, error)
- func (m *EventManager) NewEventModifier(event *Event, ownerID int64) EventModifier
- func (m *EventManager) NewParticipantModifier(p *Participant) ParticipantModifier
- func (m *EventManager) Observe() observer.Stream
- func (m *EventManager) RemoveFromInbox(userID int64, eventID int64)
- func (m *EventManager) SaveEvent(event *Event) error
- type EventModifier
- type FBCredential
- type Friend
- type FriendManager
- func (m *FriendManager) AddGroups(userID int64, groups []*Group) error
- func (m *FriendManager) AreFriends(user1 int64, user2 int64) (bool, error)
- func (m *FriendManager) ConfirmFriendRequest(fromUser *UserAccount, toUser *UserAccount, accept bool) error
- func (m *FriendManager) CreateFriendRequest(fromUser *UserAccount, toUser *UserAccount) (*FriendRequest, error)
- func (m *FriendManager) DeleteGroup(userID int64, groupID int32) error
- func (m *FriendManager) GetAllFriendRequests(toUser int64) ([]*FriendRequest, error)
- func (self *FriendManager) GetAllFriends(userID int64) ([]*Friend, error)
- func (m *FriendManager) GetAllGroups(userID int64) ([]*Group, error)
- func (m *FriendManager) GetFacebookFriends(user *UserAccount) ([]*UserAccount, error)
- func (m *FriendManager) GetNewFacebookFriends(user *UserAccount) ([]*UserAccount, error)
- func (m *FriendManager) ImportFacebookFriends(user *UserAccount, initialImport bool) ([]*UserAccount, error)
- func (m *FriendManager) IsFriend(user1 int64, user2 int64) (bool, error)
- func (m *FriendManager) MakeFriends(user1 *UserAccount, user2 *UserAccount) error
- func (m *FriendManager) Observe() observer.Stream
- func (m *FriendManager) RenameGroup(userID int64, groupID int32, newName string) error
- type FriendRequest
- type Group
- type GroupBuilder
- type IIDToken
- type ModelsMap
- type Participant
- func (p *Participant) AsDTO() *api.ParticipantDTO
- func (p *Participant) Clone() *Participant
- func (p *Participant) Equal(other *Participant) bool
- func (p *Participant) EventID() int64
- func (p *Participant) Id() int64
- func (p *Participant) InvitationStatus() api.InvitationStatus
- func (p *Participant) Name() string
- func (p *Participant) Response() api.AttendanceResponse
- type ParticipantAdder
- type ParticipantList
- func (l *ParticipantList) AsSlice() []*Participant
- func (l *ParticipantList) Clone() *ParticipantList
- func (l *ParticipantList) Equal(other *ParticipantList) bool
- func (l *ParticipantList) Get(id int64) (*Participant, bool)
- func (l *ParticipantList) Ids() []int64
- func (l *ParticipantList) NumAttendees() int
- func (l *ParticipantList) NumGuests() int
- type ParticipantModifier
- type Picture
- type Signal
- type SignalType
- type UserAccount
- func (u *UserAccount) AsDTO() *api.UserDTO
- func (u *UserAccount) AsFriend() *Friend
- func (u *UserAccount) AsParticipant() *Participant
- func (u *UserAccount) AuthToken() string
- func (u *UserAccount) Clone() *UserAccount
- func (u *UserAccount) CreatedDate() int64
- func (u *UserAccount) Email() string
- func (u *UserAccount) FbId() string
- func (u *UserAccount) FbToken() string
- func (u *UserAccount) HasFacebook() bool
- func (u *UserAccount) Id() int64
- func (u *UserAccount) IsZero() bool
- func (u *UserAccount) Name() string
- func (u *UserAccount) PictureDigest() []byte
- func (u *UserAccount) PushToken() IIDToken
- type UserEvents
Constants ¶
const ( // User account UserPasswordMinLength = 5 UserPasswordMaxLength = 50 UserNameMinLength = 3 UserNameMaxLength = 50 UserPictureMaxWidth = 512 UserPictureMaxHeight = 512 )
const ( MinimumStartDate = DateOption(0) MaximumStartDate = DateOption(1) MinimumEndDate = DateOption(2) MaximumEndDate = DateOption(3) )
DateOption values
Variables ¶
var ( ErrNotFound = api.ErrNotFound // User Account ErrInvalidEmail = errors.New("invalid e-mail address") ErrInvalidName = errors.New("invalid user name") ErrInvalidPassword = errors.New("password is too short") ErrNoCredentials = errors.New("no credentials") // Event ErrInvalidEvent = errors.New("event is invalid") ErrInvalidOwner = errors.New("invalid owner") ErrInvalidAuthor = errors.New("invalid author") ErrInvalidParticipant = errors.New("invalid participant") ErrInvalidDescription = errors.New("invalid event description") ErrInvalidStartDate = errors.New("invalid start date") ErrInvalidEndDate = errors.New("invalid end date") ErrParticipantsRequired = errors.New("participants required") ErrCannotArchive = errors.New("cannot archive event") ErrModelInitError = errors.New("model init error") ErrModelAlreadyExist = errors.New("cannot register model because it already exists") ErrModelNotFound = errors.New("model not found") ErrModelInconsistency = errors.New("Model has an inconsistency that requires admin fixes") ErrImageOutOfBounds = errors.New("image is out of bounds") ErrInvalidUserOrPassword = errors.New("invalid user or password") ErrEventOutOfCreationWindow = errors.New("event out of allowed creation window") ErrEventNotWritable = errors.New("event isn't writable") ErrParticipantNotFound = errors.New("participant not found") ErrEmptyInbox = errors.New("user inbox is empty") ErrAlreadyFriends = errors.New("already friends") ErrFriendRequestAlreadyExist = errors.New("friend request already exists") ErrAccountNotLinkedToFacebook = errors.New("account isn't linked to facebook") ErrIllegalArgument = errors.New("illegal argument") ErrMissingArgument = errors.New("missing arguments") ErrNotImplemented = errors.New("Method not implemented") )
Functions ¶
func FriendKeys ¶
func GetDateOption ¶
func GetDateOption(option DateOption, fromDate time.Time) time.Time
func IsValidDescription ¶
func IsValidName ¶
func IsValidPassword ¶
func ParticipantMapKeys ¶
func ParticipantMapKeys(m map[int64]*Participant) []int64
func UserMapKeys ¶
func UserMapKeys(m map[int64]*UserAccount) []int64
Types ¶
type AccessToken ¶
type AccessToken struct {
// contains filtered or unexported fields
}
func (*AccessToken) AsDTO ¶
func (t *AccessToken) AsDTO() *api.AccessTokenDTO
func (*AccessToken) Token ¶
func (t *AccessToken) Token() string
func (*AccessToken) UserID ¶
func (t *AccessToken) UserID() int64
type AccountManager ¶
type AccountManager struct {
// contains filtered or unexported fields
}
func (*AccountManager) AuthenticateUser ¶
func (self *AccountManager) AuthenticateUser(userId int64, authToken string) (bool, error)
func (*AccountManager) ChangePassword ¶
func (m *AccountManager) ChangePassword(user *UserAccount, newPassword string) error
func (*AccountManager) ChangeProfilePicture ¶
func (self *AccountManager) ChangeProfilePicture(user *UserAccount, picture []byte) error
Change profile picture in order to let user's friends to see the new picture
func (*AccountManager) CreateUserAccount ¶
func (m *AccountManager) CreateUserAccount(name string, email string, password string, phone string, fbId string, fbToken string) (*UserAccount, error)
Prominent Errors: - ErrInvalidName - ErrInvalidEmail - ErrInvalidPassword - ErrNoCredentials - facebook.ErrFacebookAccessForbidden
func (*AccountManager) GetActiveSessions ¶
func (m *AccountManager) GetActiveSessions(forDay time.Time) ([]*api.ActiveSessionInfoDTO, error)
func (*AccountManager) GetPushToken ¶
func (self *AccountManager) GetPushToken(userId int64) (*IIDToken, error)
func (*AccountManager) GetUserAccount ¶
func (self *AccountManager) GetUserAccount(userId int64) (*UserAccount, error)
func (*AccountManager) GetUserAccountByEmail ¶
func (self *AccountManager) GetUserAccountByEmail(email string) (*UserAccount, error)
func (*AccountManager) GetUserAccountByFacebook ¶
func (self *AccountManager) GetUserAccountByFacebook(fbId string) (*UserAccount, error)
func (*AccountManager) LinkToFacebook ¶
func (self *AccountManager) LinkToFacebook(account *UserAccount, fbId string, fbToken string) error
func (*AccountManager) NewAuthCredentialByEmailAndPassword ¶
func (self *AccountManager) NewAuthCredentialByEmailAndPassword(email string, password string) (*AccessToken, error)
Prominent Errors: - ErrInvalidUserOrPassword - Others (except dao.ErrNotFound)
func (*AccountManager) NewAuthCredentialByFacebook ¶
func (m *AccountManager) NewAuthCredentialByFacebook(fbId string, fbToken string) (*AccessToken, error)
Prominent Errors: - fb.ErrFacebookAccessForbidden - ErrInvalidUserOrPassword - ErrModelInconsistency - Others (except dao.ErrNotFound)
func (*AccountManager) NewImageAccessToken ¶
func (m *AccountManager) NewImageAccessToken(userID int64) (*AccessToken, error)
func (*AccountManager) Observe ¶
func (m *AccountManager) Observe() observer.Stream
func (*AccountManager) RefreshSessionActivity ¶
func (m *AccountManager) RefreshSessionActivity(userId int64) error
func (*AccountManager) SetFacebookAccessToken ¶
func (m *AccountManager) SetFacebookAccessToken(user *UserAccount, accessToken string) error
func (*AccountManager) SetPushToken ¶
func (m *AccountManager) SetPushToken(userID int64, pushToken *IIDToken) error
type AyiModel ¶
type AyiModel struct { sync.RWMutex Accounts *AccountManager Events *EventManager Friends *FriendManager // contains filtered or unexported fields }
func (*AyiModel) GetClosestDpi ¶
func (*AyiModel) StartBackgroundTasks ¶
func (m *AyiModel) StartBackgroundTasks()
Start init background and start tasks required for this model to work over time
type EmailCredential ¶
type Event ¶
type Event struct { Participants *ParticipantList // contains filtered or unexported fields }
func (*Event) AuthorName ¶
func (*Event) CloneWithEmptyParticipants ¶
func (*Event) CreatedDate ¶
func (*Event) Description ¶
func (*Event) InboxPosition ¶
func (*Event) IsCancelled ¶
func (*Event) ModifiedDate ¶
func (*Event) NumAttendees ¶
func (*Event) PictureDigest ¶
func (*Event) Status ¶
func (e *Event) Status() api.EventState
type EventBuilder ¶
type EventBuilder interface { SetAuthor(author *UserAccount) EventBuilder SetCreatedDate(date time.Time) EventBuilder SetStartDate(date time.Time) EventBuilder SetEndDate(date time.Time) EventBuilder SetDescription(desc string) EventBuilder ParticipantAdder() ParticipantAdder Build() (*Event, error) }
type EventManager ¶
type EventManager struct {
// contains filtered or unexported fields
}
func (*EventManager) BuildEventsHistory ¶
func (m *EventManager) BuildEventsHistory() error
func (*EventManager) BuildEventsTimeLine ¶
func (m *EventManager) BuildEventsTimeLine() error
func (*EventManager) ChangeDeliveryState ¶
func (m *EventManager) ChangeDeliveryState(userID int64, state api.InvitationStatus, event *Event) (*Participant, error)
Assumptions: - (1) User who performs this operation has permissions
Preconditions: - (1) Event is valid and persisted - (2) Event must have not started - (3) User must have received this invitation, i.e. user is in event participant list
func (*EventManager) ChangeEventPicture ¶
func (m *EventManager) ChangeEventPicture(event *Event, picture []byte) error
Change event picture
Assumptions: - (1) Event exist and is persisted in DB - (2) User who performs this operation have permission
Preconditions - (1) Event is valid and persisted - (2) Event must have not started
func (*EventManager) ChangeParticipantResponse ¶
func (m *EventManager) ChangeParticipantResponse(eventID int64, userID int64, response api.AttendanceResponse) (*Participant, error)
Change participant response to an event. Returns true if response changed, or false otherwise. For instance, if response is equal to old response, then it would return false.
Assumptions: - (1) User who performs this operation has permissions
Preconditions: - (1) Event is valid and persisted - (2) Event must have not started - (3) User must have received this invitation, i.e. user is in event participant list
func (*EventManager) ExtractNewParticipants ¶
func (m *EventManager) ExtractNewParticipants(extractEvent *Event, baseEvent *Event) map[int64]*Participant
ExtractNewParticipants extracts participants from extractList that are not in baseList
func (*EventManager) GetEventForUser ¶
func (m *EventManager) GetEventForUser(userID int64, eventID int64) (*Event, error)
func (*EventManager) GetEventsHistory ¶
func (*EventManager) GetRecentEvents ¶
func (m *EventManager) GetRecentEvents(userID int64) ([]*Event, error)
TODO: Do not get all of the private events, but limit to a fixed number with pagination support.
func (*EventManager) NewEventModifier ¶
func (m *EventManager) NewEventModifier(event *Event, ownerID int64) EventModifier
func (*EventManager) NewParticipantModifier ¶
func (m *EventManager) NewParticipantModifier(p *Participant) ParticipantModifier
func (*EventManager) Observe ¶
func (m *EventManager) Observe() observer.Stream
func (*EventManager) RemoveFromInbox ¶
func (m *EventManager) RemoveFromInbox(userID int64, eventID int64)
RemoveFromInbox is a workaround method to enable server removing cancelled events from inbox after it has been sent to the client. This method will not be needed when an API to retrieve last changes is able.
func (*EventManager) SaveEvent ¶
func (m *EventManager) SaveEvent(event *Event) error
* Save an event into database in order to let users request his events list * * Preconditions: * (1) event must have been initialised by model, this implies event object * is valid * (2) event must not be not persisted
type EventModifier ¶
type EventModifier interface { SetModifiedDate(date time.Time) EventModifier SetStartDate(date time.Time) EventModifier SetEndDate(date time.Time) EventModifier SetDescription(desc string) EventModifier ParticipantAdder() ParticipantAdder SetCancelled(cancelled bool) EventModifier Build() (*Event, error) }
type FBCredential ¶
type Friend ¶
type Friend struct {
// contains filtered or unexported fields
}
func (*Friend) PictureDigest ¶
type FriendManager ¶
type FriendManager struct {
// contains filtered or unexported fields
}
func (*FriendManager) AddGroups ¶
func (m *FriendManager) AddGroups(userID int64, groups []*Group) error
Adds friends groups to user 'userId'. If a group already exists it is updated.
func (*FriendManager) AreFriends ¶
func (m *FriendManager) AreFriends(user1 int64, user2 int64) (bool, error)
func (*FriendManager) ConfirmFriendRequest ¶
func (m *FriendManager) ConfirmFriendRequest(fromUser *UserAccount, toUser *UserAccount, accept bool) error
func (*FriendManager) CreateFriendRequest ¶
func (m *FriendManager) CreateFriendRequest(fromUser *UserAccount, toUser *UserAccount) (*FriendRequest, error)
func (*FriendManager) DeleteGroup ¶
func (m *FriendManager) DeleteGroup(userID int64, groupID int32) error
Remove group
func (*FriendManager) GetAllFriendRequests ¶
func (m *FriendManager) GetAllFriendRequests(toUser int64) ([]*FriendRequest, error)
func (*FriendManager) GetAllFriends ¶
func (self *FriendManager) GetAllFriends(userID int64) ([]*Friend, error)
func (*FriendManager) GetAllGroups ¶
func (m *FriendManager) GetAllGroups(userID int64) ([]*Group, error)
func (*FriendManager) GetFacebookFriends ¶
func (m *FriendManager) GetFacebookFriends(user *UserAccount) ([]*UserAccount, error)
GetFacebookFriends gets AreYouIN users that are friends of given user in Facebook
func (*FriendManager) GetNewFacebookFriends ¶
func (m *FriendManager) GetNewFacebookFriends(user *UserAccount) ([]*UserAccount, error)
GetNewFacebookFriends gets AreYouIN users that are friends in Facebook but not in AreYouIN
func (*FriendManager) ImportFacebookFriends ¶
func (m *FriendManager) ImportFacebookFriends(user *UserAccount, initialImport bool) ([]*UserAccount, error)
ImportFacebookFriends adds to user's list those AreYouIN users that are friends in Facebook but not in AreYouIN Returns the list of users that has been added by this operation
func (*FriendManager) IsFriend ¶
func (m *FriendManager) IsFriend(user1 int64, user2 int64) (bool, error)
Since makeFriends() is bidirectional (adds the friend to user1 and user2). It can be assumed that if first user is friend of the second one, then second user must also have the first user in his/her friend list.
func (*FriendManager) MakeFriends ¶
func (m *FriendManager) MakeFriends(user1 *UserAccount, user2 *UserAccount) error
func (*FriendManager) Observe ¶
func (m *FriendManager) Observe() observer.Stream
func (*FriendManager) RenameGroup ¶
func (m *FriendManager) RenameGroup(userID int64, groupID int32, newName string) error
Rename group
type FriendRequest ¶
type FriendRequest struct {
// contains filtered or unexported fields
}
func NewFriendRequest ¶
func NewFriendRequest(toUser int64, fromUser int64, name string, email string) *FriendRequest
func (*FriendRequest) AsDTO ¶
func (r *FriendRequest) AsDTO() *api.FriendRequestDTO
func (*FriendRequest) CreatedDate ¶
func (r *FriendRequest) CreatedDate() int64
func (*FriendRequest) FromUser ¶
func (r *FriendRequest) FromUser() int64
func (*FriendRequest) FromUserEmail ¶
func (r *FriendRequest) FromUserEmail() string
func (*FriendRequest) FromUserName ¶
func (r *FriendRequest) FromUserName() string
func (*FriendRequest) ToUser ¶
func (r *FriendRequest) ToUser() int64
type GroupBuilder ¶
type GroupBuilder struct {
// contains filtered or unexported fields
}
func NewGroupBuilder ¶
func NewGroupBuilder() *GroupBuilder
func (*GroupBuilder) AddMember ¶
func (b *GroupBuilder) AddMember(friendId int64) *GroupBuilder
func (*GroupBuilder) Build ¶
func (b *GroupBuilder) Build() *Group
func (*GroupBuilder) SetId ¶
func (b *GroupBuilder) SetId(id int32) *GroupBuilder
func (*GroupBuilder) SetName ¶
func (b *GroupBuilder) SetName(name string) *GroupBuilder
type IIDToken ¶
type IIDToken struct {
// contains filtered or unexported fields
}
func (IIDToken) AsDTO ¶
func (t IIDToken) AsDTO() *api.IIDTokenDTO
type Participant ¶
type Participant struct {
// contains filtered or unexported fields
}
func NewParticipant ¶
func NewParticipant(id int64, name string, response api.AttendanceResponse, status api.InvitationStatus) *Participant
func (*Participant) AsDTO ¶
func (p *Participant) AsDTO() *api.ParticipantDTO
func (*Participant) Clone ¶
func (p *Participant) Clone() *Participant
func (*Participant) Equal ¶
func (p *Participant) Equal(other *Participant) bool
func (*Participant) EventID ¶
func (p *Participant) EventID() int64
func (*Participant) Id ¶
func (p *Participant) Id() int64
func (*Participant) InvitationStatus ¶
func (p *Participant) InvitationStatus() api.InvitationStatus
func (*Participant) Name ¶
func (p *Participant) Name() string
func (*Participant) Response ¶
func (p *Participant) Response() api.AttendanceResponse
type ParticipantAdder ¶
type ParticipantAdder interface { AddUserAccount(u *UserAccount) ParticipantAdder AddFriend(f *Friend) ParticipantAdder AddParticipant(p *Participant) ParticipantAdder AddUserID(UID int64) ParticipantAdder }
type ParticipantList ¶
type ParticipantList struct {
// contains filtered or unexported fields
}
func (*ParticipantList) AsSlice ¶
func (l *ParticipantList) AsSlice() []*Participant
func (*ParticipantList) Clone ¶
func (l *ParticipantList) Clone() *ParticipantList
func (*ParticipantList) Equal ¶
func (l *ParticipantList) Equal(other *ParticipantList) bool
func (*ParticipantList) Get ¶
func (l *ParticipantList) Get(id int64) (*Participant, bool)
func (*ParticipantList) Ids ¶
func (l *ParticipantList) Ids() []int64
func (*ParticipantList) NumAttendees ¶
func (l *ParticipantList) NumAttendees() int
func (*ParticipantList) NumGuests ¶
func (l *ParticipantList) NumGuests() int
type ParticipantModifier ¶
type ParticipantModifier interface { SetResponse(resp api.AttendanceResponse) ParticipantModifier SetInvitationStatus(status api.InvitationStatus) ParticipantModifier Build() (*Participant, error) }
type Signal ¶
type Signal struct { Type SignalType Data map[string]interface{} }
type SignalType ¶
type SignalType int
const ( // Event published SignalNewEvent SignalType = iota // Event cancelled SignalEventCancelled SignalType = iota // Event modified (picture, start date, ...) SignalEventInfoChanged SignalType = iota // Event participant list changed (added or removed participants) SignalEventParticipantsInvited SignalType = iota // Participant changed (response, invitationStatus) SignalParticipantChanged SignalType = iota // New registered user SignalNewUserAccount SignalType = iota // Friends imported SignalNewFriendsImported SignalType = iota // Friend request sent SignalNewFriendRequest SignalType = iota // Friend request accepted SignalFriendRequestAccepted SignalType = iota // Friend request cancelled SignalFriendRequestCancelled SignalType = iota )
type UserAccount ¶
type UserAccount struct {
// contains filtered or unexported fields
}
func NewUserAccount ¶
func (*UserAccount) AsDTO ¶
func (u *UserAccount) AsDTO() *api.UserDTO
func (*UserAccount) AsFriend ¶
func (u *UserAccount) AsFriend() *Friend
func (*UserAccount) AsParticipant ¶
func (u *UserAccount) AsParticipant() *Participant
func (*UserAccount) AuthToken ¶
func (u *UserAccount) AuthToken() string
func (*UserAccount) Clone ¶
func (u *UserAccount) Clone() *UserAccount
func (*UserAccount) CreatedDate ¶
func (u *UserAccount) CreatedDate() int64
func (*UserAccount) Email ¶
func (u *UserAccount) Email() string
func (*UserAccount) FbId ¶
func (u *UserAccount) FbId() string
func (*UserAccount) FbToken ¶
func (u *UserAccount) FbToken() string
func (*UserAccount) HasFacebook ¶
func (u *UserAccount) HasFacebook() bool
func (*UserAccount) Id ¶
func (u *UserAccount) Id() int64
func (*UserAccount) IsZero ¶
func (u *UserAccount) IsZero() bool
func (*UserAccount) Name ¶
func (u *UserAccount) Name() string
func (*UserAccount) PictureDigest ¶
func (u *UserAccount) PictureDigest() []byte
func (*UserAccount) PushToken ¶
func (u *UserAccount) PushToken() IIDToken
type UserEvents ¶
type UserEvents struct {
// contains filtered or unexported fields
}
func (*UserEvents) Clear ¶
func (u *UserEvents) Clear()
func (*UserEvents) FindAll ¶
func (u *UserEvents) FindAll(userID int64) []int64
func (*UserEvents) Insert ¶
func (u *UserEvents) Insert(userID int64, eventID int64)
func (*UserEvents) Len ¶
func (u *UserEvents) Len() int
func (*UserEvents) Remove ¶
func (u *UserEvents) Remove(userID int64, eventID int64)