upload

package
v1.1.10 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: MPL-2.0 Imports: 13 Imported by: 2

Documentation

Overview

Package upload implements `fossa upload`.

`fossa upload` provides manual overrides for users whose builds are too complex or too custom for `fossa analyze` to successfully analyze. It essentially acts as a thin wrapper on top of the FOSSA API.

This command has multiple upload modes which accept different kinds of input. The upload modes are:

  1. Raw mode (default): uses the raw JSON that the CLI would normally upload. This is a thin wrapper over cURL.
  2. Locator mode: provides a newline-delimited list of locators. This is the simplest data format to generate, but also provides the least metadata. Most simple shell scripts could probably generate this.
  3. Graph mode (not implemented): provides the JSON dependency graph format used internally by the CLI. This is a good balance between complexity and ease-of-use. Generating this probably needs a proper script.
  4. Tarball mode (not implemented): provides a folder to upload as a project tarball.

Index

Constants

This section is empty.

Variables

View Source
var Cmd = cli.Command{
	Name:      "upload",
	Usage:     "Uploads user-provided test results to FOSSA",
	Action:    Run,
	ArgsUsage: "DATA",
	Flags: flags.WithAPIFlags(flags.WithGlobalFlags([]cli.Flag{
		cli.BoolFlag{Name: flags.Short(Locators), Usage: "upload data in locator format (instead of JSON)"},
	})),
}

Cmd is the CLI command struct for uploading.

View Source
var (
	Locators = "locators"
)

Command-specific flags for `fossa upload`.

Functions

func Do

func Do(data []fossa.SourceUnit) (fossa.Locator, error)

Do performs a SourceUnit upload of the current project without other side effects.

func ParseLocators

func ParseLocators(locators string) (fossa.SourceUnit, error)

ParseLocators parses newline-delimited string locators into SourceUnits.

func Run

func Run(ctx *cli.Context) error

Run executes the upload command.

Types

This section is empty.

Jump to

Keyboard shortcuts

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