audit

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormIssueSummary

func FormIssueSummary(auditResults []*protocol.AuditReport) string

Types

type DefaultAuditSummaryFactory

type DefaultAuditSummaryFactory struct {
	// contains filtered or unexported fields
}

DefaultAuditSummaryFactory to create summary log message of audit

func NewAuditSummaryFactory

func NewAuditSummaryFactory(toleranceStore protocol.ToleranceStore) *DefaultAuditSummaryFactory

NewAuditSummaryFactory is constructor

func (*DefaultAuditSummaryFactory) Create

func (a *DefaultAuditSummaryFactory) Create(auditResults []*protocol.AuditReport, auditJob *job.Audit) (*protocol.AuditSummary, error)

Create create summary log message of audit

type Report

type Report struct {
	AuditID        string
	GroupValue     string
	FieldID        string
	MetricName     string
	MetricValue    float64
	Condition      string
	Metadata       datatypes.JSON
	ToleranceRules string
	PassFlag       bool
	CreatedAt      time.Time
}

Report as a struct to store audit result to DB

type ResultStore

type ResultStore struct {
	// contains filtered or unexported fields
}

ResultStore as a model for resultstore struct

func NewResultStore

func NewResultStore(db *gorm.DB, tableName string) *ResultStore

NewResultStore to construct result store

func (*ResultStore) StoreResults

func (rs *ResultStore) StoreResults(results []*protocol.AuditReport) error

StoreResults to store auditing result

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service as audit service

func NewService

func NewService(profileStore protocol.ProfileStore,
	auditStore protocol.AuditStore,
	resultStore protocol.AuditResultStore,
	auditor protocol.Auditor,
	publisher protocol.Publisher,
	messageProviderFactory protocol.MessageProviderFactory,
	metadataStore protocol.MetadataStore,
	statsClientBuilder stats.ClientBuilder) *Service

NewService is constructor

func (*Service) RunAudit

func (s *Service) RunAudit(profileID string) (*protocol.AuditResult, error)

RunAudit to run audit and return the result

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store as a model for resultstore struct

func NewStore

func NewStore(db *gorm.DB, tableName string, statusStore protocol.StatusStore) *Store

NewStore to construct result store

func (*Store) CreateAudit

func (a *Store) CreateAudit(auditJob *job.Audit) (*job.Audit, error)

CreateAudit is implementation on create audit

func (*Store) UpdateAudit

func (a *Store) UpdateAudit(auditJob *job.Audit) error

UpdateAudit is implementation to insert status based on audit event

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL