Documentation
¶
Index ¶
- func AssertCanSafelyRunReportingTests(t *testing.T, err error, expectInstallErr bool, errMsgArr []string) bool
- func AssertErrorContainsErrorMsgs(t *testing.T, err error, errMsgArr []string)
- func AssertReportResultsEqual(t *testing.T, expected, actual []map[string]interface{}, ...)
- func DecodeMeteringConfigManifest(basePath, manifestPath, manifestFilename string) (*metering.MeteringConfig, error)
- func ExecPodCommandWithOptions(config *rest.Config, client kubernetes.Interface, options *ExecActionOptions) (bytes.Buffer, bytes.Buffer, error)
- func GatherRegistryResources(outputPath, scriptPath, name, namespace string) error
- func NewPrestoTable(name, namespace, catalog, schema string, columns []presto.Column) *metering.PrestoTable
- func NewReport(name string, namespace string, testQueryName string, ...) *metering.Report
- func NewReportDataSource(name, namespace string) *metering.ReportDataSource
- func NewReportQuery(name, namespace string, columns []metering.ReportQueryColumn) *metering.ReportQuery
- func PtrToBool(val bool) *bool
- func SetupLogger(logLevelStr string) logrus.FieldLogger
- func SetupLoggerToFile(path, logLevel string, fields logrus.Fields) (logrus.FieldLogger, *os.File, error)
- type ExecActionOptions
- type ReportDataSourceStore
- type ReportQueryStore
- type ReportStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeMeteringConfigManifest ¶
func DecodeMeteringConfigManifest(basePath, manifestPath, manifestFilename string) (*metering.MeteringConfig, error)
func ExecPodCommandWithOptions ¶
func ExecPodCommandWithOptions(config *rest.Config, client kubernetes.Interface, options *ExecActionOptions) (bytes.Buffer, bytes.Buffer, error)
func GatherRegistryResources ¶
GatherRegistryResources is a test helper function responsible for providing inputs and executing the @scriptPath bash script, which dumps out the YAML manifest for the CatalogSource and the corresponding PackageManifest resources that were used to deploy a custom version of Metering.
func NewPrestoTable ¶
func NewPrestoTable(name, namespace, catalog, schema string, columns []presto.Column) *metering.PrestoTable
func NewReport ¶
func NewReport( name string, namespace string, testQueryName string, inputs metering.ReportQueryInputValues, reportStart *time.Time, reportEnd *time.Time, status metering.ReportStatus, schedule *metering.ReportSchedule, runImmediately bool, expiration *meta.Duration, ) *metering.Report
NewReport creates a mock report used for testing purposes.
func NewReportDataSource ¶
func NewReportDataSource(name, namespace string) *metering.ReportDataSource
func NewReportQuery ¶
func NewReportQuery(name, namespace string, columns []metering.ReportQueryColumn) *metering.ReportQuery
func SetupLogger ¶
func SetupLogger(logLevelStr string) logrus.FieldLogger
func SetupLoggerToFile ¶
func SetupLoggerToFile(path, logLevel string, fields logrus.Fields) (logrus.FieldLogger, *os.File, error)
SetupLoggerToFile is a helper function that initializes and returns a logrus FieldLogger instance that directs its output to the @path file instead of os.Stdout.
Types ¶
type ExecActionOptions ¶
type ExecActionOptions struct { Name string Namespace string Container string Command []string UseTTY bool }
ExecActionOptions holds all the metadata required to fire off a Pod exec REST API call. This is mainly a wrapper around the corev1.ExecAction type: https://pkg.go.dev/k8s.io/api/core/v1?tab=doc#ExecAction
func NewExecOptions ¶
func NewExecOptions(name, namespace, container string, useTTY bool, cmd []string) *ExecActionOptions
type ReportDataSourceStore ¶
type ReportDataSourceStore struct {
// contains filtered or unexported fields
}
func NewReportDataSourceStore ¶
func NewReportDataSourceStore(datasources []*metering.ReportDataSource) (store *ReportDataSourceStore)
func (*ReportDataSourceStore) GetReportDataSource ¶
func (store *ReportDataSourceStore) GetReportDataSource(namespace, name string) (*metering.ReportDataSource, error)
type ReportQueryStore ¶
type ReportQueryStore struct {
// contains filtered or unexported fields
}
func NewReportQueryStore ¶
func NewReportQueryStore(queries []*metering.ReportQuery) (store *ReportQueryStore)
func (*ReportQueryStore) GetReportQuery ¶
func (store *ReportQueryStore) GetReportQuery(namespace, name string) (*metering.ReportQuery, error)
type ReportStore ¶
type ReportStore struct {
// contains filtered or unexported fields
}
func NewReportStore ¶
func NewReportStore(reports []*metering.Report) (store *ReportStore)