Documentation ¶
Overview ¶
Text chat functionality backed by getstream.io chat service.
TODO: convert to plugin.
Index ¶
- Constants
- type StreamChat
- func (s *StreamChat) GetChannel(ctx context.Context, object universe.Object) (*stream.Channel, error)
- func (s *StreamChat) GetToken(ctx context.Context, user universe.User) (string, error)
- func (s *StreamChat) Initialize(ctx types.NodeContext) error
- func (s *StreamChat) Load() error
- func (s *StreamChat) MakeMember(ctx context.Context, channel *stream.Channel, user universe.User) error
- func (s *StreamChat) RegisterAPI(r *gin.Engine)
- func (s *StreamChat) RemoveMember(ctx context.Context, channel *stream.Channel, user universe.User) error
Constants ¶
View Source
const MomentumChannelType = "momentum-world"
Currently manage a single channel type
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StreamChat ¶
type StreamChat struct {
// contains filtered or unexported fields
}
func NewStreamChat ¶
func NewStreamChat() *StreamChat
func (*StreamChat) GetChannel ¶
func (s *StreamChat) GetChannel(ctx context.Context, object universe.Object) (*stream.Channel, error)
Get or create a channel for given object.
func (*StreamChat) GetToken ¶
Get StreamChat authentication token. Creates or update the user at the streamchat side.
func (*StreamChat) Initialize ¶
func (s *StreamChat) Initialize(ctx types.NodeContext) error
func (*StreamChat) Load ¶
func (s *StreamChat) Load() error
func (*StreamChat) MakeMember ¶
func (s *StreamChat) MakeMember(ctx context.Context, channel *stream.Channel, user universe.User) error
Add user as a member of a channel.
func (*StreamChat) RegisterAPI ¶
func (s *StreamChat) RegisterAPI(r *gin.Engine)
func (*StreamChat) RemoveMember ¶
func (s *StreamChat) RemoveMember(ctx context.Context, channel *stream.Channel, user universe.User) error
Remove user as a member from a streamchat channel.
Click to show internal directories.
Click to hide internal directories.