Documentation ¶
Index ¶
- Constants
- func PeriodToDuration(period uint8) time.Duration
- type Alarm
- type Alarms
- type AuthCodeClaims
- type Member
- type MemberDevice
- type MemberDevices
- type Members
- type Room
- func (r *Room) AppendMember(accountID uint)
- func (r *Room) BeforeDueAt() *time.Time
- func (r *Room) ChangeMaster() error
- func (r *Room) IsAlreadyJoined(accountID uint) bool
- func (r *Room) IsEqual(other *Room) bool
- func (r *Room) IsMaster(accountID uint) bool
- func (r *Room) IsMemberFull() bool
- func (r *Room) IsTurn(accountID uint) bool
- func (r *Room) MemberAllExceptTurnAccount() []uint
- func (r *Room) MemberOnlyOrders() ([]uint, error)
- func (r *Room) NextDueAt() *time.Time
- func (r *Room) NextTurn() (nextTurnAccountID uint)
- func (r *Room) OrdersToJSON() ([]byte, error)
- func (r *Room) RemoveMember(accountID uint) (uint, error)
- type RoomMember
- type RoomMemberOrderBy
- type RoomMembers
- type Rooms
- type Token
Constants ¶
const ( // JoinedOrder ... JoinedOrder RoomMemberOrderBy = "JOINED_ORDER" // DiaryOrder ... DiaryOrder = "DIARY_ORDER" // Ignore does not populate room member Ignore = "IGNORE" )
Variables ¶
This section is empty.
Functions ¶
func PeriodToDuration ¶
PeriodToDuration returns period to time.Duration
Types ¶
type Alarm ¶
type Alarm struct { MemberID uint RoomID uint Code string Title string RoomName string Author string AlarmAt *time.Time }
Alarm represents alarm body
func NewAlarm ¶
func NewAlarm(memberID, roomID uint, code vo.TaskCode, roomName, diaryTitle, authorNickname string) *Alarm
NewAlarm ...
type AuthCodeClaims ¶
type AuthCodeClaims struct { AuthType string `json:"auth_type"` ID uint `json:"id"` Email string `json:"email"` Name string `json:"name"` jwt.StandardClaims }
AuthCodeClaims ...
type Member ¶
type Member struct { ID uint Email string Name string ProfileURL string AuthType string AlarmFlag bool CreatedAt time.Time UpdatedAt time.Time }
Member ...
type MemberDevice ¶
type MemberDevice struct { ID uint MemberID uint DeviceToken string CreatedAt time.Time UpdatedAt time.Time }
MemberDevice maps member and firebase device token ID
func NewMemberDevice ¶
func NewMemberDevice(memberID uint, token string) (*MemberDevice, error)
NewMemberDevice ...
func (*MemberDevice) IsEqual ¶
func (md *MemberDevice) IsEqual(other *MemberDevice) bool
IsEqual guarantees Entity's identity
type Room ¶
type Room struct { ID uint Name string Code string Hint string Theme string Period uint8 MasterID uint TurnAccountID uint Orders []uint // master + roomMembers Members *Members DueAt *time.Time CreatedAt *time.Time UpdatedAt *time.Time }
Room ...
func (*Room) BeforeDueAt ¶
BeforeDueAt returns (current_room_due_at - oldPeriod) It is used for change period
func (*Room) IsAlreadyJoined ¶
IsAlreadyJoined determines whether account is master or member of room
func (*Room) MemberAllExceptTurnAccount ¶
MemberAllExceptTurnAccount returns every members except current turn member.
func (*Room) MemberOnlyOrders ¶
MemberOnlyOrders returns master excluded memberIDs
func (*Room) OrdersToJSON ¶
OrdersToJSON 는 []uint 타입을 []byte json타입으로 마샬링한다.
type RoomMember ¶
RoomMember maps room and accout
func NewRoomMember ¶
func NewRoomMember(roomID, accountID uint) (*RoomMember, error)
NewRoomMember ...
func (*RoomMember) IsEqual ¶
func (r *RoomMember) IsEqual(other *RoomMember) bool
IsEqual guarantees Entity's identity
type RoomMemberOrderBy ¶
type RoomMemberOrderBy string
RoomMemberOrderBy represents how to order Room's member populate ordering.