Documentation ¶
Overview ¶
Package reporter provides interface implementation for reporting provenance information as useful library.
Index ¶
- Variables
- type Report
- func (r *Report) ReportCipdAdmission(ctx context.Context, pkgName, iid string) (bool, error)
- func (r *Report) ReportCipdDigest(ctx context.Context, digest, pkgName, iid string) (bool, error)
- func (r *Report) ReportGcsDigest(ctx context.Context, digest, gcsURI string) (bool, error)
- func (r *Report) ReportGcsDownload(ctx context.Context, uri, digest string) (bool, error)
- func (r *Report) ReportGitCheckout(ctx context.Context, repo, commit, ref string) (bool, error)
- func (r *Report) ReportPID(ctx context.Context, pid int64) (bool, error)
- func (r *Report) ReportSbomDigest(ctx context.Context, digest, gcsURI string, subjectDigests []string) (bool, error)
- func (r *Report) ReportStage(ctx context.Context, stage snooperpb.TaskStage, recipe string, pid int64) (bool, error)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Report ¶
type Report struct {
RClient snooperpb.SelfReportClient
}
Report implements all provenance interfaces.
This can be used as a caching opportunity by users for storing client for longer use. TODO(crbug/1269830): Implement a custom retry logic for transient errors. Custom retry is needed because grpc status `Unavailable` is tagged as transient. In this application, `ErrServiceUnavailable` is a permanent but acceptable error code.
func (*Report) ReportCipdAdmission ¶
ReportCipdAdmission reports a local cipd admission to provenance.
It returns a success status and annotated error. Status is to indicate user whether to block further execution. If local provenance service is unavailable, it will return an ok status and annotated error. This is to indicate, the user should continue normal execution. All other errors are annotated to indicate permanent failures.
func (*Report) ReportCipdDigest ¶
ReportCipdDigest reports digest of built cipd package to provenance.
It returns a success status and annotated error. Status is to indicate user whether to block further execution. If local provenance service is unavailable, it will return an ok status and annotated error. This is to indicate, the user should continue normal execution. All other errors are annotated to indicate permanent failures.
func (*Report) ReportGcsDigest ¶
ReportGcsDigest reports digest of a built gcs app to provenance.
It returns a success status and annotated error. Status is to indicate user whether to block further execution. If local provenance service is unavailable, it will return an ok status and annotated error. This is to indicate, the user should continue normal execution. All other errors are annotated to indicate permanent failures.
func (*Report) ReportGcsDownload ¶
ReportGcsDownload reports a local gcs download to provenance.
It returns a success status and annotated error. Status is to indicate user whether to block further execution. If local provenance service is unavailable, it will return an ok status and annotated error. This is to indicate, the user should continue normal execution. All other errors are annotated to indicate permanent failures.
func (*Report) ReportGitCheckout ¶
ReportGitCheckout reports a local git checkout/fetch to provenance.
It returns a success status and annotated error. Status is to indicate user whether to block further execution. If local provenance service is unavailable, it will return an ok status and annotated error. This is to indicate, the user should continue normal execution. All other errors are annotated to indicate permanent failures.
func (*Report) ReportPID ¶
ReportPID reports process id to provenance local server for tracking.
It returns a success status and annotated error. Status is to indicate user whether to block further execution.
If local provenance service is unavailable, it will return an ok status and annotated error. This is to indicate that the user should continue normal execution. All other errors are annotated to indicate permanent failures.
func (*Report) ReportSbomDigest ¶
func (r *Report) ReportSbomDigest(ctx context.Context, digest, gcsURI string, subjectDigests []string) (bool, error)
ReportSbomDigest reports digest of a built gcs SBOM to provenance.
It returns a success status and annotated error. Status is to indicate user whether to block further execution. If local provenance service is unavailable, it will return an ok status and annotated error. This is to indicate, the user should continue normal execution. All other errors are annotated to indicate permanent failures.
func (*Report) ReportStage ¶
func (r *Report) ReportStage(ctx context.Context, stage snooperpb.TaskStage, recipe string, pid int64) (bool, error)
ReportStage reports task stage via provenance local server.
It returns a success status and annotated error. Status is to indicate user whether to block further execution. If local provenance service is unavailable, it will return an ok status and annotated error. This is to indicate, the user should continue normal execution. All other errors are annotated to indicate permanent failures. TODO: Use go struct when a new parameter is added.