data

package
v0.0.0-...-1322e1a Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Raw key on "ARTIFACT_ADD" type Records
	UInfoKey = "u"

	// Raw key on "ARTIFACT_ADD" type Records
	InfoKey = "i"

	// Raw key on "ARTIFACT_ADD" type Records
	NameKey = "n"

	// Raw key on "ARTIFACT_ADD" type Records
	DescriptionKey = "d"

	// Raw key on "ARTIFACT_ADD" type Records
	RecordModifiedKey = "m"

	// Raw key on "ARTIFACT_ADD" type Records
	ClassnamesKey = "classnames"

	// Raw key on "ARTIFACT_ADD" type Records
	SHA1Key = "1"

	// Raw key on "DESCRIPTOR" type Records
	IDXINFO = "IDXINFO"

	// Parsed value for null records found in index source
	NotAvailable = "NA"

	// Field separator for parsing raw index-sourced records with multi values
	RecordValueSeparator = `|`
)

Variables

The RecordKey lists below determine an ordering for iterating over known Record values, for Output formats that require stable ordering

View Source
var RecordTypeNames = map[RecordType]string{
	Descriptor:     "descriptor",
	ArtifactAdd:    "artifact_add",
	ArtifactRemove: "artifact_remove",
	AllGroups:      "all_groups",
	RootGroups:     "root_groups",
}

Functions

This section is empty.

Types

type Properties

type Properties struct {
	// contains filtered or unexported fields
}

Properties represents a well-formed Java properties file along with some convenience methods.

func NewProperties

func NewProperties(props map[string]string) Properties

func (Properties) GetAsInt

func (pr Properties) GetAsInt(key string) (int, error)

func (Properties) GetAsString

func (pr Properties) GetAsString(key string) (string, error)

func (Properties) GetAsTimestamp

func (pr Properties) GetAsTimestamp(key string) (time.Time, error)

type Record

type Record struct {
	// contains filtered or unexported fields
}

Record -

func NewRecord

func NewRecord(logger *log.Logger, indexRecord map[string]string) (Record, error)

NewRecord - parses the input map then populates and returns a well-formed Record, or an error.

func (Record) Get

func (r Record) Get(key keys.Record) interface{}

Get - obtain a parsed well-formed, well-typed attribute value as stored on the given Record, or nil if no value is present. result values must be cast by caller if non-nil

func (Record) Keys

func (r Record) Keys() []keys.Record

Keys - obtain a fixed-order list of well-formed Record attribute keys the caller can iterate on to obtain similarly-ordered values.

func (Record) Payload

func (r Record) Payload() map[keys.Record]interface{}

Payload - obtain the full internal representation of the Record's data attributes. Useful for output formats that can more easily work with this data

func (Record) Type

func (r Record) Type() RecordType

Type - expose index record types for callers

type RecordType

type RecordType uint8

RecordType - the type of index entry this record represents. For index reading purposes, only ArtifactAdd and ArtifactRemove are important to parse and retain.

Directories

Path Synopsis
types

Jump to

Keyboard shortcuts

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