publish

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package publish delivers rendered reports (report.Artifact) to destinations. A Publisher is the "where" of reporting — separate from the Reporter (the "what", pkg/report) — so a scan can render several formats once and deliver them to several destinations.

Built-in publishers: file. Each publisher is configured from a saga.PublisherConfig.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Kinds

func Kinds() []string

Kinds lists the available publisher kinds, sorted.

func Run

func Run(ctx context.Context, reports []saga.ReportConfig, publishers []saga.PublisherConfig, data report.Data) error

Run renders each configured report format once, then delivers every rendered artifact to every configured publisher. It returns the first error encountered; a publisher that fails does not prevent the others from being attempted.

Types

type Publisher

type Publisher interface {
	// Kind is the publisher's config selector, e.g. "file".
	Kind() string
	// Publish delivers the artifacts. A publisher may use only the artifacts it cares about
	// (e.g. a code-scanning publisher would take the SARIF one), ignoring the rest.
	Publish(ctx context.Context, artifacts []report.Artifact) error
}

Publisher delivers rendered report artifacts to one destination.

func For

func For(cfg saga.PublisherConfig) (Publisher, error)

For resolves a configured publisher, validating its kind and required fields.

Jump to

Keyboard shortcuts

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