Documentation
¶
Index ¶
- Variables
- type Chatroom
- type ChatroomMember
- type ChatroomMemberLastViewedAt
- type ChatroomMemberRequest
- type ChatroomMembers
- type ChatroomMembersDB
- func (p *ChatroomMembersDB) AddChatroomMember(pr *ChatroomMember)
- func (p *ChatroomMembersDB) DeleteChatroomMember(chatroonID string, userID string) error
- func (p *ChatroomMembersDB) GetChatroomMembers() (ChatroomMembers, error)
- func (p *ChatroomMembersDB) GetChatroomMembersByChatroomID(chatroomID string) (ChatroomMembers, error)
- func (p *ChatroomMembersDB) GetChatroomMembersByUserID(userID string) (ChatroomMembers, error)
- func (p *ChatroomMembersDB) UpdateChatroomMember(pr ChatroomMember) error
- func (p *ChatroomMembersDB) UpdateLastViewedAt(chatroomid string, userid string, lastviewedat time.Time) (*ChatroomMember, error)
- type ChatroomRequest
- type Chatrooms
- type ChatroomsDB
Constants ¶
This section is empty.
Variables ¶
var ChatroomList = []*Chatroom{ &Chatroom{ ChatroomRequest: ChatroomRequest{ Name: "chatroom01", DisplayName: "Display name test1", }, ID: "1", }, &Chatroom{ ChatroomRequest: ChatroomRequest{ Name: "chatroom02", DisplayName: "Display name test2", }, ID: "2", }, }
var ChatroomMemberList = []*ChatroomMember{ &ChatroomMember{ ChatroomMemberRequest: ChatroomMemberRequest{ UserID: "1", Role: "speaker", }, ChatroomID: "1", UpdatedAt: time.Now(), LastViewedAt: time.Now(), }, &ChatroomMember{ ChatroomMemberRequest: ChatroomMemberRequest{ UserID: "2", Role: "listener", }, ChatroomID: "2", UpdatedAt: time.Now(), LastViewedAt: time.Now(), }, }
var ErrChatroomMemberNotFound = fmt.Errorf("ChatroomMemberRequest not found")
ErrChatroomMemberNotFound is an error raised when a ChatroomMemberRequest can not be found in the database
var ErrChatroomNotFound = fmt.Errorf("ChatroomRequest not found")
ErrChatroomNotFound is an error raised when a ChatroomRequest can not be found in the database
Functions ¶
This section is empty.
Types ¶
type Chatroom ¶
type Chatroom struct {
// the id for the chatroom
//
// required: false
// min: 1
ID string `json:"id"`
ChatroomRequest
CreatorUserID string `json:"created_userid,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
DeletedAt time.Time `json:"deleted_at,omitempty"`
LastPostAt time.Time `json:"lastpost_at,omitempty"`
}
ChatroomRequest represents a muc chatroom response. swagger:model
type ChatroomMember ¶
type ChatroomMember struct {
// the id for the chatroom
//
// required: false
// min: 1
ChatroomID string `json:"chatroom_id"`
ChatroomMemberRequest
UpdatedAt time.Time `json:"updated_at,omitempty"`
LastViewedAt time.Time `json:"lastviewed_at,omitempty"`
}
ChatroomMemberRequest represents a muc chatroom response. swagger:model
type ChatroomMemberLastViewedAt ¶
ChatroomMemberLastViewedAt represents a LastViewedAt update body swagger:model
type ChatroomMemberRequest ¶
type ChatroomMemberRequest struct {
// the id for the user
//
// required: true
UserID string `json:"user_id"`
// the user role in the chatroom
//
// required: failse
Role string `json:"role"`
}
ChatroomMemberRequest represents a muc chatroom request. swagger:model
type ChatroomMembers ¶
type ChatroomMembers []*ChatroomMember
ChatroomMembers defines a slice of ChatroomMemberRequest
type ChatroomMembersDB ¶
type ChatroomMembersDB struct {
// contains filtered or unexported fields
}
func NewChatroomMembersDB ¶
func NewChatroomMembersDB(l hclog.Logger) *ChatroomMembersDB
func (*ChatroomMembersDB) AddChatroomMember ¶
func (p *ChatroomMembersDB) AddChatroomMember(pr *ChatroomMember)
AddChatroomMember adds a new ChatroomMemberRequest to the database
func (*ChatroomMembersDB) DeleteChatroomMember ¶
func (p *ChatroomMembersDB) DeleteChatroomMember(chatroonID string, userID string) error
DeleteChatroomMember deletes a ChatroomMemberRequest from the database
func (*ChatroomMembersDB) GetChatroomMembers ¶
func (p *ChatroomMembersDB) GetChatroomMembers() (ChatroomMembers, error)
GetChatroomMembers returns all ChatroomMembers from the database
func (*ChatroomMembersDB) GetChatroomMembersByChatroomID ¶
func (p *ChatroomMembersDB) GetChatroomMembersByChatroomID(chatroomID string) (ChatroomMembers, error)
GetChatroomMembersByChatroomID returns a single ChatroomMemberRequest which matches the id from the database. If a ChatroomMemberRequest is not found this function returns a ChatroomMemberNotFound error
func (*ChatroomMembersDB) GetChatroomMembersByUserID ¶
func (p *ChatroomMembersDB) GetChatroomMembersByUserID(userID string) (ChatroomMembers, error)
GetChatroomMembersByUserID returns a single ChatroomMemberRequest which matches the id from the database. If a ChatroomMemberRequest is not found this function returns a ChatroomMemberNotFound error
func (*ChatroomMembersDB) UpdateChatroomMember ¶
func (p *ChatroomMembersDB) UpdateChatroomMember(pr ChatroomMember) error
UpdateChatroomMember replaces a ChatroomMemberRequest in the database with the given item. If a ChatroomMemberRequest with the given id does not exist in the database this function returns a ChatroomMemberNotFound error
func (*ChatroomMembersDB) UpdateLastViewedAt ¶
func (p *ChatroomMembersDB) UpdateLastViewedAt(chatroomid string, userid string, lastviewedat time.Time) (*ChatroomMember, error)
UpdateChatroomMember replaces a ChatroomMemberRequest in the database with the given item. If a ChatroomMemberRequest with the given id does not exist in the database this function returns a ChatroomMemberNotFound error
type ChatroomRequest ¶
type ChatroomRequest struct {
Enabled bool `json:"enabled"`
// the name for the chatroom
//
// required: true
Name string `json:"name"`
// the chatroom display_name
//
// required: true
DisplayName string `json:"display_name"`
// the chatroom type
//
// required: true
Type string `json:"type"`
Purpose string `json:"purpose,omitempty"`
Header string `json:"header,omitempty"`
}
ChatroomRequest represents a muc chatroom request. swagger:model
type ChatroomsDB ¶
type ChatroomsDB struct {
// contains filtered or unexported fields
}
func NewChatroomsDB ¶
func NewChatroomsDB(l hclog.Logger) *ChatroomsDB
func (*ChatroomsDB) AddChatroom ¶
func (p *ChatroomsDB) AddChatroom(pr *Chatroom)
AddChatroom adds a new ChatroomRequest to the database
func (*ChatroomsDB) DeleteChatroom ¶
func (p *ChatroomsDB) DeleteChatroom(id string) error
DeleteChatroom deletes a ChatroomRequest from the database
func (*ChatroomsDB) GetChatroomByID ¶
func (p *ChatroomsDB) GetChatroomByID(id string) (*Chatroom, error)
GetChatroomByID returns a single ChatroomRequest which matches the id from the database. If a ChatroomRequest is not found this function returns a ChatroomNotFound error
func (*ChatroomsDB) GetChatrooms ¶
func (p *ChatroomsDB) GetChatrooms() (Chatrooms, error)
GetChatrooms returns all Chatrooms from the database
func (*ChatroomsDB) UpdateChatroom ¶
func (p *ChatroomsDB) UpdateChatroom(pr Chatroom) error
UpdateChatroom replaces a ChatroomRequest in the database with the given item. If a ChatroomRequest with the given id does not exist in the database this function returns a ChatroomNotFound error