repowriter

package
v2.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// WriterTypeText corresponds to the Writer returned by Text.
	WriterTypeText = WriterType(iota)

	// WriterTypeScorecard corresponds to the Writer returned by Scorecard.
	WriterTypeScorecard
)

Variables

View Source
var ErrorUnknownRepoWriterType = errors.New("unknown repo writer type")

Functions

This section is empty.

Types

type Writer

type Writer interface {
	// Write outputs a single repository url.
	Write(repo string) error
}

Writer is a simple interface for writing a repo. This interface is to abstract output formats for lists of repository urls.

func Scorecard

func Scorecard(w io.Writer) Writer

Scorecard creates a new Writer instance that is used to write a csv file of repositories that is compatible with the github.com/ossf/scorecard project.

The csv file has a header row with columns "repo" and "metadata". Each row consists of the repository url and blank metadata.

func Text

func Text(w io.Writer) Writer

Text creates a new Writer instance that is used to write a simple text file of repositories, where each line has a single repository url.

type WriterType

type WriterType int

func (WriterType) MarshalText

func (t WriterType) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface.

func (*WriterType) New

func (t *WriterType) New(w io.Writer) Writer

New will return a new instance of the corresponding implementation of Writer for the given WriterType.

func (WriterType) String

func (t WriterType) String() string

String implements the fmt.Stringer interface.

func (*WriterType) UnmarshalText

func (t *WriterType) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface.

Jump to

Keyboard shortcuts

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