Documentation ¶
Overview ¶
Package fossa provides a high-level interface to the FOSSA API (by default, located at https://app.fossa.io).
Index ¶
- Variables
- func Initialize(server, APIKey string) error
- func MustInitialize(server, APIKey string)
- func NormalizeGitURL(project string) string
- func NormalizeType(t module.Type) (string, error)
- func Post(endpoint string, body []byte) (res string, statusCode int, err error)
- type Build
- type Dependency
- type ImportPath
- type ImportPathString
- type Locator
- type SourceUnit
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoProject = errors.New("no project provided for upload") ErrNoRevision = errors.New("no revision provided for upload") ErrNoBuildData = errors.New("no build data to upload") )
Errors related to preconditions.
View Source
var ( ErrForbidden = errors.New("authentication failed (is the API key correct?)") ErrRevisionDoesNotExist = errors.New("revision does not exist (are the project and revision correct and published in FOSSA?)") )
Errors resulting from a bad API response.
Functions ¶
func MustInitialize ¶
func MustInitialize(server, APIKey string)
MustInitialize crashes and logs a fatal exception if `Initialize` fails.
func NormalizeGitURL ¶
Types ¶
type Build ¶
type Build struct { Artifact string Context interface{} Succeeded bool Error error `json:",omitempty"` Dependencies []Dependency }
type Dependency ¶
type ImportPath ¶
type ImportPath []Locator
func ReadImportPath ¶
func ReadImportPath(s ImportPathString) ImportPath
func (ImportPath) String ¶
func (p ImportPath) String() ImportPathString
type ImportPathString ¶
type ImportPathString string
type Locator ¶
type Locator struct { Fetcher string `json:"fetcher"` Project string `json:"package"` Revision string `json:"revision"` }
func ReadLocator ¶
func Upload ¶
func Upload(fetcher, project, revision, title, branch string, data []SourceUnit) (Locator, error)
func (Locator) IsResolved ¶
Click to show internal directories.
Click to hide internal directories.