Documentation
¶
Overview ¶
Package elements has wrappers of the protobom elements (from the main protobuf definition) that implement the ref.Val interface used by the CEL runtime. This lets the library expose them natively in the CEL evaluation environment.
As of v0.1.0 the elements package has a complete wrappers library for the native elements defined in protobom v0.5.x.
Index ¶
- Variables
- type Document
- type Edge
- type ExternalReference
- func (er *ExternalReference) ConvertToNative(typeDesc reflect.Type) (any, error)
- func (er *ExternalReference) ConvertToType(typeVal ref.Type) ref.Val
- func (er *ExternalReference) Equal(other ref.Val) ref.Val
- func (er *ExternalReference) Get(index ref.Val) ref.Val
- func (*ExternalReference) Type() ref.Type
- func (er *ExternalReference) Value() any
- type Metadata
- type Node
- func (n *Node) ConvertToNative(typeDesc reflect.Type) (any, error)
- func (n *Node) ConvertToType(typeVal ref.Type) ref.Val
- func (n *Node) Equal(other ref.Val) ref.Val
- func (n *Node) Get(index ref.Val) ref.Val
- func (n *Node) ToNodeList() *NodeList
- func (*Node) Type() ref.Type
- func (n *Node) Value() any
- type NodeList
- func (nl *NodeList) Add(incoming ref.Val)
- func (nl *NodeList) AddEdge(from string, t sbom.Edge_Type, to []string)
- func (nl *NodeList) ConvertToNative(typeDesc reflect.Type) (any, error)
- func (nl *NodeList) ConvertToType(typeVal ref.Type) ref.Val
- func (nl *NodeList) Equal(other ref.Val) ref.Val
- func (nl *NodeList) Get(index ref.Val) ref.Val
- func (nl *NodeList) HasNodeWithID(nodeID string) bool
- func (*NodeList) Type() ref.Type
- func (nl *NodeList) Value() any
- type Person
- type Property
- type Protobom
- type SourceData
- func (sd *SourceData) ConvertToNative(typeDesc reflect.Type) (any, error)
- func (sd *SourceData) ConvertToType(typeVal ref.Type) ref.Val
- func (sd *SourceData) Equal(other ref.Val) ref.Val
- func (sd *SourceData) Get(index ref.Val) ref.Val
- func (*SourceData) Type() ref.Type
- func (sd *SourceData) Value() any
- type Tool
Constants ¶
This section is empty.
Variables ¶
var ( NodeObject = decls.NewObjectType("protobom.protobom.Node") NodeType = cel.ObjectType("protobom.protobom.Node") )
var ( NodeListObject = decls.NewObjectType("protobom.protobom.NodeList") NodeListType = cel.ObjectType("protobom.protobom.NodeList") )
var ( PersonObject = decls.NewObjectType("protobom.protobom.Person") PersonType = cel.ObjectType("protobom.protobom.Person") )
var ( ProtobomObject = decls.NewObjectType("protobom") ProtobomType = cel.ObjectType("protobom", traits.ReceiverType) )
var DocumentType = cel.ObjectType("protobom.protobom.Document")
var EdgeType = cel.ObjectType("protobom.protobom.Edge")
var ExternalReferenceType = cel.ObjectType("protobom.protobom.ExternalReference")
var MetadataType = cel.ObjectType("protobom.protobom.Metadata")
var PropertyType = cel.ObjectType("protobom.protobom.Property")
var SourceDataType = cel.ObjectType("protobom.protobom.SourceData")
var ToolType = cel.ObjectType("protobom.protobom.Tool")
Functions ¶
This section is empty.
Types ¶
type Document ¶
func (*Document) ConvertToNative ¶
ConvertToNative implements ref.Val.ConvertToNative.
func (*Document) ConvertToType ¶
ConvertToType implements ref.Val.ConvertToType.
type Edge ¶
func (*Edge) ConvertToNative ¶
ConvertToNative implements ref.Val.ConvertToNative.
func (*Edge) ConvertToType ¶
ConvertToType implements ref.Val.ConvertToType.
type ExternalReference ¶
type ExternalReference struct {
*sbom.ExternalReference
}
func (*ExternalReference) ConvertToNative ¶
func (er *ExternalReference) ConvertToNative(typeDesc reflect.Type) (any, error)
ConvertToNative implements ref.Val.ConvertToNative.
func (*ExternalReference) ConvertToType ¶
func (er *ExternalReference) ConvertToType(typeVal ref.Type) ref.Val
ConvertToType implements ref.Val.ConvertToType.
func (*ExternalReference) Equal ¶
func (er *ExternalReference) Equal(other ref.Val) ref.Val
Equal implements ref.Val.Equal.
func (*ExternalReference) Get ¶
func (er *ExternalReference) Get(index ref.Val) ref.Val
Get is the getter to implement the indexer trait
func (*ExternalReference) Type ¶
func (*ExternalReference) Type() ref.Type
func (*ExternalReference) Value ¶
func (er *ExternalReference) Value() any
Value implements ref.Val.Value.
type Metadata ¶
func (*Metadata) ConvertToNative ¶
ConvertToNative implements ref.Val.ConvertToNative.
func (*Metadata) ConvertToType ¶
ConvertToType implements ref.Val.ConvertToType.
type Node ¶
func (*Node) ConvertToNative ¶
ConvertToNative implements ref.Val.ConvertToNative.
func (*Node) ConvertToType ¶
ConvertToType implements ref.Val.ConvertToType.
func (*Node) ToNodeList ¶
ToNodeList returns a new NodeList with the node as the only member
type NodeList ¶
func (*NodeList) ConvertToNative ¶
ConvertToNative implements ref.Val.ConvertToNative.
func (*NodeList) ConvertToType ¶
ConvertToType implements ref.Val.ConvertToType.
func (*NodeList) HasNodeWithID ¶
HasNodeWithID Returns true if the NodeList already has a node with the specified ID
type Person ¶
func (*Person) ConvertToNative ¶
func (*Person) ConvertToType ¶
ConvertToType implements ref.Val.ConvertToType.
type Property ¶
func (*Property) ConvertToNative ¶
ConvertToNative implements ref.Val.ConvertToNative.
func (*Property) ConvertToType ¶
ConvertToType implements ref.Val.ConvertToType.
type Protobom ¶
type Protobom struct{}
Protobom is a global object that the CEL integration exposes in the environment this object groups some of the SBOM utility functions that are not methods of the protobom elements.
func (*Protobom) ConvertToType ¶
ConvertToType implements ref.Val.ConvertToType.
type SourceData ¶
type SourceData struct {
*sbom.SourceData
}
func (*SourceData) ConvertToNative ¶
func (sd *SourceData) ConvertToNative(typeDesc reflect.Type) (any, error)
ConvertToNative implements ref.Val.ConvertToNative.
func (*SourceData) ConvertToType ¶
func (sd *SourceData) ConvertToType(typeVal ref.Type) ref.Val
ConvertToType implements ref.Val.ConvertToType.
func (*SourceData) Equal ¶
func (sd *SourceData) Equal(other ref.Val) ref.Val
Equal implements ref.Val.Equal.
func (*SourceData) Get ¶
func (sd *SourceData) Get(index ref.Val) ref.Val
Get is the getter to implement the indexer trait
func (*SourceData) Type ¶
func (*SourceData) Type() ref.Type
type Tool ¶
func (*Tool) ConvertToNative ¶
ConvertToNative implements ref.Val.ConvertToNative.
func (*Tool) ConvertToType ¶
ConvertToType implements ref.Val.ConvertToType.