db

package
v0.0.0-...-2d91164 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TableInitQuery = "CREATE TABLE IF NOT EXISTS tokens (teamId TEXT PRIMARY KEY, botToken TEXT, webHookUrl TEXT)"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {
	Init() error
	InsertSlackBot(teamId, botToken, webHookUrl string) error
	GetSlackBot(teamId string) (string, string, error)
	GetAllSlackBots() ([]SlackBot, error)
}

type SlackBot

type SlackBot struct {
	TeamId     string
	BotToken   string
	WebHookUrl string
}

type SqliteDb

type SqliteDb struct {
	// contains filtered or unexported fields
}

func NewSqliteDB

func NewSqliteDB(file string) *SqliteDb

func (*SqliteDb) GetAllSlackBots

func (sdb *SqliteDb) GetAllSlackBots() ([]SlackBot, error)

func (*SqliteDb) GetSlackBot

func (sdb *SqliteDb) GetSlackBot(teamId string) (string, string, error)

func (*SqliteDb) Init

func (sdb *SqliteDb) Init() error

func (*SqliteDb) InsertSlackBot

func (sdb *SqliteDb) InsertSlackBot(teamId, botToken, webHookUrl string) error

Jump to

Keyboard shortcuts

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