message

package
v0.0.0-...-63c59c6 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chat

type Chat struct {
	Id       int64
	Username string
	Created  time.Time
}

type Repository

type Repository interface {
	GetById(id int64) (Chat, error)
	Add(chat Chat) error
	GetAll() ([]Chat, error)
}

type Service

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

func NewService

func NewService(repository Repository, botAPI *tgbotapi.BotAPI) *Service

func (*Service) AddChat

func (s *Service) AddChat(chat Chat) error

func (*Service) SendMessageToAllChats

func (s *Service) SendMessageToAllChats(message string) error

type Storage

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

func NewStorage

func NewStorage(db *sql.DB) *Storage

func (*Storage) Add

func (r *Storage) Add(chat Chat) error

func (*Storage) GetAll

func (r *Storage) GetAll() ([]Chat, error)

func (*Storage) GetById

func (r *Storage) GetById(id int64) (Chat, error)

Jump to

Keyboard shortcuts

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