Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions channels/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,19 @@ const AllChannelWildcard = "*" // wildcard for 'all channels'

// ID represents a single channel inside a collection
type ID struct {
Name string // name of channel
CollectionID uint32 // collection it belongs to
serialization string // private method for logging and matching inside changeWaiter notification
Name string // name of channel
CollectionID uint32 // collection it belongs to
}

func (c ID) String() string {
return c.serialization
return strconv.FormatUint(uint64(c.CollectionID), 10) + "." + base.UserDataPrefix + c.Name + base.UserDataSuffix
}

// NewID returns a new ChannelID
func NewID(channelName string, collectionID uint32) ID {
return ID{
Name: channelName,
CollectionID: collectionID,
serialization: strconv.FormatUint(uint64(collectionID), 10) + "." + base.UserDataPrefix + channelName + base.UserDataSuffix,
Name: channelName,
CollectionID: collectionID,
}
}

Expand Down
Loading