Documentation
¶
Index ¶
- type Capability
- type Set
- func (s *Set) Add(capabs ...Capability)
- func (s *Set) Count() int
- func (s *Set) Disable(capabs ...Capability)
- func (s *Set) Enable(capabs ...Capability)
- func (s *Set) Has(caps ...Capability) bool
- func (s *Set) List() []Capability
- func (s *Set) Remove(capabs ...Capability)
- func (s *Set) String(version Version, values *Values) string
- type Values
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Capability ¶
type Capability string
Capability represents an optional feature that a client may request from the server.
const ( // AccountNotify is this IRCv3 capability: http://ircv3.net/specs/extensions/account-notify-3.1.html AccountNotify Capability = "account-notify" // AccountTag is this IRCv3 capability: http://ircv3.net/specs/extensions/account-tag-3.2.html AccountTag Capability = "account-tag" // AwayNotify is this IRCv3 capability: http://ircv3.net/specs/extensions/away-notify-3.1.html AwayNotify Capability = "away-notify" // Batch is this IRCv3 capability: http://ircv3.net/specs/extensions/batch-3.2.html Batch Capability = "batch" // CapNotify is this IRCv3 capability: http://ircv3.net/specs/extensions/cap-notify-3.2.html CapNotify Capability = "cap-notify" // ChgHost is this IRCv3 capability: http://ircv3.net/specs/extensions/chghost-3.2.html ChgHost Capability = "chghost" // EchoMessage is this IRCv3 capability: http://ircv3.net/specs/extensions/echo-message-3.2.html EchoMessage Capability = "echo-message" // ExtendedJoin is this IRCv3 capability: http://ircv3.net/specs/extensions/extended-join-3.1.html ExtendedJoin Capability = "extended-join" // InviteNotify is this IRCv3 capability: http://ircv3.net/specs/extensions/invite-notify-3.2.html InviteNotify Capability = "invite-notify" // LabeledResponse is this draft IRCv3 capability: http://ircv3.net/specs/extensions/labeled-response.html LabeledResponse Capability = "draft/labeled-response" // MaxLine is this proposed capability: https://github.com/DanielOaks/ircv3-specifications/blob/master+line-lengths/extensions/line-lengths.md MaxLine Capability = "draft/maxline" // MessageTags is this draft IRCv3 capability: http://ircv3.net/specs/core/message-tags-3.3.html MessageTags Capability = "draft/message-tags-0.2" // MultiPrefix is this IRCv3 capability: http://ircv3.net/specs/extensions/multi-prefix-3.1.html MultiPrefix Capability = "multi-prefix" // Rename is this proposed capability: https://github.com/SaberUK/ircv3-specifications/blob/rename/extensions/rename.md Rename Capability = "draft/rename" // SASL is this IRCv3 capability: http://ircv3.net/specs/extensions/sasl-3.2.html SASL Capability = "sasl" // ServerTime is this IRCv3 capability: http://ircv3.net/specs/extensions/server-time-3.2.html ServerTime Capability = "server-time" // STS is this IRCv3 capability: http://ircv3.net/specs/extensions/sts.html STS Capability = "sts" // UserhostInNames is this IRCv3 capability: http://ircv3.net/specs/extensions/userhost-in-names-3.2.html UserhostInNames Capability = "userhost-in-names" )
func (Capability) Name ¶
func (capability Capability) Name() string
Name returns the name of the given capability.
type Set ¶
Set holds a set of enabled capabilities.
func NewSet ¶
func NewSet(capabs ...Capability) *Set
NewSet returns a new Set, with the given capabilities enabled.
func (*Set) Add ¶
func (s *Set) Add(capabs ...Capability)
Add adds the given capabilities to this set. this is just a wrapper to allow more clear use.
func (*Set) Disable ¶
func (s *Set) Disable(capabs ...Capability)
Disable disables the given capabilities.
func (*Set) Enable ¶
func (s *Set) Enable(capabs ...Capability)
Enable enables the given capabilities.
func (*Set) Has ¶
func (s *Set) Has(caps ...Capability) bool
Has returns true if this set has the given capabilities.
func (*Set) List ¶
func (s *Set) List() []Capability
List return a list of our enabled capabilities.
func (*Set) Remove ¶
func (s *Set) Remove(capabs ...Capability)
Remove removes the given capabilities from this set. this is just a wrapper to allow more clear use.
type Values ¶
Values holds capability values.
func (*Values) Get ¶
func (v *Values) Get(capab Capability) (string, bool)
Get returns the value of the given capability, and whether one exists.
func (*Values) Set ¶
func (v *Values) Set(capab Capability, value string)
Set sets the value for the given capability.
func (*Values) Unset ¶
func (v *Values) Unset(capab Capability)
Unset removes the value for the given capability, if it exists.