reporting

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2025 License: ISC Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const PLAKAR_API_URL = "https://api.plakar.io/v1/reporting/reports"

Variables

This section is empty.

Functions

This section is empty.

Types

type Emitter

type Emitter interface {
	Emit(ctx context.Context, report *Report) error
}

type HttpEmitter

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

func (*HttpEmitter) Emit

func (emitter *HttpEmitter) Emit(ctx context.Context, report *Report) error

type NullEmitter

type NullEmitter struct {
}

func (*NullEmitter) Emit

func (emitter *NullEmitter) Emit(ctx context.Context, report *Report) error

type Report

type Report struct {
	Timestamp  time.Time         `json:"timestamp"`
	Task       *ReportTask       `json:"report_task,omitempty"`
	Repository *ReportRepository `json:"report_repository,omitempty"`
	Snapshot   *ReportSnapshot   `json:"report_snapshot,omitempty"`
	// contains filtered or unexported fields
}

func (*Report) Publish added in v1.0.3

func (report *Report) Publish()

func (*Report) SetIgnore added in v1.0.3

func (report *Report) SetIgnore()

func (*Report) TaskDone added in v1.0.3

func (report *Report) TaskDone()

func (*Report) TaskFailed added in v1.0.3

func (report *Report) TaskFailed(errorCode TaskErrorCode, errorMessage string, args ...interface{})

func (*Report) TaskStart added in v1.0.3

func (report *Report) TaskStart(kind string, name string)

func (*Report) TaskWarning added in v1.0.3

func (report *Report) TaskWarning(errorMessage string, args ...interface{})

func (*Report) WithRepository added in v1.0.3

func (report *Report) WithRepository(repository *repository.Repository)

func (*Report) WithRepositoryName added in v1.0.3

func (report *Report) WithRepositoryName(name string)

func (*Report) WithSnapshot added in v1.0.3

func (report *Report) WithSnapshot(snapshot *snapshot.Snapshot)

func (*Report) WithSnapshotID added in v1.0.3

func (report *Report) WithSnapshotID(snapshotId objects.MAC)

type ReportRepository

type ReportRepository struct {
	Name    string                `json:"name"`
	Storage storage.Configuration `json:"storage"`
}

type ReportSnapshot

type ReportSnapshot struct {
	header.Header
}

type ReportTask

type ReportTask struct {
	Type         string        `json:"type"`
	Name         string        `json:"name"`
	StartTime    time.Time     `json:"start_time"`
	Duration     time.Duration `json:"duration"`
	Status       TaskStatus    `json:"status"`
	ErrorCode    TaskErrorCode `json:"error_code"`
	ErrorMessage string        `json:"error_message"`
}

type Reporter

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

func NewReporter

func NewReporter(ctx *appcontext.AppContext) *Reporter

func (*Reporter) NewReport added in v1.0.3

func (reporter *Reporter) NewReport() *Report

func (*Reporter) Process added in v1.0.3

func (reporter *Reporter) Process(report *Report)

func (*Reporter) StopAndWait added in v1.0.3

func (reporter *Reporter) StopAndWait()

type TaskErrorCode

type TaskErrorCode uint32

type TaskStatus

type TaskStatus string
const (
	StatusOK      TaskStatus = "OK"
	StatusWarning TaskStatus = "WARNING"
	StatusFailed  TaskStatus = "FAILURE"
)

Jump to

Keyboard shortcuts

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