Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration struct {
// Name of the server you're connecting to
ServerName string `json:"server"`
// Server TCP port
ServerPort uint `json:"port"`
// set to true if you want to connect via TLS
UseTLS bool `json:"use_tls"`
// Set to true to use SASL auth
UseSASL bool `json:"use_sasl"`
// Nickname
NickName string `json:"nick"`
// NickServ password for the given nickname
Password string `json:"password"`
// Array of chat channels to join
Channels []string `json:"channels"`
// Which of these channels are considered public (so a reduced amount of data)
// will be reported.
PublicChannels []string `json:"public_channels"`
// DSN of the database connection.
DbDsn string `json:"db_dsn"`
// The nicknames of the admins of the bot.
// You should take care of ensure their nicknames are
// protected
Admins []string `json:"admins"`
}
Configuration holds all the configuration of the bot
func GetConfig ¶
func GetConfig(fileName string) (*Configuration, error)
GetConfig initializes a configuration object from reading a properly formatted json file
func (*Configuration) GetServerString ¶
func (c *Configuration) GetServerString() string
GetServerString gives you a host:port string of the server to connect to.
func (*Configuration) IsPublicChannel ¶
func (c *Configuration) IsPublicChannel(channel string) bool
IsPublicChannel tells you if a channel is public or not.
Click to show internal directories.
Click to hide internal directories.