Documentation
¶
Index ¶
Constants ¶
View Source
const ( // ReportMetadataIDField represents the name of the debug.Report.Metadata field used // to store the document ID. ReportMetadataIDField = "_id" )
Variables ¶
This section is empty.
Functions ¶
func IsInternalLabel ¶
IsInternalLabel can be used for Metadata keys to figure out if label is internal.
Types ¶
type Report ¶
type Report struct {
Package string
Version string
Author string
Subject string
Notes string
Build debug.BuildInfo `yaml:"build,omitempty"`
CreatedAt time.Time `yaml:"created_at,omitempty"`
UpdatedAt time.Time `yaml:"updated_at,omitempty"`
UpdatedBy string `yaml:"-"`
Closed bool `yaml:"closed,omitempty"`
ClosedAt time.Time `yaml:"closed_at,omitempty"`
Metadata map[string]string
}
Report contains informatin about a suspected or confirmed bug.
type ReportDocument ¶
type ReportDocument struct {
Type documentType
Report Report
}
ReportDocument is the in-storage representation of a Report.
func (ReportDocument) ID ¶
func (r ReportDocument) ID() string
func (ReportDocument) UpdatedTime ¶
func (r ReportDocument) UpdatedTime() time.Time
func (ReportDocument) WithID ¶
func (r ReportDocument) WithID(id string) ReportDocument
func (ReportDocument) WithUpdatedBy ¶
func (r ReportDocument) WithUpdatedBy(author string) ReportDocument
func (ReportDocument) WithUpdatedTime ¶
func (r ReportDocument) WithUpdatedTime(now time.Time) ReportDocument
type Tracker ¶
type Tracker interface {
// GetReport gets a Report from its id.
GetReport(context.Context, string) (Report, error)
// DeleteReport permanently deletes a Report with the given id.
DeleteReport(context.Context, string) error
// CloseReport marks a Report with the given id closed. This method
// is idempotent.
CloseReport(context.Context, string) error
// AddReport stores the given Report. Implementation must return an erro
// if Report.Package, Report.Author or Report.Subject are not defined.
CreateReport(context.Context, Report) (string, error)
// ListVersionReports lists open reports of a package version, unless
// "Closed": "true" is passed as a filter, in which case all closed reports
// are returned.
ListVersionReports(ctx context.Context, pkg, ver string,
filters map[string]string) (iterator.Iterator[Report], error)
// ListPackageReports lists open reports of a package, unless
// "Closed": "true" is passed as a filter, in which case all closed reports
// are returned.
ListPackageReports(ctx context.Context, pkg string,
filters map[string]string) (iterator.Iterator[Report], error)
// UpdateReport overrides the given Report.
UpdateReport(ctx context.Context, id string, r Report) error
}
Tracker abstracts the ability to manage bug and feature reports.
func NewDocumentTracker ¶
NewDocumentTracker returns a Tracker backed by a document.Service.
Click to show internal directories.
Click to hide internal directories.