db

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAlreadyExists error = fmt.Errorf("already exists")

Functions

This section is empty.

Types

type Database

type Database interface {
	GetLastUpdateTime(url, filter string) time.Time
	GetLastTag(url, filter string) string
	UpdateLastUpdateTime(url, filter, tag string, t time.Time)

	AddFeed(name, repo, filter, messagePattern string) (int, error)
	GetFeed(name string) (*Feed, error)
	ListFeeds() ([]*Feed, error)

	// Subscriptions
	AddSubscribtion(endpoint, url, filter string, chatID int64) error
	RemoveSubscribtion(endpoint, url, filter string, chatID int64) error

	// Notification methods
	GetNotificationMethods(url, filter string) ([]string, error)

	// Endpoints
	GetEndpointInfo(endpoint, url, filter string) ([]int64, error)
}

func NewSQLite

func NewSQLite() Database

type Feed

type Feed struct {
	Id             int
	Repo           string
	Filter         string
	Name           string
	MessagePattern string
}

type SQLite

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

func (*SQLite) AddFeed

func (d *SQLite) AddFeed(name, repo, filter, messagePattern string) (int, error)

func (*SQLite) AddSubscribtion

func (d *SQLite) AddSubscribtion(endpoint, url, filter string, chatID int64) error

func (*SQLite) GetEndpointInfo

func (d *SQLite) GetEndpointInfo(endpoint, url, filter string) ([]int64, error)

func (*SQLite) GetFeed

func (d *SQLite) GetFeed(name string) (*Feed, error)

func (*SQLite) GetLastTag

func (d *SQLite) GetLastTag(url, filter string) string

GetLastTag - gets Last Tag

func (*SQLite) GetLastUpdateTime

func (d *SQLite) GetLastUpdateTime(url, filter string) time.Time

GetLastUpdateTime - gets Last Update Time

func (*SQLite) GetNotificationMethods

func (d *SQLite) GetNotificationMethods(url, filter string) ([]string, error)

func (*SQLite) ListFeeds

func (d *SQLite) ListFeeds() ([]*Feed, error)

func (*SQLite) RemoveSubscribtion

func (d *SQLite) RemoveSubscribtion(endpoint, url, filter string, chatID int64) error

func (*SQLite) UpdateLastUpdateTime

func (d *SQLite) UpdateLastUpdateTime(url, filter, tag string, t time.Time)

Jump to

Keyboard shortcuts

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