goals

package
v0.0.71 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GoalConfigsDiffer added in v0.0.15

func GoalConfigsDiffer(log skill.Logger, config skill.Configuration, digest string, previousConfigHash string) (bool, string, error)

Returns the config hash for the current skill config

func GoalResultsDiffer added in v0.0.15

func GoalResultsDiffer(log skill.Logger, queryResults []GoalEvaluationQueryResult, digest string, previousStorageId string) (bool, string, error)

GoalResultsDiffer checks if the current query results differ from the previous ones. It returns the storage id for the current query results.

Types

type Attestation added in v0.0.47

type Attestation struct {
	PredicateType *string     `edn:"intoto.attestation/predicate-type"`
	Predicates    []Predicate `edn:"intoto.predicate/_attestation"`
}

type BuildKitProvenanceMode added in v0.0.53

type BuildKitProvenanceMode struct {
	Ident edn.Keyword `edn:"db/ident"`
}

type DockerImageEntity

type DockerImageEntity struct {
	skill.Entity `entity-type:"docker/image"`
	Digest       string `edn:"docker.image/digest"`
}

type EvaluationMetadata added in v0.0.16

type EvaluationMetadata struct {
	SubscriptionResult []map[edn.Keyword]edn.RawMessage `edn:"subscription-result"`
	SubscriptionTx     int64                            `edn:"subscription-tx"`
	SubscriptionBasisT int64                            `edn:"subscription-basis-t"`
}

type EvaluationResult added in v0.0.16

type EvaluationResult struct {
	EvaluationCompleted bool
	Result              []GoalEvaluationQueryResult
}

type Goal

type Goal struct {
	Args          map[string]interface{}
	Definition    string
	Configuration string
}

type GoalEvaluationContext added in v0.0.48

type GoalEvaluationContext struct {
	Log          skill.Logger
	TeamId       string
	Organization string
	Goal         Goal
}

type GoalEvaluationQueryResult

type GoalEvaluationQueryResult struct {
	Details map[edn.Keyword]interface{} `edn:"details" json:"details"`
}

type GoalEvaluationResultEntity

type GoalEvaluationResultEntity struct {
	skill.Entity         `entity-type:"goal/result"`
	Definition           string                     `edn:"goal.definition/name"`
	Configuration        string                     `edn:"goal.configuration/name"`
	Subject              DockerImageEntity          `edn:"goal.result/subject"`
	DeviationCount       interface{}                `edn:"goal.result/deviation-count,omitempty"`
	StorageId            interface{}                `edn:"goal.result/storage-id,omitempty"`
	ConfigHash           string                     `edn:"goal.result/config-hash"`
	CreatedAt            time.Time                  `edn:"goal.result/created-at"`
	TransactionCondition TransactionConditionEntity `edn:"atomist/tx-iff"`
}

func CreateEntitiesFromResults

func CreateEntitiesFromResults(results []GoalEvaluationQueryResult, goalDefinition string, goalConfiguration string, image string, storageId string, configHash string, evaluationTs time.Time, tx int64, retract bool) GoalEvaluationResultEntity

type GoalEvaluator added in v0.0.15

type GoalEvaluator interface {
	EvaluateGoal(ctx context.Context, evalCtx GoalEvaluationContext, sbom types.SBOM, extraData []map[edn.Keyword]edn.RawMessage) (EvaluationResult, error)
}

type ImagePlatform added in v0.0.15

type ImagePlatform struct {
	Architecture string `edn:"docker.platform/architecture" json:"architecture"`
	Os           string `edn:"docker.platform/os" json:"os"`
	Variant      string `edn:"docker.platform/variant" json:"variant"`
}

type ImageSubscriptionQueryResult added in v0.0.47

type ImageSubscriptionQueryResult struct {
	ImageDigest    string                  `edn:"docker.image/digest"`
	ImagePlatforms []ImagePlatform         `edn:"docker.image/platform" json:"platforms"`
	FromReference  *SubscriptionImage      `edn:"docker.image/from"`
	FromRepo       *SubscriptionRepository `edn:"docker.image/from-repository"`
	FromTag        string                  `edn:"docker.image/from-tag"`
	Attestations   []Attestation           `edn:"intoto.attestation/_subject"`
	User           string                  `edn:"docker.image/user,omitempty"`
}

type OsDistro added in v0.0.47

type OsDistro struct {
	Name    string `edn:"os.distro/name"`
	Version string `edn:"os.distro/version"`
}

type Predicate added in v0.0.47

type Predicate struct {
	ProvenanceMode *BuildKitProvenanceMode `edn:"buildkit.provenance/mode,omitempty"`
}

type RetractionEntity added in v0.0.16

type RetractionEntity struct {
	Retract bool `edn:"retract"`
}

type SubscriptionImage added in v0.0.47

type SubscriptionImage struct {
	Digest string    `edn:"docker.image/digest"`
	Distro *OsDistro `edn:"docker.image/distro"`
}

type SubscriptionRepository added in v0.0.47

type SubscriptionRepository struct {
	Host       string `edn:"docker.repository/host"`
	Repository string `edn:"docker.repository/repository"`
}

type TransactionConditionEntity added in v0.0.16

type TransactionConditionEntity struct {
	Args  map[string]interface{} `edn:"args"`
	Where edn.RawMessage         `edn:"where"`
}

Jump to

Keyboard shortcuts

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