torpedo_registry

package module
v0.0.0-...-fe29fc9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 28, 2019 License: BSD-2-Clause Imports: 4 Imported by: 44

README

torpedo_registry

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Accounts *AccountsStruct
	Config   *ConfigStruct
)

Functions

This section is empty.

Types

type Account

type Account struct {
	API           interface{}
	APIKey        string
	CommandPrefix string
	Connection    struct {
		Connected           bool
		Ping                float64
		StatusMessage       string
		ReconnectCount      int64
		DynamicallyDisabled bool
	}
	Description string
	Name        string
}

type AccountsStruct

type AccountsStruct struct {
	// contains filtered or unexported fields
}

func (*AccountsStruct) AppendAccounts

func (self *AccountsStruct) AppendAccounts(account *Account)

func (*AccountsStruct) GetAccountByAPIKey

func (self *AccountsStruct) GetAccountByAPIKey(apiKey string) (account *Account)

func (*AccountsStruct) GetAccounts

func (self *AccountsStruct) GetAccounts() (accounts []*Account)

type BotAPI

type BotAPI struct {
	API         interface{}
	ProtocolAPI interface{}
	Bot         struct {
		Build struct {
			Build      string
			BuildDate  string
			GoVersion  string
			Version    string
			ProjectURL string
		}
		GetCachedItem      func(string) string
		SetCachedItems     func(string, map[int]string) string
		GetCommandHandlers func() map[string]func(*BotAPI, interface{}, string)
		GetHelp            func() map[string]string
		Stats              struct {
			StartTimestamp         int64
			ProcessedMessages      int64
			ProcessedMessagesTotal int64
			ConnectedAccounts      int32
			TotalAccounts          int32
		}
		PostMessage func(interface{}, string, *BotAPI, ...interface{})
	}
	CommandPrefix string
	UserProfile   *UserProfile
}

type ConfigStruct

type ConfigStruct struct {
	// contains filtered or unexported fields
}

func (*ConfigStruct) GetConfig

func (self *ConfigStruct) GetConfig() map[string]string

func (*ConfigStruct) GetCoroutines

func (self *ConfigStruct) GetCoroutines() map[string]func(cfg *ConfigStruct)

func (*ConfigStruct) GetHandlers

func (self *ConfigStruct) GetHandlers() map[string]func(*BotAPI, interface{}, string)

func (*ConfigStruct) GetHelp

func (self *ConfigStruct) GetHelp() map[string]string

func (*ConfigStruct) GetPostParsers

func (self *ConfigStruct) GetPostParsers() map[string]func(cfg *ConfigStruct)

func (*ConfigStruct) GetPreParsers

func (self *ConfigStruct) GetPreParsers() map[string]func(cfg *ConfigStruct)

func (*ConfigStruct) GetTextMessageHandlers

func (self *ConfigStruct) GetTextMessageHandlers() map[string]func(*BotAPI, interface{}, string)

func (*ConfigStruct) RegisterCoroutine

func (self *ConfigStruct) RegisterCoroutine(name string, f func(cfg *ConfigStruct))

func (*ConfigStruct) RegisterHandler

func (self *ConfigStruct) RegisterHandler(name string, f func(*BotAPI, interface{}, string))

func (*ConfigStruct) RegisterHelp

func (self *ConfigStruct) RegisterHelp(name, help_str string)

func (*ConfigStruct) RegisterHelpAndHandler

func (self *ConfigStruct) RegisterHelpAndHandler(name, help_str string, handler func(*BotAPI, interface{}, string))

func (*ConfigStruct) RegisterParser

func (self *ConfigStruct) RegisterParser(name string, preparser func(cfg *ConfigStruct), postparser func(cfg *ConfigStruct))

func (*ConfigStruct) RegisterPostParser

func (self *ConfigStruct) RegisterPostParser(name string, f func(cfg *ConfigStruct))

func (*ConfigStruct) RegisterPreParser

func (self *ConfigStruct) RegisterPreParser(name string, f func(cfg *ConfigStruct))

func (*ConfigStruct) RegisterTextMessageHandler

func (self *ConfigStruct) RegisterTextMessageHandler(name string, f func(*BotAPI, interface{}, string))

func (*ConfigStruct) SetConfig

func (self *ConfigStruct) SetConfig(key, val string)

type MessageHistoryItem

type MessageHistoryItem struct {
	ID        bson.ObjectId `bson:"_id,omitempty"`
	Timestamp int64
	Channel   string
	Sender    string
	Nick      string
	Message   string
}

type RichMessage

type RichMessage struct {
	BarColor  string
	Text      string
	Title     string
	TitleLink string
	ImageURL  string
}

func (*RichMessage) IsEmpty

func (rm *RichMessage) IsEmpty() bool

func (*RichMessage) ToGenericAttachment

func (rm *RichMessage) ToGenericAttachment() (msg, url string)

type UserProfile

type UserProfile struct {
	Nick     string
	RealName string
	Timezone string
	Phone    string
	Email    string
	IsBot    bool
	ID       string
	// Required for IRC (?)
	Server string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL