sqlsrc

package
v0.0.0-...-d086b3f Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ChatsSelectQuery string
	BotsSelectQuery  string
	PostSelectQuery  string
}

Config contains queries to fetch data

type Src

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

func New

func New(db *sqlx.DB, config Config) (*Src, error)

func NewPostgreSQL

func NewPostgreSQL(config Config, sslMode bool, envPrefix string) (*Src, error)

NewPostgreSQL returns new PostgreSQL input source

The function takes credentials from env:

  • envPrefix+DB_USER
  • envPrefix+DB_NAME
  • envPrefix+DB_PASS
  • envPrefix+DB_HOST
  • envPrefix+DB_PORT

Default envPrefix is "SENDER_"

func (*Src) GetBots

func (s *Src) GetBots() ([]dto.Bot, error)

func (*Src) GetChatsForBot

func (s *Src) GetChatsForBot(botID int) ([]dto.Chat, error)

func (*Src) GetScheduledAd

func (s *Src) GetScheduledAd(y, m, d int) (dto.ScheduledAd, error)

Jump to

Keyboard shortcuts

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