Documentation
¶
Index ¶
- type MemoryStorage
- func (s *MemoryStorage) Close()
- func (s *MemoryStorage) GetLastResponses(watcher int, n int) ([]ResponseRecord, error)
- func (s *MemoryStorage) GetWatchers() ([]WatcherRecord, error)
- func (s *MemoryStorage) InsertResponse(watcher int, online bool, responsetime time.Duration) error
- func (s *MemoryStorage) InsertTestData()
- func (s *MemoryStorage) InsertWatcher(url string, watcher string) (WatcherRecord, error)
- type PostgresStore
- func (pg *PostgresStore) Close()
- func (pg *PostgresStore) GetLastResponses(watcher int, len int) ([]ResponseRecord, error)
- func (pg *PostgresStore) GetWatchers() ([]WatcherRecord, error)
- func (pg *PostgresStore) InsertResponse(watcher int, online bool, responsetime time.Duration) error
- func (pg *PostgresStore) InsertWatcher(url string, watcher string) (WatcherRecord, error)
- type ResponseRecord
- type Storage
- type WatcherRecord
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemoryStorage ¶
type MemoryStorage struct { Watchers []WatcherRecord Responses []ResponseRecord }
func NewMemorystore ¶
func NewMemorystore() (*MemoryStorage, error)
func (*MemoryStorage) Close ¶
func (s *MemoryStorage) Close()
func (*MemoryStorage) GetLastResponses ¶
func (s *MemoryStorage) GetLastResponses(watcher int, n int) ([]ResponseRecord, error)
func (*MemoryStorage) GetWatchers ¶
func (s *MemoryStorage) GetWatchers() ([]WatcherRecord, error)
func (*MemoryStorage) InsertResponse ¶
func (*MemoryStorage) InsertTestData ¶
func (s *MemoryStorage) InsertTestData()
func (*MemoryStorage) InsertWatcher ¶
func (s *MemoryStorage) InsertWatcher(url string, watcher string) (WatcherRecord, error)
type PostgresStore ¶
type PostgresStore struct {
// contains filtered or unexported fields
}
func NewPostgresStore ¶
func NewPostgresStore() (*PostgresStore, error)
func (*PostgresStore) Close ¶
func (pg *PostgresStore) Close()
func (*PostgresStore) GetLastResponses ¶
func (pg *PostgresStore) GetLastResponses(watcher int, len int) ([]ResponseRecord, error)
func (*PostgresStore) GetWatchers ¶
func (pg *PostgresStore) GetWatchers() ([]WatcherRecord, error)
func (*PostgresStore) InsertResponse ¶
func (*PostgresStore) InsertWatcher ¶
func (pg *PostgresStore) InsertWatcher(url string, watcher string) (WatcherRecord, error)
type ResponseRecord ¶
type Storage ¶
type Storage interface { Close() GetWatchers() ([]WatcherRecord, error) InsertWatcher(url string, watcher string) (WatcherRecord, error) GetLastResponses(watcher int, len int) ([]ResponseRecord, error) InsertResponse(watcher int, online bool, responsetime time.Duration) error }
type WatcherRecord ¶
Click to show internal directories.
Click to hide internal directories.