results

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2022 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Overview

Package results contains the result type returned by the classifier backend. Placing the type into a separate module allows us to swap out backends and still use the same datatype.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Classification

type Classification struct {
	Name       string
	Confidence float64
	StartLine  int
	EndLine    int
	Text       string `json:",omitempty"`
}

Classification is the license classification for a segment of a file.

type Classifications

type Classifications []*Classification

Classifications contains all license classifications for a file

type FileClassifications

type FileClassifications struct {
	Filepath        string
	Classifications Classifications
}

FileClassifications contains the license classifications for a particular file.

type JSONResult

type JSONResult []*FileClassifications

JSONResult is the format for the jr JSON file

func NewJSONResult

func NewJSONResult(licenses LicenseTypes, includeText bool) (JSONResult, error)

NewJSONResult creates a new JSONResult object from a LicenseTypes object.

func (JSONResult) Len

func (jr JSONResult) Len() int

func (JSONResult) Less

func (jr JSONResult) Less(i, j int) bool

func (JSONResult) Swap

func (jr JSONResult) Swap(i, j int)

type LicenseType

type LicenseType struct {
	Filename   string
	Name       string
	MatchType  string
	Variant    string
	Confidence float64
	StartLine  int
	EndLine    int
}

LicenseType is the assumed type of the unknown license.

type LicenseTypes

type LicenseTypes []*LicenseType

LicenseTypes is a list of LicenseType objects.

func (LicenseTypes) Len

func (lt LicenseTypes) Len() int

func (LicenseTypes) Less

func (lt LicenseTypes) Less(i, j int) bool

func (LicenseTypes) Swap

func (lt LicenseTypes) Swap(i, j int)

Jump to

Keyboard shortcuts

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