Documentation
¶
Overview ¶
Package thread_mate here we define functions to help with platform mentions. For now, it covers only Slack syntax. In order to cover other platforms, we need to move it to the Botkube platform renderers and provide a common function that we can use in our message templating. For example,
body:
plaintext: |
Thanks for reaching out! Today, {{ .Assignee.ID | toMention }} will assist you in getting your Botkube up and running.
This way `toMention` function can be properly set per each platform.
Index ¶
- Constants
- Variables
- type ActivityCmd
- type Assignee
- type Commands
- type Config
- type ConfigMapDumper
- type ExportActivityCmd
- type ExportCmd
- type GetCmd
- type PersistenceConfig
- type PickCmd
- type PickConfig
- type ResolveCmd
- type RoundRobin
- type RoundRobinConfig
- type SystemData
- type TakeoverCmd
- type Thread
- type ThreadMate
- func (t *ThreadMate) Export(export *ExportCmd) api.Message
- func (t *ThreadMate) GetActivity(cmd *ActivityCmd, message executor.Message) api.Message
- func (t *ThreadMate) GetSearchSection(cmd *ActivityCmd, message executor.Message, selectedOpts []api.OptionItem, ...) api.Section
- func (t *ThreadMate) Pick(cmd *PickCmd, msg executor.Message) ([]api.Message, error)
- func (t *ThreadMate) Resolve(r *ResolveCmd, message executor.Message) api.Message
- func (t *ThreadMate) Start()
- func (t *ThreadMate) Takeover(takeover *TakeoverCmd, message executor.Message) api.Message
- type ThreadType
- type Threads
Constants ¶
const ( ThreadTypeOngoing = "ongoing" ThreadTypeResolved = "resolved" )
Variables ¶
var ( //go:embed config_schema.json ConfigJSONSchema string )
Functions ¶
This section is empty.
Types ¶
type ActivityCmd ¶
type ActivityCmd struct {
AssigneeIDs string `arg:"--assignee-ids"`
Type ThreadType `arg:"--thread-type"`
PageIdx int `arg:"-p,--page"`
}
ActivityCmd represents the "activity" subcommand under the "get" command.
type Commands ¶
type Commands struct {
Pick *PickCmd `arg:"subcommand:pick"`
Get *GetCmd `arg:"subcommand:get"`
Resolve *ResolveCmd `arg:"subcommand:resolve"`
Takeover *TakeoverCmd `arg:"subcommand:takeover"`
Export *ExportCmd `arg:"subcommand:export"`
}
Commands represents a collection of subcommands.
type Config ¶
type Config struct {
RoundRobin RoundRobinConfig `yaml:"roundRobin"`
Logger config.Logger `yaml:"log"`
Pick PickConfig `yaml:"pick"`
Persistence PersistenceConfig `yaml:"persistence"`
}
Config holds the executor configuration.
func MergeConfigs ¶
MergeConfigs merges the configuration.
type ConfigMapDumper ¶
type ConfigMapDumper struct {
// contains filtered or unexported fields
}
ConfigMapDumper is a utility for working with Kubernetes ConfigMaps.
func NewConfigMapDumper ¶
func NewConfigMapDumper(k8sCli kubernetes.Interface) *ConfigMapDumper
NewConfigMapDumper creates a new instance of ConfigMapDumper.
func (*ConfigMapDumper) Get ¶
func (a *ConfigMapDumper) Get(namespace, name string) (string, error)
Get retrieves data from a ConfigMap in the specified namespace.
func (*ConfigMapDumper) SaveOrUpdate ¶
func (a *ConfigMapDumper) SaveOrUpdate(namespace, name, data string) error
SaveOrUpdate saves or updates data in a ConfigMap in the specified namespace.
type ExportActivityCmd ¶
type ExportActivityCmd struct {
Type string `arg:"--type"`
}
ExportActivityCmd represents the options for the "export activity" subcommand.
type ExportCmd ¶
type ExportCmd struct {
Activity *ExportActivityCmd `arg:"subcommand:activity"`
}
ExportCmd represents the "export" subcommand.
type GetCmd ¶
type GetCmd struct {
Activity *ActivityCmd `arg:"subcommand:activity"`
}
GetCmd represents the "get" subcommand.
type PersistenceConfig ¶
type PickCmd ¶
type PickCmd struct {
MessageContext string `arg:"-m,--message"`
}
PickCmd represents the "pick" subcommand.
type PickConfig ¶
type ResolveCmd ¶
type ResolveCmd struct {
ID string `arg:"--id"`
}
ResolveCmd represents the "resolve" subcommand.
type RoundRobin ¶
type RoundRobin struct {
// contains filtered or unexported fields
}
type RoundRobinConfig ¶
type SystemData ¶
func (*SystemData) IsDirty ¶
func (t *SystemData) IsDirty() bool
func (*SystemData) MarkDirty ¶
func (t *SystemData) MarkDirty()
func (*SystemData) ResetDirty ¶
func (t *SystemData) ResetDirty()
func (*SystemData) RoundRobinPickNext ¶
func (t *SystemData) RoundRobinPickNext() uint32
type TakeoverCmd ¶
type TakeoverCmd struct {
ID string `arg:"--id"`
}
TakeoverCmd represents the "takeover" subcommand.
type Thread ¶
type Thread struct {
ID string `csv:"-"`
Assignee Assignee
MessageContext executor.Message `csv:"Message"`
StartedAt time.Time
ResolvedBy Assignee
}
Thread represents a conversation thread.
type ThreadMate ¶
type ThreadMate struct {
// contains filtered or unexported fields
}
ThreadMate represents the main component for managing threads and interactions.
func New ¶
func New(cfg Config, cfgDumper *ConfigMapDumper) *ThreadMate
New creates a new instance of ThreadMate.
func (*ThreadMate) Export ¶
func (t *ThreadMate) Export(export *ExportCmd) api.Message
Export handles the "export" command.
func (*ThreadMate) GetActivity ¶
func (t *ThreadMate) GetActivity(cmd *ActivityCmd, message executor.Message) api.Message
GetActivity handles the "get activity" command and retrieves thread activity.
func (*ThreadMate) GetSearchSection ¶
func (t *ThreadMate) GetSearchSection(cmd *ActivityCmd, message executor.Message, selectedOpts []api.OptionItem, allOpts []api.OptionItem) api.Section
func (*ThreadMate) Resolve ¶
func (t *ThreadMate) Resolve(r *ResolveCmd, message executor.Message) api.Message
Resolve handles the "resolve" command and marks a thread as resolved.
func (*ThreadMate) Takeover ¶
func (t *ThreadMate) Takeover(takeover *TakeoverCmd, message executor.Message) api.Message
Takeover handles the "takeover" command and allows an assignee to take over a thread.
type ThreadType ¶
type ThreadType string
func (ThreadType) IsEmptyOrEqual ¶
func (t ThreadType) IsEmptyOrEqual(exp ThreadType) bool
type Threads ¶
Threads represents a collection of conversation threads.
func (*Threads) Mutate ¶
Mutate applies a mutation function to a thread with the specified ID. If the thread is found, the mutation is applied, and the dirty flag is set to true.
func (*Threads) ResetDirty ¶
func (t *Threads) ResetDirty()
ResetDirty resets the dirty flag to indicate that changes have been saved.