Versions in this module Expand all Collapse all v0 v0.2.0 Mar 6, 2024 Changes in this version + type Database interface + Close func(ctx context.Context) error + GetEnvironments func(ctx context.Context) ([]summary.Environment, error) + GetHistory func(ctx context.Context, environment ...summary.Environment) ([]*entities.PuppetHistory, error) + GetReport func(ctx context.Context, id string) (*entities.PuppetReport, error) + GetReports func(ctx context.Context, fqdn string) ([]*entities.PuppetReportSummary, error) + GetRuns func(ctx context.Context) ([]*entities.PuppetRun, error) + GetRunsByState func(ctx context.Context, states ...summary.State) ([]*entities.PuppetRun, error) + Ping func(ctx context.Context) error + Purge func(ctx context.Context, from time.Time) (int, error) + SaveRun func(ctx context.Context, run *entities.PuppetReport) error + func NewMongo(ctx context.Context) (Database, error) + func NewMySQL() (Database, error) + func NewSQLite() (Database, error) v0.1.0 Feb 22, 2024 Changes in this version + var DB database + var DatabaseLatency = promauto.NewHistogramVec(prometheus.HistogramOpts{ ... }, []string{ ... }) + var ErrDuplicate = errors.New("duplicate record") + var ErrNotFound = errors.New("record not found") + var Files fileHandler + var StorageLatency = promauto.NewHistogramVec(prometheus.HistogramOpts{ ... }, []string{ ... }) + func ConnectDatabase(ctx context.Context, dbType string) error + func ConnectStorage(ctx context.Context, storeType StoreType, bucketName string) error + func Purge(from time.Time) error + func PurgeAll() error + type DbOpt string + const DbMongo + const DbMySQL + const DbSqlite + func (d DbOpt) IsIn(opts ...DbOpt) bool + func (d DbOpt) String() string + func (d DbOpt) Valid() bool + type MockDb struct + func (m *MockDb) Close(ctx context.Context) error + func (m *MockDb) GetEnvironments(ctx context.Context) ([]entities.Environment, error) + func (m *MockDb) GetHistory(ctx context.Context, environment entities.Environment) ([]*entities.PuppetHistory, error) + func (m *MockDb) GetReport(ctx context.Context, id string) (*entities.PuppetReport, error) + func (m *MockDb) GetReports(ctx context.Context, fqdn string) ([]*entities.PuppetReportSummary, error) + func (m *MockDb) GetRuns(ctx context.Context) ([]*entities.PuppetRun, error) + func (m *MockDb) GetRunsByState(ctx context.Context, states ...entities.State) ([]*entities.PuppetRun, error) + func (m *MockDb) Ping(ctx context.Context) error + func (m *MockDb) Purge(ctx context.Context, from time.Time) (int, error) + func (m *MockDb) SaveRun(ctx context.Context, run *entities.PuppetReport) error + type MockStorage struct + func (m *MockStorage) DeleteFile(ctx context.Context, filePath string) error + func (m *MockStorage) DownloadFile(ctx context.Context, filePath string) ([]byte, error) + func (m *MockStorage) Purge(ctx context.Context, from time.Time) (int, error) + func (m *MockStorage) SaveFile(ctx context.Context, filePath string, file []byte) error + type StoreType string + const StoreTypeGCS + const StoreTypeLocal + const StoreTypeS3