app

package
v0.0.0-...-1616de3 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2018 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *sqlx.DB

DB variable contains the connection, and I keep it always open until the program exists

Functions

func Handler

func Handler(s *Slack) (http.Handler, error)

Handler ...

func InitDb

func InitDb()

InitDb checks if those mandatory environment variables are set, and opens the connection to the database

func Run

func Run(ctx context.Context, s *Slack) error

Run is the primary service to generate and kick off the slackbot listener This portion receives all incoming Real Time Messages notices from the workspace as registered by the API token

Types

type Kudos

type Kudos struct {
	UUID     string `db:"kudo_uuid"`
	Comment  string `db:"kudo_comment"`
	FromName string `db:"from_name"`
	ToName   string `db:"to_name"`
	Date     string `db:"date"`
}

Kudos is the db structure of a kudo

type Slack

type Slack struct {
	Name  string
	Token string

	User   string
	UserID string

	Client       *slack.Client
	MessageEvent *slack.MessageEvent
}

Slack is the primary struct for our slackbot

func New

func New() (*Slack, error)

New returns a new instance of the Slack struct, primary for our slackbot

Jump to

Keyboard shortcuts

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