documents

package
v0.0.0-...-004ddcb Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EdgeLineage       string = "lineage"
	EdgeScoring       string = "scoring"
	EdgeTrust         string = "trust"
	EdgeStack         string = "stack"
	VertexAnnotations string = "annotations"
	VertexData        string = "data"
	VertexScores      string = "scores"
)

Variables

This section is empty.

Functions

func NewULID

func NewULID() ulid.ULID

NewULID is a convenience function for generating ULIDs where necessary. It is based on the example showing the "quick" method for initializing the algorithm's entropy parameter. https://github.com/oklog/ulid/blob/c6bb9e1d94a82e71dfd7ff279aa6cea7c52779bb/cmd/ulid/main.go#L67 As described on that page, quick means "when generating, use non-crypto-grade entropy".

Types

type Annotation

type Annotation struct {
	Key         string              `json:"_key,omitempty"`    // Key uniquely identifies the document in the database
	DataRef     string              `json:"dataRef,omitempty"` // DataRef points to the key of the data being annotated
	Hash        contracts.HashType  `json:"hash,omitempty"`    // Hash identifies which algorithm was used to construct the hash
	Host        string              `json:"host,omitempty"`    // Host is the hostname of the node making the annotation
	Tag         string              `json:"tag,omitempty"`     // Tag is the hash of the source artifact tag that emitted data being annotated
	Layer       contracts.LayerType `json:"layer,omitempty"`
	Kind        string              `json:"type,omitempty"`      // Kind indicates what kind of annotation this is. Defined as string to allow for annotation types outside of the Alvarium Go SDK
	Signature   string              `json:"signature,omitempty"` // Signature contains the signature of the party making the annotation
	IsSatisfied bool                `json:"isSatisfied"`         // IsSatisfied indicates whether the criteria defining the annotation were fulfilled
	Timestamp   time.Time           `json:"timestamp,omitempty"` // Timestamp indicates when the annotation was created
}

Annotation represents a document in the "annotation" vertex collection

func NewAnnotation

func NewAnnotation(a contracts.Annotation) Annotation

NewAnnotation will map an Alvarium SDK annotation into an Annotation document

type Data

type Data struct {
	Key       string    `json:"_key,omitempty"`      // Key uniquely identifies the document in the database
	Timestamp time.Time `json:"timestamp,omitempty"` // Timestamp indicates when the document was created
}

Data represents a document in the "data" vertex collection

type Lineage

type Lineage struct {
	From string `json:"_from"`
	To   string `json:"_to"`
}

Lineage represents a document in the "lineage" edge collection

type Score

type Score struct {
	Key        ulid.ULID           `json:"_key,omitempty"`      // Key uniquely identifies the document in the database
	DataRef    string              `json:"dataRef,omitempty"`   // DataRef points to the key of the data being annotated
	Passed     int                 `json:"score"`               // Passed indicates how many of the annotations for a given dataRef were Satisfied
	Count      int                 `json:"count"`               // Count indicates the total number of annotations applicable to a dataRef
	Policy     string              `json:"policy,omitempty"`    // Policy will indicate some version of the policy used to calculate confidence
	Confidence float64             `json:"confidence"`          // Confidence is the percentage of trust in the dataRef
	Timestamp  time.Time           `json:"timestamp,omitempty"` // Timestamp indicates when the score was calculated
	Tag        []string            `json:"tag,omitempty"`
	Layer      contracts.LayerType `json:"layer,omitempty"`
}

Score represents a document in the "score" vertex collection

func NewScore

func NewScore(dataRef string, annotations []Annotation, policy policies.DcfPolicy, tagFieldScores map[string]Score, hostFieldScores map[string]Score) Score

type Scoring

type Scoring struct {
	From string `json:"_from"`
	To   string `json:"_to"`
}

Scoring represents a document in the "scoring" edge collection

type Stack

type Stack struct {
	From string `json:"_from"`
	To   string `json:"_to"`
}

Scoring represents a document in the "stack" edge collection

type Trust

type Trust struct {
	From string `json:"_from"`
	To   string `json:"_to"`
}

Trust represents a document in the "trust" edge collection

Jump to

Keyboard shortcuts

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