Documentation
¶
Index ¶
- Constants
- func Flags(cmd *cobra.Command)
- func Init() (*chatlib.Option, error)
- type API
- func (a *API) ApplyOptions(opts ...Option) error
- func (a *API) Ping() error
- func (a *API) ReceiveMessage(c context.Context) (*chatlib.Message, error)
- func (a *API) SendMessage(c context.Context, msg *chatlib.Message) error
- func (a *API) Start(c context.Context) error
- func (a *API) Stop(c context.Context) error
- type Option
- func CombineOptions(opts ...Option) Option
- func WithAuthMethod(method int) Option
- func WithChannel(channel string) Option
- func WithChannels(channels []string) Option
- func WithDialTimeout(seconds float64) Option
- func WithKeepAlive(seconds float64) Option
- func WithMessageBufferSize(size int) Option
- func WithNetwork(host string, port int) Option
- func WithNick(nick string) Option
- func WithPassword(password string) Option
- func WithTLS(cfg *tls.Config) Option
Constants ¶
View Source
const ( DefaultNick = "freyabot" DefaultLoginDelaySeconds = 5 DefaultDialTimeoutSeconds = 10 DefaultKeepAliveSeconds = 60 DefaultMsgBufferSize = 100 DefaultTlsPort = 6697 DefaultPlainPort = 6667 ReadDelimiter byte = '\n' )
View Source
const ( AuthMethodNone = iota AuthMethodNickServ AuthMethodSASL AuthMethodCertFP )
View Source
const ApiName = "irc"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func (*API) ApplyOptions ¶
func (*API) ReceiveMessage ¶
func (*API) SendMessage ¶
TODO Handle long messages
type Option ¶
func CombineOptions ¶
func WithAuthMethod ¶
func WithChannel ¶
func WithChannels ¶
func WithDialTimeout ¶
func WithKeepAlive ¶
func WithMessageBufferSize ¶
func WithNetwork ¶
func WithPassword ¶
Click to show internal directories.
Click to hide internal directories.