Documentation ¶
Index ¶
- Constants
- Variables
- func ApplyTxBlock(Db *sql.DB, Blocks []TxBlock) error
- func DeferCloseDb(db *sql.DB, label string)
- func DieIfNil(Result bool, Msg string)
- func EnvParsePath(Paths []string) (Ret string)
- func ExitIfPidActive(pidFiles ...string)
- func FileExists(filename string) bool
- func FormatMysqlTime(Time time.Time) string
- func GenerateRandomBytes(n int) ([]byte, error)
- func GenerateRandomString(s int) (string, error)
- func GenerateRandomStringOrDie(s int) string
- func GenerateRandomUUid() (string, error)
- func GetDbType(db *DbHandle) string
- func GetFileChecksum(Filename string) (string, error)
- func GetGoroutineId() uint64
- func GetLogger() *slogger.Logger
- func GetMtime(Path string) (time.Time, error)
- func GetMyChecksum() string
- func GetParentPid() int
- func InsertJsonAsDbRow(Table string, Data *sjson.JSON, Db *sql.DB) error
- func MonitorLog(Filename string, fn logreader, polldelay int)
- func MyExecBaseName() string
- func ParseMysqlTime(k string) (*time.Time, error)
- func PidIsRunning(Pid int) bool
- func PrintFromFile(Filename string, line follower.Line) bool
- func ReadStdinToEofBytes() []byte
- func RunAndGetLastInsertId(stmt *Stmt, Options ...interface{}) (int64, error)
- func SearchPath(File string, Paths []string) string
- func SetLogger(l *slogger.Logger) *slogger.Logger
- func ValidatePreparedQueriesOrDie(Q interface{})
- type ChatConnectType
- type ChatHandle
- func (cth *ChatHandle) ChatTarget(target string) *ChatTarget
- func (cth *ChatHandle) ChatTargetChannel(id string) *ChatTarget
- func (cth *ChatHandle) ChatTargetUser(user string) *ChatTarget
- func (cth *ChatHandle) FormulateStimulus(event *MessagerEvent) *ResponseTo
- func (cth *ChatHandle) Identifier() string
- func (cth *ChatHandle) Join(target *ChatTarget) error
- func (cth *ChatHandle) LogErrorf(format string, options ...interface{})
- func (cth *ChatHandle) LogFatalf(format string, options ...interface{})
- func (cth *ChatHandle) NewListener() (*ListenHandle, error)
- func (cth *ChatHandle) NewMessage() *ChatMessage
- func (cth *ChatHandle) OrDie(msgs ...string) *ChatHandle
- func (cth *ChatHandle) Send(origmessage *ChatMessage) (*ChatUpdateHandle, error)
- func (cth *ChatHandle) SendChannelf(Channel string, format string, options ...interface{}) (*ChatUpdateHandle, error)
- func (cth *ChatHandle) SendDefaultf(format string, options ...interface{}) (*ChatUpdateHandle, error)
- func (cth *ChatHandle) SendError(Message string) error
- func (cth *ChatHandle) SendErrorf(format string, options ...interface{}) error
- func (cth *ChatHandle) SendMessage(Chat *ChatMessage) (*ChatUpdateHandle, error)
- func (cth *ChatHandle) SendOut(Channel string, Message string) (*ChatUpdateHandle, error)
- func (cth *ChatHandle) SendSimple(target *ChatTarget, message string) (*ChatUpdateHandle, error)
- func (cth *ChatHandle) SendSimpleChannel(channel string, message string) (*ChatUpdateHandle, error)
- func (cth *ChatHandle) SetDefaultChannel(Channel string) *ChatHandle
- func (cth *ChatHandle) SetDefaultSender(Handle string) *ChatHandle
- func (cth *ChatHandle) SetErrorChannel(Channel string) *ChatHandle
- func (cth *ChatHandle) SetValidate()
- func (cth *ChatHandle) ShowConfig() string
- func (cth *ChatHandle) UserById(id string) *UserInfo
- func (cth *ChatHandle) Warnings() []error
- type ChatHandleConfigMap
- type ChatMessage
- type ChatOptions
- type ChatTarget
- func (tgt *ChatTarget) Identifier() string
- func (tgt *ChatTarget) LogErrorf(format string, options ...interface{}) error
- func (tgt *ChatTarget) LogFatalf(format string, options ...interface{})
- func (tgt *ChatTarget) OrDie(msgs ...string) *ChatTarget
- func (tgt *ChatTarget) Send(Msg *ChatMessage) (*ChatUpdateHandle, error)
- func (tgt *ChatTarget) SendImageTarget(Image *Image) error
- func (tgt *ChatTarget) Sendf(format string, options ...interface{})
- func (tgt *ChatTarget) SendfIfDef(format string, options ...interface{})
- type ChatType
- type ChatTypeConfig
- type ChatUpdateHandle
- type Configuration
- func (config *Configuration) ChatTargetFromKey(Key string) *ChatTarget
- func (config *Configuration) ConnectDbBySection(SectionName string) *DbHandle
- func (config *Configuration) ConnectDbBySectionOrDie(SectionName string) *DbHandle
- func (config *Configuration) ConnectDbKey(Key string) *DbHandle
- func (config *Configuration) DefineDbFromKey(Key string) *DbHandle
- func (config *Configuration) DefineDbFromSection(Section string) *DbHandle
- func (config *Configuration) ExportAsJson() sjson.JSON
- func (config *Configuration) ExportSectionAsJson(Section string) sjson.JSON
- func (config *Configuration) GetBool(Path string) (bool, bool)
- func (config *Configuration) GetBoolOrDefault(Path string, Default bool, DefaultMessage string, Options ...interface{}) bool
- func (config *Configuration) GetBoolOrDie(Path string, DieMsg string) bool
- func (config *Configuration) GetDurationOrDie(Path string, DieMsg string, options ...interface{}) time.Duration
- func (config *Configuration) GetFloat(Path string) (bool, float64)
- func (config *Configuration) GetFloatOrDie(Path string, DieMsg string) float64
- func (config *Configuration) GetInt(Path string) (bool, int)
- func (config *Configuration) GetInt64(Path string) (bool, int64)
- func (config *Configuration) GetInt64OrDefault(Path string, Default int64, DefaultMessage string, Options ...interface{}) int64
- func (config *Configuration) GetIntOrDefault(Path string, Default int, DefaultMessage string, Options ...interface{}) int
- func (config *Configuration) GetIntOrDie(Path string, DieMsg string) int
- func (config *Configuration) GetKey(Path string, DieMsg string) (Caw *ini.Key)
- func (config *Configuration) GetSecret(query string) (bool, sjson.JSON)
- func (config *Configuration) GetSecretOrDie(query string) sjson.JSON
- func (config *Configuration) GetSection(Path string) *ini.Section
- func (config *Configuration) GetString(Path string) (bool, string)
- func (config *Configuration) GetStringOrDefault(Path string, Default string, DefaultMessage string, Options ...interface{}) string
- func (config *Configuration) GetStringOrDie(Path string, DieMsg string, options ...interface{}) string
- func (config *Configuration) GetTimeOrDie(Path string, DieMsg string, options ...interface{}) time.Time
- func (config *Configuration) Identifier() string
- func (config *Configuration) KeyPrefix(Prefix string)
- func (config *Configuration) ListKeys(Path string) []string
- func (config *Configuration) ListSections() []string
- func (config *Configuration) ListedKeysPresent(Keys ...string) (bool, error)
- func (config *Configuration) LoadAnIni(Paths ...string) *Configuration
- func (config *Configuration) LoadKvOverlay(VaultPath string) error
- func (config *Configuration) LoadKvOverlayPrefix(VaultPath string, DestPrefix string) error
- func (config *Configuration) NewChatHandle(Section string) *ChatHandle
- func (config *Configuration) NewMailHandle(Section string) *MailHandle
- func (config *Configuration) OrDie(format string, msgs ...interface{}) *Configuration
- func (config *Configuration) PrintWarnings() *Configuration
- func (config *Configuration) Profile() string
- func (config *Configuration) SectionFromKey(Key string) *sjson.JSON
- func (config *Configuration) SetDefaultIni(Path ...string) *Configuration
- func (config *Configuration) SetFallback(File *Configuration)
- func (config *Configuration) SetOverride(File *Configuration)
- func (config *Configuration) SetVaultPrefix(Prefix string)
- type ConnectingEvent
- type DbHandle
- func (dbh *DbHandle) Connect() error
- func (dbh *DbHandle) DbType() DbType
- func (dbh *DbHandle) ErrorType(err error) string
- func (dbh *DbHandle) Identifier() string
- func (dbh *DbHandle) IsDead() bool
- func (dbh *DbHandle) OrDie() *DbHandle
- func (dbh *DbHandle) Postmortem() []error
- func (dbh *DbHandle) Prepare(sql string) *Stmt
- func (dbh *DbHandle) PrepareOrDie(sql string) *Stmt
- func (dbh *DbHandle) TransPrep(sql string) *Stmt
- func (dbh *DbHandle) Translate(sql string) string
- type DbType
- type Diagnostics
- type DirectClient
- func (dc *DirectClient) ChatTargetChannel(id string) *ChatTarget
- func (dc *DirectClient) ChatTargetUser(id string) *ChatTarget
- func (dc *DirectClient) FormulateStimulus(event *MessagerEvent) *ResponseTo
- func (dc *DirectClient) Identifier() string
- func (dc *DirectClient) Join(target *ChatTarget) error
- func (dc *DirectClient) SendMessage(Chat *ChatMessage) (*ChatUpdateHandle, error)
- func (dc *DirectClient) SendSimple(target *ChatTarget, message string) (string, string, error)
- func (dc *DirectClient) SendSimpleChannel(channel string, message string) (string, string, error)
- func (dc *DirectClient) UserById(id string) *UserInfo
- type Iface
- type Image
- type InvalidAuthEvent
- type Key
- type ListenHandle
- type LiveConfig
- func (Lc *LiveConfig) Bind(Label string, Addr interface{}) *LiveConfigKey
- func (Lc *LiveConfig) BindDb(db *DbHandle) *LiveConfig
- func (Lc *LiveConfig) FinishLoad()
- func (Lc *LiveConfig) KeyList() sjson.JSONarray
- func (Lc *LiveConfig) KeyRef(Label string) *LiveConfigKey
- func (Lc *LiveConfig) Update(Label string, Value interface{}) *LiveConfigKey
- func (Lc *LiveConfig) WatchConfigs(delay time.Duration)
- type LiveConfigKey
- type LookupItem
- type LookupTable
- type MailHandle
- type MailMessage
- type MessagerEvent
- type MsgSegment
- type MsgSegmentType
- type MsgType
- type ResponseTo
- type SafeIntCache
- func (c *SafeIntCache) Check(key string) (int, bool)
- func (c *SafeIntCache) Export() (Bob map[string]int)
- func (c *SafeIntCache) Get(key string) (t int)
- func (c *SafeIntCache) Inc(keys ...string) (val int)
- func (c *SafeIntCache) Set(key string, val int) *SafeIntCache
- func (c *SafeIntCache) SetM(val int, keys ...string) *SafeIntCache
- func (c *SafeIntCache) SetPrefix(val int, prefixes ...string) *SafeIntCache
- type SegmentedMsg
- type SocketFunction
- type Stmt
- type ThreadPurpose
- type TxBlock
- type UserIndexType
- type UserInfo
Constants ¶
Variables ¶
Functions ¶
func DeferCloseDb ¶
func EnvParsePath ¶
func ExitIfPidActive ¶
func ExitIfPidActive(pidFiles ...string)
func FileExists ¶
func FormatMysqlTime ¶
func GenerateRandomBytes ¶
func GenerateRandomString ¶
func GenerateRandomUUid ¶
func GetFileChecksum ¶
func GetGoroutineId ¶
func GetGoroutineId() uint64
func GetMyChecksum ¶
func GetMyChecksum() string
func GetParentPid ¶
func GetParentPid() int
func MonitorLog ¶
func MyExecBaseName ¶
func MyExecBaseName() string
func PidIsRunning ¶
func ReadStdinToEofBytes ¶
func ReadStdinToEofBytes() []byte
func RunAndGetLastInsertId ¶
func SearchPath ¶
func ValidatePreparedQueriesOrDie ¶
func ValidatePreparedQueriesOrDie(Q interface{})
Types ¶
type ChatConnectType ¶
type ChatConnectType int
const ( ChatTypeUndef ChatConnectType = 0 ChatTypeDb ChatConnectType = 1 ChatTypeSlackDirect ChatConnectType = 2 ChatTypeXmppDirect ChatConnectType = 3 )
func ChatTypeFromString ¶
func ChatTypeFromString(s string) ChatConnectType
func (ChatConnectType) String ¶
func (c ChatConnectType) String() string
type ChatHandle ¶
type ChatHandle struct { Validate bool Sender string ErrorChannel *ChatTarget OutputChannel *ChatTarget PrintChatOnly bool DirectClient *DirectClient DirectData interface{} ChatType ChatConnectType Owner string UserIndex UserIndexType RefuseMessagesAfter time.Duration ChannelLookup map[string]*ChatTarget UserLookup map[string]*UserInfo NativeClient interface{} FpSendSimple func(*ChatHandle, *ChatTarget, string) (*ChatUpdateHandle, error) FpSendMessage func(*ChatHandle, *ChatMessage) (*ChatUpdateHandle, error) FpFormulateStimulus func(*ChatHandle, *MessagerEvent) *ResponseTo FpChatTargetChannel func(*ChatHandle, string) *ChatTarget FpChatTargetUser func(*ChatHandle, string) *ChatTarget FpJoinChannel func(*ChatHandle, *ChatTarget) error FpUserById func(*ChatHandle, string) *UserInfo FpNewListener func(*ChatHandle) (*ListenHandle, error) FpSendImageTarget func(*ChatTarget, *Image) error FpIdentifier func(*ChatHandle) string FpGetMsgRefByLabel func(*ChatHandle, *ChatTarget, string) *ChatUpdateHandle FpGetMsgByLabel func(*ChatHandle, *ChatTarget, string) *ChatMessage // contains filtered or unexported fields }
func (*ChatHandle) ChatTarget ¶
func (cth *ChatHandle) ChatTarget(target string) *ChatTarget
func (*ChatHandle) ChatTargetChannel ¶
func (cth *ChatHandle) ChatTargetChannel(id string) *ChatTarget
func (*ChatHandle) ChatTargetUser ¶
func (cth *ChatHandle) ChatTargetUser(user string) *ChatTarget
func (*ChatHandle) FormulateStimulus ¶
func (cth *ChatHandle) FormulateStimulus(event *MessagerEvent) *ResponseTo
func (*ChatHandle) Identifier ¶
func (cth *ChatHandle) Identifier() string
func (*ChatHandle) Join ¶
func (cth *ChatHandle) Join(target *ChatTarget) error
func (*ChatHandle) LogErrorf ¶
func (cth *ChatHandle) LogErrorf(format string, options ...interface{})
func (*ChatHandle) LogFatalf ¶
func (cth *ChatHandle) LogFatalf(format string, options ...interface{})
func (*ChatHandle) NewListener ¶
func (cth *ChatHandle) NewListener() (*ListenHandle, error)
func (*ChatHandle) NewMessage ¶
func (cth *ChatHandle) NewMessage() *ChatMessage
func (*ChatHandle) OrDie ¶
func (cth *ChatHandle) OrDie(msgs ...string) *ChatHandle
func (*ChatHandle) Send ¶
func (cth *ChatHandle) Send(origmessage *ChatMessage) (*ChatUpdateHandle, error)
func (*ChatHandle) SendChannelf ¶
func (cth *ChatHandle) SendChannelf(Channel string, format string, options ...interface{}) (*ChatUpdateHandle, error)
func (*ChatHandle) SendDefaultf ¶
func (cth *ChatHandle) SendDefaultf(format string, options ...interface{}) (*ChatUpdateHandle, error)
func (*ChatHandle) SendError ¶
func (cth *ChatHandle) SendError(Message string) error
func (*ChatHandle) SendErrorf ¶
func (cth *ChatHandle) SendErrorf(format string, options ...interface{}) error
func (*ChatHandle) SendMessage ¶
func (cth *ChatHandle) SendMessage(Chat *ChatMessage) (*ChatUpdateHandle, error)
func (*ChatHandle) SendOut ¶
func (cth *ChatHandle) SendOut(Channel string, Message string) (*ChatUpdateHandle, error)
func (*ChatHandle) SendSimple ¶
func (cth *ChatHandle) SendSimple(target *ChatTarget, message string) (*ChatUpdateHandle, error)
func (*ChatHandle) SendSimpleChannel ¶
func (cth *ChatHandle) SendSimpleChannel(channel string, message string) (*ChatUpdateHandle, error)
func (*ChatHandle) SetDefaultChannel ¶
func (cth *ChatHandle) SetDefaultChannel(Channel string) *ChatHandle
func (*ChatHandle) SetDefaultSender ¶
func (cth *ChatHandle) SetDefaultSender(Handle string) *ChatHandle
func (*ChatHandle) SetErrorChannel ¶
func (cth *ChatHandle) SetErrorChannel(Channel string) *ChatHandle
func (*ChatHandle) SetValidate ¶
func (cth *ChatHandle) SetValidate()
func (*ChatHandle) ShowConfig ¶
func (cth *ChatHandle) ShowConfig() string
func (*ChatHandle) UserById ¶
func (cth *ChatHandle) UserById(id string) *UserInfo
func (*ChatHandle) Warnings ¶
func (cth *ChatHandle) Warnings() []error
type ChatHandleConfigMap ¶
type ChatHandleConfigMap map[string]*ChatTypeConfig
var ChatHandleConfigs ChatHandleConfigMap
func (ChatHandleConfigMap) Lists ¶
func (c ChatHandleConfigMap) Lists() string
type ChatMessage ¶
type ChatMessage struct { MsgType ChatType Sender string Target *ChatTarget Label string Message string LabelIfReply string UpdateHandle *ChatUpdateHandle Images []*Image History struct { Posted *time.Time } Segments SegmentedMsg Table [][]string Options *sjson.JSON // contains filtered or unexported fields }
func NewChatMessage ¶
func NewChatMessage() *ChatMessage
func (*ChatMessage) Add2Columns ¶
func (Msg *ChatMessage) Add2Columns(Left string, Right string)
func (*ChatMessage) Append ¶
func (Msg *ChatMessage) Append(str string) *ChatMessage
type ChatOptions ¶
type ChatOptions struct { Mediaunfurl bool `json:"mediaunfurl"` Linkunfurl bool `json:"linkunfurl"` Blocks interface{} `json:"blocks"` Parse bool IconUrl string `json:"iconurl"` IconEmoji string Attachtext string SetTopic string PinPost bool `json:"PinPost"` UnpinPost bool `json:"UnpinPost"` RespondTo int64 `json:"respondto"` ThreadLabel string `json:"threadlabel"` UpdateLabel string `json:"updatelabel"` UpdateMsgId string `json:"updatemsgid"` Columns [][]string `json:"columns"` NoText bool }
type ChatTarget ¶
type ChatTarget struct { Handle *ChatHandle Native interface{} Id string Name string IsDM bool IsMpDm bool IsAdmin bool IsPrivate bool IsPublic bool PrintOnly bool // contains filtered or unexported fields }
func (*ChatTarget) Identifier ¶
func (tgt *ChatTarget) Identifier() string
func (*ChatTarget) LogErrorf ¶
func (tgt *ChatTarget) LogErrorf(format string, options ...interface{}) error
func (*ChatTarget) LogFatalf ¶
func (tgt *ChatTarget) LogFatalf(format string, options ...interface{})
func (*ChatTarget) OrDie ¶
func (tgt *ChatTarget) OrDie(msgs ...string) *ChatTarget
func (*ChatTarget) Send ¶
func (tgt *ChatTarget) Send(Msg *ChatMessage) (*ChatUpdateHandle, error)
func (*ChatTarget) SendImageTarget ¶
func (tgt *ChatTarget) SendImageTarget(Image *Image) error
func (*ChatTarget) Sendf ¶
func (tgt *ChatTarget) Sendf(format string, options ...interface{})
func (*ChatTarget) SendfIfDef ¶
func (tgt *ChatTarget) SendfIfDef(format string, options ...interface{})
type ChatTypeConfig ¶
type ChatTypeConfig struct {
BindFunc func(*ChatHandle, *Configuration, string) error
}
type ChatUpdateHandle ¶
type Configuration ¶
type Configuration struct { IniPath string IniFile *ini.File Override *Configuration Fallback *Configuration //vaultClient *api.Client VaultAddr string ChatHandles map[string]*ChatHandle DbHandles map[string]*DbHandle AccessHit SafeIntCache AccessMiss SafeIntCache // contains filtered or unexported fields }
func (*Configuration) ChatTargetFromKey ¶
func (config *Configuration) ChatTargetFromKey(Key string) *ChatTarget
func (*Configuration) ConnectDbBySection ¶
func (config *Configuration) ConnectDbBySection(SectionName string) *DbHandle
func (*Configuration) ConnectDbBySectionOrDie ¶
func (config *Configuration) ConnectDbBySectionOrDie(SectionName string) *DbHandle
func (*Configuration) ConnectDbKey ¶
func (config *Configuration) ConnectDbKey(Key string) *DbHandle
func (*Configuration) DefineDbFromKey ¶
func (config *Configuration) DefineDbFromKey(Key string) *DbHandle
func (*Configuration) DefineDbFromSection ¶
func (config *Configuration) DefineDbFromSection(Section string) *DbHandle
func (*Configuration) ExportAsJson ¶
func (config *Configuration) ExportAsJson() sjson.JSON
func (*Configuration) ExportSectionAsJson ¶
func (config *Configuration) ExportSectionAsJson(Section string) sjson.JSON
func (*Configuration) GetBoolOrDefault ¶
func (config *Configuration) GetBoolOrDefault(Path string, Default bool, DefaultMessage string, Options ...interface{}) bool
func (*Configuration) GetBoolOrDie ¶
func (config *Configuration) GetBoolOrDie(Path string, DieMsg string) bool
func (*Configuration) GetDurationOrDie ¶
func (config *Configuration) GetDurationOrDie(Path string, DieMsg string, options ...interface{}) time.Duration
func (*Configuration) GetFloatOrDie ¶
func (config *Configuration) GetFloatOrDie(Path string, DieMsg string) float64
func (*Configuration) GetInt64OrDefault ¶
func (config *Configuration) GetInt64OrDefault(Path string, Default int64, DefaultMessage string, Options ...interface{}) int64
func (*Configuration) GetIntOrDefault ¶
func (config *Configuration) GetIntOrDefault(Path string, Default int, DefaultMessage string, Options ...interface{}) int
func (*Configuration) GetIntOrDie ¶
func (config *Configuration) GetIntOrDie(Path string, DieMsg string) int
func (*Configuration) GetKey ¶
func (config *Configuration) GetKey(Path string, DieMsg string) (Caw *ini.Key)
func (*Configuration) GetSecret ¶
func (config *Configuration) GetSecret(query string) (bool, sjson.JSON)
func (*Configuration) GetSecretOrDie ¶
func (config *Configuration) GetSecretOrDie(query string) sjson.JSON
func (*Configuration) GetSection ¶
func (config *Configuration) GetSection(Path string) *ini.Section
func (*Configuration) GetString ¶
func (config *Configuration) GetString(Path string) (bool, string)
func (*Configuration) GetStringOrDefault ¶
func (config *Configuration) GetStringOrDefault(Path string, Default string, DefaultMessage string, Options ...interface{}) string
func (*Configuration) GetStringOrDie ¶
func (config *Configuration) GetStringOrDie(Path string, DieMsg string, options ...interface{}) string
func (*Configuration) GetTimeOrDie ¶
func (config *Configuration) GetTimeOrDie(Path string, DieMsg string, options ...interface{}) time.Time
func (*Configuration) Identifier ¶
func (config *Configuration) Identifier() string
func (*Configuration) KeyPrefix ¶
func (config *Configuration) KeyPrefix(Prefix string)
func (*Configuration) ListKeys ¶
func (config *Configuration) ListKeys(Path string) []string
func (*Configuration) ListSections ¶
func (config *Configuration) ListSections() []string
func (*Configuration) ListedKeysPresent ¶
func (config *Configuration) ListedKeysPresent(Keys ...string) (bool, error)
func (*Configuration) LoadAnIni ¶
func (config *Configuration) LoadAnIni(Paths ...string) *Configuration
func (*Configuration) LoadKvOverlay ¶
func (config *Configuration) LoadKvOverlay(VaultPath string) error
func (*Configuration) LoadKvOverlayPrefix ¶
func (config *Configuration) LoadKvOverlayPrefix(VaultPath string, DestPrefix string) error
func (*Configuration) NewChatHandle ¶
func (config *Configuration) NewChatHandle(Section string) *ChatHandle
func (*Configuration) NewMailHandle ¶
func (config *Configuration) NewMailHandle(Section string) *MailHandle
func (*Configuration) OrDie ¶
func (config *Configuration) OrDie(format string, msgs ...interface{}) *Configuration
func (*Configuration) PrintWarnings ¶
func (config *Configuration) PrintWarnings() *Configuration
func (*Configuration) Profile ¶
func (config *Configuration) Profile() string
func (*Configuration) SectionFromKey ¶
func (config *Configuration) SectionFromKey(Key string) *sjson.JSON
func (*Configuration) SetDefaultIni ¶
func (config *Configuration) SetDefaultIni(Path ...string) *Configuration
func (*Configuration) SetFallback ¶
func (config *Configuration) SetFallback(File *Configuration)
func (*Configuration) SetOverride ¶
func (config *Configuration) SetOverride(File *Configuration)
func (*Configuration) SetVaultPrefix ¶
func (config *Configuration) SetVaultPrefix(Prefix string)
type ConnectingEvent ¶
type ConnectingEvent struct{}
type DbHandle ¶
type DbHandle struct { *sql.DB Name string Section string // Section that the config settings came from Key string // Config key pointing to the section (i.e. scraper.dbhandle=scrapedb; that points at the section) Host string DbName string Username string Password string ReadOnly bool // contains filtered or unexported fields }
func (*DbHandle) Identifier ¶
func (*DbHandle) Postmortem ¶
func (*DbHandle) PrepareOrDie ¶
type Diagnostics ¶
func NewDiags ¶
func NewDiags() *Diagnostics
func (*Diagnostics) Html ¶
func (this *Diagnostics) Html() string
type DirectClient ¶
type DirectClient struct { ChatType ChatConnectType Owner string UserIndex UserIndexType RefuseMessagesAfter time.Duration ChannelLookup map[string]*ChatTarget NativeClient interface{} FpSendSimple func(*DirectClient, *ChatTarget, string) (string, string, error) FpSendMessage func(*DirectClient, *ChatMessage) (*ChatUpdateHandle, error) FpFormulateStimulus func(*DirectClient, *MessagerEvent) *ResponseTo FpChatTargetChannel func(*DirectClient, string) *ChatTarget FpChatTargetUser func(*DirectClient, string) *ChatTarget FpJoinChannel func(*DirectClient, *ChatTarget) error FpUserById func(*DirectClient, string) *UserInfo FpManageConnection func(*DirectClient) FpIdentifier func(*DirectClient) string }
func (*DirectClient) ChatTargetChannel ¶
func (dc *DirectClient) ChatTargetChannel(id string) *ChatTarget
func (*DirectClient) ChatTargetUser ¶
func (dc *DirectClient) ChatTargetUser(id string) *ChatTarget
func (*DirectClient) FormulateStimulus ¶
func (dc *DirectClient) FormulateStimulus(event *MessagerEvent) *ResponseTo
func (*DirectClient) Identifier ¶
func (dc *DirectClient) Identifier() string
func (*DirectClient) Join ¶
func (dc *DirectClient) Join(target *ChatTarget) error
func (*DirectClient) SendMessage ¶
func (dc *DirectClient) SendMessage(Chat *ChatMessage) (*ChatUpdateHandle, error)
func (*DirectClient) SendSimple ¶
func (dc *DirectClient) SendSimple(target *ChatTarget, message string) (string, string, error)
func (*DirectClient) SendSimpleChannel ¶
func (*DirectClient) UserById ¶
func (dc *DirectClient) UserById(id string) *UserInfo
type Image ¶
type Image struct {
// contains filtered or unexported fields
}
func (*Image) Identifier ¶
type InvalidAuthEvent ¶
type InvalidAuthEvent struct{}
type ListenHandle ¶
type ListenHandle struct { Dapi *ChatHandle Native interface{} Incoming chan interface{} FpManageConnection func(handle *ListenHandle) // contains filtered or unexported fields }
func (*ListenHandle) ManageConnection ¶
func (lh *ListenHandle) ManageConnection()
type LiveConfig ¶
type LiveConfig struct { Pulse int // contains filtered or unexported fields }
func NewLiveConfig ¶
func NewLiveConfig() *LiveConfig
func (*LiveConfig) Bind ¶
func (Lc *LiveConfig) Bind(Label string, Addr interface{}) *LiveConfigKey
func (*LiveConfig) BindDb ¶
func (Lc *LiveConfig) BindDb(db *DbHandle) *LiveConfig
func (*LiveConfig) FinishLoad ¶
func (Lc *LiveConfig) FinishLoad()
func (*LiveConfig) KeyList ¶
func (Lc *LiveConfig) KeyList() sjson.JSONarray
func (*LiveConfig) KeyRef ¶
func (Lc *LiveConfig) KeyRef(Label string) *LiveConfigKey
func (*LiveConfig) Update ¶
func (Lc *LiveConfig) Update(Label string, Value interface{}) *LiveConfigKey
func (*LiveConfig) WatchConfigs ¶
func (Lc *LiveConfig) WatchConfigs(delay time.Duration)
type LiveConfigKey ¶
type LiveConfigKey struct { Parent *LiveConfig Label string Addr interface{} Type string Version int Updated string }
func (*LiveConfigKey) Replicate ¶
func (Lck *LiveConfigKey) Replicate() error
func (*LiveConfigKey) String ¶
func (Lck *LiveConfigKey) String() string
func (*LiveConfigKey) Update ¶
func (Lck *LiveConfigKey) Update(Value interface{}) *LiveConfigKey
type LookupItem ¶
type LookupItem interface { Name() string Id() int Table() LookupTable IsNil() bool }
type LookupTable ¶
type LookupTable interface { ByIdOrDie(int) LookupItem ById(int) LookupItem LabelToId(string, bool) LookupItem ByNameOrAdd(string) LookupItem ByName(string) LookupItem }
func NewLookup ¶
func NewLookup(tablename string, Db *DbHandle) LookupTable
type MailHandle ¶
type MailHandle struct { DefaultSender string DefaultRecipient string SubjectPrefix string SendmailPath string ActuallySend bool }
func (*MailHandle) NewMailMessage ¶
func (Caw *MailHandle) NewMailMessage() *MailMessage
type MailMessage ¶
type MailMessage struct { From string To string Subject string Body string // contains filtered or unexported fields }
func (*MailMessage) SendViaSendmail ¶
func (Msg *MailMessage) SendViaSendmail() string
type MessagerEvent ¶
type MessagerEvent struct { MsgId string ParentMsgId string ChannelId string SenderUserId string // Account level, not connection level Text string MsgType MsgType Connection interface{} NativeMsg interface{} Timestamp *time.Time FpToStimulus func(*MessagerEvent) *ResponseTo }
func (*MessagerEvent) Channel ¶
func (ev *MessagerEvent) Channel() *ChatTarget
func (*MessagerEvent) ToStimulus ¶
func (ev *MessagerEvent) ToStimulus() *ResponseTo
type MsgSegment ¶
type MsgSegment struct { Text string Itemtype MsgSegmentType }
func (MsgSegment) String ¶
func (Seg MsgSegment) String() string
func (MsgSegment) Type ¶
func (Seg MsgSegment) Type() string
type MsgSegmentType ¶
type MsgSegmentType int
const ( SEGTYPE_UNDEF MsgSegmentType = 0 SEGTYPE_TEXT MsgSegmentType = 1 SEGTYPE_IMGURL MsgSegmentType = 2 SEGTYPE_LABEL MsgSegmentType = 3 )
type ResponseTo ¶
type SafeIntCache ¶
type SafeIntCache struct {
// contains filtered or unexported fields
}
func NewSafeIntCache ¶
func NewSafeIntCache() SafeIntCache
func (*SafeIntCache) Export ¶
func (c *SafeIntCache) Export() (Bob map[string]int)
func (*SafeIntCache) Get ¶
func (c *SafeIntCache) Get(key string) (t int)
func (*SafeIntCache) Inc ¶
func (c *SafeIntCache) Inc(keys ...string) (val int)
func (*SafeIntCache) Set ¶
func (c *SafeIntCache) Set(key string, val int) *SafeIntCache
func (*SafeIntCache) SetM ¶
func (c *SafeIntCache) SetM(val int, keys ...string) *SafeIntCache
func (*SafeIntCache) SetPrefix ¶
func (c *SafeIntCache) SetPrefix(val int, prefixes ...string) *SafeIntCache
type SegmentedMsg ¶
type SegmentedMsg []MsgSegment
func (SegmentedMsg) CompileToMsg ¶
func (Segs SegmentedMsg) CompileToMsg(Chat *ChatTarget) *ChatMessage
type SocketFunction ¶
type SocketFunction struct { SockPath string Buffer string ServeFunc func() string Updated time.Time }
func NewSocketFunction ¶
func NewSocketFunction(Path string) *SocketFunction
func (SocketFunction) ServeAsSocket ¶
func (Sock SocketFunction) ServeAsSocket(Path string)
func (*SocketFunction) SetBuffer ¶
func (Sock *SocketFunction) SetBuffer(Buffer string)
func (*SocketFunction) SetHandler ¶
func (Sock *SocketFunction) SetHandler(Func func() string)
type ThreadPurpose ¶
func NewThreadPurpose ¶
func NewThreadPurpose() *ThreadPurpose
func (*ThreadPurpose) DisarmDeadman ¶
func (t *ThreadPurpose) DisarmDeadman()
func (*ThreadPurpose) Done ¶
func (t *ThreadPurpose) Done()
func (*ThreadPurpose) Dump ¶
func (t *ThreadPurpose) Dump() string
func (*ThreadPurpose) Set ¶
func (t *ThreadPurpose) Set(Purpose string)
func (*ThreadPurpose) SetDeadman ¶
func (t *ThreadPurpose) SetDeadman(Timer time.Duration)
func (*ThreadPurpose) WgAdd ¶
func (t *ThreadPurpose) WgAdd(x int)
func (*ThreadPurpose) WgWait ¶
func (t *ThreadPurpose) WgWait()
type UserIndexType ¶
Click to show internal directories.
Click to hide internal directories.