chatbot

package
v0.0.0-...-1e86b11 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DebugTrace

func DebugTrace(l Logger, f func() error) func()

func DebugTraceResult

func DebugTraceResult(l Logger, f func() (interface{}, error)) func()

func DebugTraceVerbose

func DebugTraceVerbose(l Logger, s string, f func() (interface{}, error)) func()

func Exec

func Exec(bot Bot, dir string, timeout time.Duration, name string, arg ...string) (stdoutStr string, stderrStr string, err error)

func ExecShow

func ExecShow(bot Bot, dir string, name string, arg ...string) (err error)

func ExecShowOpts

func ExecShowOpts(bot Bot, dir string, timeout time.Duration, name string, arg ...string) (err error)

func ExecShowResults

func ExecShowResults(bot Bot, dir string, name string, arg ...string) (stdout string, stderr string, err error)

func ExecShowResultsOpts

func ExecShowResultsOpts(bot Bot, dir string, timeout time.Duration, name string, arg ...string) (stdout string, stderr string, err error)

func FunctionTraceVerbose

func FunctionTraceVerbose(l Logger, s string, f func() (interface{}, error)) func()

func GenericTraceVerbose

func GenericTraceVerbose(l Logger, s string, f func() (interface{}, error), okLog LogFn, errLog LogFn) func()

func GitPull

func GitPull(bot Bot, dir string, remote string, branch string) (err error)

func GitPullAt

func GitPullAt(bot Bot, dir string, commit string) (err error)

func InfoTraceVerbose

func InfoTraceVerbose(l Logger, s string, f func() (interface{}, error)) func()

func Ingest

func Ingest(bot Bot, msg chat1.MsgSummary) error

func Listen

func Listen(bot Bot) error

func MakeAPI

func MakeAPI(keybaseBinaryPath string) (*kbchat.API, error)

func NewTeamChannel

func NewTeamChannel(name, channel string) chat1.ChatChannel

func UpdateBot

func UpdateBot(bot Bot) (err error)

Types

type Bot

type Bot interface {
	Logger
	API() *kbchat.API
	Dispatch(msg chat1.MsgSummary, args []string) error
	DispatchReaction(msg chat1.MsgSummary, message string) error
	SourceDirectory() string
	ACL() access.ACL
	WarnOnCrash() bool
}

type ChatLogger

type ChatLogger struct {
	API          *kbchat.API
	Name         string
	DebugChannel chat1.ChatChannel
	InfoChannel  chat1.ChatChannel
}

func (ChatLogger) Alert

func (l ChatLogger) Alert()

func (ChatLogger) AlertWith

func (l ChatLogger) AlertWith(s string)

func (ChatLogger) Debug

func (l ChatLogger) Debug(format string, args ...interface{})

func (ChatLogger) Info

func (l ChatLogger) Info(format string, args ...interface{})

func (ChatLogger) VDebug

func (l ChatLogger) VDebug(format string, args ...interface{})

type LogFn

type LogFn func(format string, args ...interface{})

type Logger

type Logger interface {
	Debug(format string, args ...interface{})
	Info(format string, args ...interface{})
	VDebug(format string, args ...interface{})
	Alert()
	AlertWith(string)
}

Jump to

Keyboard shortcuts

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