<commit_before>package sphere

// IChannels is the interface for ChannelModel
type IChannels interface {
	Namespace() string
	Subscribe(string, *Connection) bool
	Disconnect(string, *Connection)
	Receive(string, string) error
}

// ExtendChannelModel lets developer create a IChannals compatible struct
func ExtendChannelModel(namespace string) *ChannelModel {
	return &ChannelModel{namespace}
}

// ChannelModel is for user to define channel events and actions
type ChannelModel struct {
	namespace string
}

// Namespace to return name of the channel
func (m *ChannelModel) Namespace() string {
	return m.namespace
}

// Subscribe decides whether accept the connection into channel or not, return true => accept, false => reject
func (m *ChannelModel) Subscribe(room string, connection *Connection) bool {
	return false
}

// Disconnect defines the action when user disconnect from channel
func (m *ChannelModel) Disconnect(room string, connection *Connection) {}

// Receive defines the action when websocket server receive message from user in this channel
func (m *ChannelModel) Receive(event string, message string) error {
	return nil
}<commit_msg>return success status when disconnect<commit_after>package sphere

// IChannels is the interface for ChannelModel
type IChannels interface {
	Namespace() string
	Subscribe(string, *Connection) bool
	Disconnect(string, *Connection) bool
	Receive(string, string) error
}

// ExtendChannelModel lets developer create a IChannals compatible struct
func ExtendChannelModel(namespace string) *ChannelModel {
	return &ChannelModel{namespace}
}

// ChannelModel is for user to define channel events and actions
type ChannelModel struct {
	namespace string
}

// Namespace to return name of the channel
func (m *ChannelModel) Namespace() string {
	return m.namespace
}

// Subscribe decides whether accept the connection into channel or not, return true => accept, false => reject
func (m *ChannelModel) Subscribe(room string, connection *Connection) bool {
	return false
}

// Disconnect defines the action when user disconnect from channel
func (m *ChannelModel) Disconnect(room string, connection *Connection) bool {
	return true
}

// Receive defines the action when websocket server receive message from user in this channel
func (m *ChannelModel) Receive(event string, message string) error {
	return nil
}
{'fraction_non_alphanumeric': 0.06955046649703138, 'fraction_numerical': 0.0, 'mean_word_length': 5.3243967828418235, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3659986', 'n_tokens_mistral': 600, 'n_tokens_neox': 591, 'n_words': 266}