Storage is a way to store checkup results in a SQL database.
| 28 | |
| 29 | // Storage is a way to store checkup results in a SQL database. |
| 30 | type Storage struct { |
| 31 | // SqliteDBFile is the sqlite3 DB where check results will be stored. |
| 32 | SqliteDBFile string `json:"sqlite_db_file,omitempty"` |
| 33 | |
| 34 | // PostgreSQL contains the Postgres connection settings. |
| 35 | PostgreSQL *struct { |
| 36 | Host string `json:"host,omitempty"` |
| 37 | Port int `json:"port,omitempty"` |
| 38 | User string `json:"user"` |
| 39 | Password string `json:"password,omitempty"` |
| 40 | DBName string `json:"dbname"` |
| 41 | SSLMode string `json:"sslmode,omitempty"` |
| 42 | } `json:"postgresql"` |
| 43 | |
| 44 | // Check files older than CheckExpiry will be |
| 45 | // deleted on calls to Maintain(). If this is |
| 46 | // the zero value, no old check files will be |
| 47 | // deleted. |
| 48 | CheckExpiry time.Duration `json:"check_expiry,omitempty"` |
| 49 | } |
| 50 | |
| 51 | // New creates a new Storage instance based on json config |
| 52 | func New(config json.RawMessage) (Storage, error) { |
nothing calls this directly
no outgoing calls
no test coverage detected