Documentation ¶
Index ¶
- Variables
- type Database
- func (db *Database) Close(timeout time.Duration) error
- func (db *Database) GetLastContent(ctx context.Context, name, url string) (int64, []byte, error)
- func (db *Database) InsertWatch(ctx context.Context, name, url string, content []byte) (int64, error)
- func (db *Database) PrepareDatabase(ctx context.Context, c config.Configuration) ([]config.WatchConfig, int, error)
- func (db *Database) UpdateLastContent(ctx context.Context, id int64, content []byte) error
- type Interface
- type MockDB
- func (*MockDB) Close(_ time.Duration) error
- func (*MockDB) GetLastContent(_ context.Context, _, _ string) (int64, []byte, error)
- func (*MockDB) InsertWatch(_ context.Context, _, _ string, _ []byte) (int64, error)
- func (*MockDB) PrepareDatabase(_ context.Context, _ config.Configuration) ([]config.WatchConfig, int, error)
- func (*MockDB) UpdateLastContent(_ context.Context, _ int64, _ []byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("url not found in database")
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func (*Database) GetLastContent ¶
func (*Database) InsertWatch ¶
func (*Database) PrepareDatabase ¶
func (db *Database) PrepareDatabase(ctx context.Context, c config.Configuration) ([]config.WatchConfig, int, error)
PrepareDatabase cleans up old entries and returns new ones
type Interface ¶
type Interface interface { Close(timeout time.Duration) error GetLastContent(ctx context.Context, name, url string) (int64, []byte, error) InsertWatch(ctx context.Context, name, url string, content []byte) (int64, error) UpdateLastContent(ctx context.Context, id int64, content []byte) error PrepareDatabase(ctx context.Context, c config.Configuration) ([]config.WatchConfig, int, error) }
type MockDB ¶
type MockDB struct{}
func (*MockDB) GetLastContent ¶
func (*MockDB) InsertWatch ¶
func (*MockDB) PrepareDatabase ¶
func (*MockDB) PrepareDatabase(_ context.Context, _ config.Configuration) ([]config.WatchConfig, int, error)
Click to show internal directories.
Click to hide internal directories.