Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IDMap ¶
type IDMap struct {
// contains filtered or unexported fields
}
IDMap is a map between Discord ID/name pairs and IRC names.
There may be multiple Discord names with the same name but different IDs, with different IRC names guaranteed by the map.
func (*IDMap) Access ¶
func (m *IDMap) Access( access func(forward map[discord.Snowflake]string, backward map[string]discord.Snowflake))
Access allows access to the internal storage.
Do not modify the maps. Calling any other method from inside the callback may deadlock.
func (*IDMap) DeleteSnowflake ¶
DeleteSnowflake removes an ID from the map, returning whether it did anything.
func (*IDMap) Insert ¶
Insert returns an IRC name for a given Discord ID. It returns the previous value and the new value.
It returns ideal if there were no collisions. It panics if passed an invalid ID. Passing an empty string for ideal is allowed, however.