client

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Channels map[string]string

Channels holds all slack channels mapped from name -> id and vice vers from id -> name

View Source
var Projects map[string]string

Projects is a map of all projects which should be accessible by boggy via Slack This doesn't handle the permissions which need to be granted via JIRA

View Source
var Users map[string]string

Users holds all slack users mapped from name -> id and vice versa from id -> name

Functions

func GetJiraClient

func GetJiraClient(cfg config.JiraConfig) (*jira.Client, error)

GetJiraClient establishes a connection to the JIRA server

Types

type Slack

type Slack struct {
	slack.RTM
}

Slack is a wrapper for the RTM connection

func GetSlackClient

func GetSlackClient(cfg config.SlackConfig) *Slack

GetSlackClient establishes a RTM connection to the slack server

func (Slack) Respond

func (s Slack) Respond(event *slack.MessageEvent, text string, options ...slack.MsgOption) string

Respond handles messages sent to Slack

func (Slack) TrimMessage

func (s Slack) TrimMessage(msg string, trim string) string

TrimMessage removes a specified from the message start and removes white spaces and line breaks in the beginning and end of the message

type SlackClient

type SlackClient interface {
	Respond(event *slack.MessageEvent, text string, options ...slack.MsgOption) string
	TrimMessage(msg string, trim string) string
	AuthTest() (response *slack.AuthTestResponse, error error)
}

SlackClient is the main slack interface

Jump to

Keyboard shortcuts

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