model

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IsConfiguredFlag               int64 = 0
	IsSecureFlag                   int64 = 1
	IsRecoveryFlag                 int64 = 2
	IsDebugFlag                    int64 = 3
	IsReplayProtectedFlag          int64 = 4
	IsIntegrityProtectedFlag       int64 = 5
	IsRuntimeMeasuredFlag          int64 = 6
	IsImmutableFlag                int64 = 7
	IsTcbFlag                      int64 = 8
	IsConfidentialityProtectedFlag int64 = 9
)
View Source
const (
	MvalVersion            int64 = 0
	MvalSvn                int64 = 1
	MvalDigests            int64 = 2
	MvalFlags              int64 = 3
	MvalRawValue           int64 = 4
	MvalMACAddr            int64 = 6
	MvalIPAddr             int64 = 7
	MvalSerialNumber       int64 = 8
	MvalUEID               int64 = 9
	MvalUUID               int64 = 10
	MvalName               int64 = 11
	MvalCryptoKeys         int64 = 13
	MvalIntegrityRegisters int64 = 14
	MvalIntRange           int64 = 15
)

Variables

View Source
var SupportedTagIDTypes = []TagIDType{
	StringTagID,
	UUIDTagID,
}

Functions

func CoMIDEntitiesToCoRIM

func CoMIDEntitiesToCoRIM(origin []*Entity) (*comid.Entities, error)

func CoMIDExtensionsToCoRIM

func CoMIDExtensionsToCoRIM(origin []*ExtensionValue) (comid.Extensions, error)

func CoRIMEntitiesToCoRIM

func CoRIMEntitiesToCoRIM(origin []*Entity) (*corim.Entities, error)

func CoRIMExtensionsToCoRIM

func CoRIMExtensionsToCoRIM(origin []*ExtensionValue) (corim.Extensions, error)

func ConditionalEndorsementSeriesRecordsToCoRIM added in v0.3.0

func ConditionalEndorsementSeriesRecordsToCoRIM(
	origin []*ConditionalEndorsementSeriesRecord,
) (comid.CondEndorseSeriesRecords, error)

func ConditionalEndorsementSeriesTriplesToCoRIM added in v0.3.0

func ConditionalEndorsementSeriesTriplesToCoRIM(
	origin []*ConditionalEndorsementSeriesTriple,
) (*comid.CondEndorseSeriesTriples, error)

func ConditionalEndorsementTriplesToCoRIM added in v0.3.0

func ConditionalEndorsementTriplesToCoRIM(
	origin []*ConditionalEndorsementTriple,
) (*comid.CondEndorseTriples, error)

func CryptoKeysToCoRIM

func CryptoKeysToCoRIM(origin []*CryptoKey) (*comid.CryptoKeys, error)

func DigestsToCoRIM

func DigestsToCoRIM(origin []*Digest) (*comid.Digests, error)

func DomainDependencyTriplesToCoRIM added in v0.3.0

func DomainDependencyTriplesToCoRIM(origin []*DomainDependencyTriple) (*comid.DomainDependencyTriples, error)

func DomainEntriesToCoRIM added in v0.3.0

func DomainEntriesToCoRIM(origin []*DomainEntry) ([]comid.Environment, error)

func DomainMembershipTriplesToCoRIM added in v0.3.0

func DomainMembershipTriplesToCoRIM(origin []*DomainMembershipTriple) (*comid.DomainMembershipTriples, error)

func FlagsToCoRIM

func FlagsToCoRIM(origin []*Flag) (*comid.FlagsMap, error)

func HrefsToCoRIM added in v0.3.0

func HrefsToCoRIM(origin []*Href) corim.OneOrMore[comid.TaggedURI]

func IntegerityRegistersToCoRIM

func IntegerityRegistersToCoRIM(origin []*IntegrityRegister) (*comid.IntegrityRegisters, error)

func KeyTriplesToCoRIM

func KeyTriplesToCoRIM(origin []*KeyTriple, typ KeyTripleType) (*comid.KeyTriples, error)

func LinkedTagsToCoRIM

func LinkedTagsToCoRIM(origin []*LinkedTag) (*comid.LinkedTags, error)

func LocatorsToCoRIM

func LocatorsToCoRIM(origin []*Locator) (*[]corim.Locator, error)

func MeasurementsToCoRIM

func MeasurementsToCoRIM(origin []*Measurement) (comid.Measurements, error)

func ParseCoMIDRole

func ParseCoMIDRole(text string) (comid.Role, error)

func ParseCoRIMRole

func ParseCoRIMRole(text string) (corim.Role, error)

func RegisterModels

func RegisterModels(db *bun.DB)

func ResetModels

func ResetModels(ctx context.Context, db *bun.DB) error

func StatefulEnvironmentsToCoRIM added in v0.3.0

func StatefulEnvironmentsToCoRIM(origin []*StatefulEnvironment) (*comid.StatefulEnvironments, error)

func UpdateSelectQueryFromEnvironment

func UpdateSelectQueryFromEnvironment(
	query *bun.SelectQuery,
	env *Environment,
	exact bool,
	dialect schema.Dialect,
) *bun.SelectQuery

func ValueTriplesToCoRIM

func ValueTriplesToCoRIM(origin []*ValueTriple, typ ValueTripleType) (*comid.ValueTriples, error)

Types

type ConditionalEndorsementSeriesRecord added in v0.3.0

type ConditionalEndorsementSeriesRecord struct {
	bun.BaseModel `bun:"table:conditional_endorsement_series_records,alias:cesr"`

	ID int64 `bun:",pk,autoincrement"`

	Selection []*Measurement `bun:"rel:has-many,join:id=owner_id,join:type=owner_type,polymorphic:ces_record_selection"`
	Addition  []*Measurement `bun:"rel:has-many,join:id=owner_id,join:type=owner_type,polymorphic:ces_record_addition"`
	TripleID  int64
}

func ConditionalEndorsementSeriesRecordsFromCoRIM added in v0.3.0

func ConditionalEndorsementSeriesRecordsFromCoRIM(
	origin comid.CondEndorseSeriesRecords,
) ([]*ConditionalEndorsementSeriesRecord, error)

func NewConditionalEndorsementSeriesRecordFromCoRIM added in v0.3.0

func NewConditionalEndorsementSeriesRecordFromCoRIM(
	origin *comid.CondEndorseSeriesRecord,
) (*ConditionalEndorsementSeriesRecord, error)

func (*ConditionalEndorsementSeriesRecord) DbID added in v0.3.0

func (*ConditionalEndorsementSeriesRecord) Delete added in v0.3.0

func (*ConditionalEndorsementSeriesRecord) FromCoRIM added in v0.3.0

func (*ConditionalEndorsementSeriesRecord) Insert added in v0.3.0

func (*ConditionalEndorsementSeriesRecord) IsTable added in v0.3.0

func (*ConditionalEndorsementSeriesRecord) OwnerDbID added in v0.3.0

func (*ConditionalEndorsementSeriesRecord) OwnerName added in v0.3.0

func (*ConditionalEndorsementSeriesRecord) Select added in v0.3.0

func (*ConditionalEndorsementSeriesRecord) TableName added in v0.3.0

func (*ConditionalEndorsementSeriesRecord) ToCoRIM added in v0.3.0

func (*ConditionalEndorsementSeriesRecord) Validate added in v0.3.0

type ConditionalEndorsementSeriesTriple added in v0.3.0

type ConditionalEndorsementSeriesTriple struct {
	bun.BaseModel `bun:"table:conditional_endorsement_series_triples,alias:cest"`

	ID int64 `bun:",pk,autoincrement"`

	EnvironmentID int64        `bun:",nullzero"`
	Environment   *Environment `bun:"rel:belongs-to,join:environment_id=id"`

	Measurements []*Measurement `bun:"rel:has-many,join:id=owner_id,join:type=owner_type,polymorphic:ces_condition"`

	AuthorizedBy []*CryptoKey `bun:"rel:has-many,join:id=owner_id,join:type=owner_type,polymorphic:ces_condition"`

	Series []*ConditionalEndorsementSeriesRecord `bun:"rel:has-many,join:id=triple_id"`

	IsActive bool

	ModuleID int64 `bun:",nullzero"`
}

func ConditionalEndorsementSeriesTriplesFromCoRIM added in v0.3.0

func ConditionalEndorsementSeriesTriplesFromCoRIM(
	origin *comid.CondEndorseSeriesTriples,
) ([]*ConditionalEndorsementSeriesTriple, error)

func NewConditionalEndorsementSeriesTripleFromCoRIM added in v0.3.0

func NewConditionalEndorsementSeriesTripleFromCoRIM(
	origin *comid.CondEndorseSeriesTriple,
) (*ConditionalEndorsementSeriesTriple, error)

func SelectConditionalEndorsementSeriesTriple added in v0.3.0

func SelectConditionalEndorsementSeriesTriple(
	ctx context.Context,
	db bun.IDB,
	id int64,
) (*ConditionalEndorsementSeriesTriple, error)

func (*ConditionalEndorsementSeriesTriple) DbID added in v0.3.0

func (*ConditionalEndorsementSeriesTriple) Delete added in v0.3.0

func (*ConditionalEndorsementSeriesTriple) FromCoRIM added in v0.3.0

func (*ConditionalEndorsementSeriesTriple) Insert added in v0.3.0

func (*ConditionalEndorsementSeriesTriple) IsTable added in v0.3.0

func (*ConditionalEndorsementSeriesTriple) OwnerDbID added in v0.3.0

func (*ConditionalEndorsementSeriesTriple) OwnerName added in v0.3.0

func (*ConditionalEndorsementSeriesTriple) Select added in v0.3.0

func (*ConditionalEndorsementSeriesTriple) TableName added in v0.3.0

func (*ConditionalEndorsementSeriesTriple) ToCoRIM added in v0.3.0

func (*ConditionalEndorsementSeriesTriple) Validate added in v0.3.0

type ConditionalEndorsementSeriesTripleEntry added in v0.3.0

type ConditionalEndorsementSeriesTripleEntry struct {
	bun.BaseModel `bun:"table:conditional_endorsement_series_triple_entries,alias:vte"`

	TripleDbID    int64 `bun:"triple_db_id"`
	ManifestDbID  int64 `bun:"manifest_db_id"`
	ModuleTagDbID int64 `bun:"module_tag_db_id"`
	EnvironmentID int64 `bun:"environment_db_id"`

	IsActive bool

	ManifestIDType TagIDType
	ManifestID     string

	ModuleTagIDType  TagIDType
	ModuleTagID      string
	ModuleTagVersion uint

	Language *string

	Label string `bun:",nullzero"`

	ProfileType ProfileType `bun:",nullzero"`
	Profile     string      `bun:",nullzero"`

	NotBefore *time.Time
	NotAfter  *time.Time
}

func (*ConditionalEndorsementSeriesTripleEntry) DbID added in v0.3.0

func (*ConditionalEndorsementSeriesTripleEntry) IsTable added in v0.3.0

func (*ConditionalEndorsementSeriesTripleEntry) Select added in v0.3.0

func (*ConditionalEndorsementSeriesTripleEntry) TableName added in v0.3.0

func (*ConditionalEndorsementSeriesTripleEntry) ToManifest added in v0.3.0

func (*ConditionalEndorsementSeriesTripleEntry) ToModuleTag added in v0.3.0

func (*ConditionalEndorsementSeriesTripleEntry) ToTriple added in v0.3.0

type ConditionalEndorsementTriple added in v0.3.0

type ConditionalEndorsementTriple struct {
	bun.BaseModel `bun:"table:conditional_endorsement_triples,alias:cet"`

	ID int64 `bun:",pk,autoincrement"`

	Conditions   []*StatefulEnvironment `bun:"rel:has-many,join:id=triple_id"`
	Endorsements []*ValueTriple         `bun:"rel:has-many,join:id=owner_id,join:type=owner_type,polymorphic:conditional_endorsement_triple"`
	IsActive     bool

	ModuleID int64 `bun:",nullzero"`
}

func ConditionalEndorsementTriplesFromCoRIM added in v0.3.0

func ConditionalEndorsementTriplesFromCoRIM(
	origin *comid.CondEndorseTriples,
) ([]*ConditionalEndorsementTriple, error)

func NewConditionalEndorsementTripleFromCoRIM added in v0.3.0

func NewConditionalEndorsementTripleFromCoRIM(
	origin *comid.CondEndorseTriple,
) (*ConditionalEndorsementTriple, error)

func SelectConditionalEndorsementTriple added in v0.3.0

func SelectConditionalEndorsementTriple(
	ctx context.Context,
	db bun.IDB,
	id int64,
) (*ConditionalEndorsementTriple, error)

func (*ConditionalEndorsementTriple) DbID added in v0.3.0

func (*ConditionalEndorsementTriple) Delete added in v0.3.0

func (*ConditionalEndorsementTriple) FromCoRIM added in v0.3.0

func (*ConditionalEndorsementTriple) Insert added in v0.3.0

func (*ConditionalEndorsementTriple) IsTable added in v0.3.0

func (o *ConditionalEndorsementTriple) IsTable() bool

func (*ConditionalEndorsementTriple) OwnerDbID added in v0.3.0

func (o *ConditionalEndorsementTriple) OwnerDbID() int64

func (*ConditionalEndorsementTriple) OwnerName added in v0.3.0

func (o *ConditionalEndorsementTriple) OwnerName() string

func (*ConditionalEndorsementTriple) Select added in v0.3.0

func (*ConditionalEndorsementTriple) TableName added in v0.3.0

func (o *ConditionalEndorsementTriple) TableName() string

func (*ConditionalEndorsementTriple) ToCoRIM added in v0.3.0

func (*ConditionalEndorsementTriple) Validate added in v0.3.0

func (o *ConditionalEndorsementTriple) Validate() error

type ConditionalEndorsementTripleEntry added in v0.3.0

type ConditionalEndorsementTripleEntry struct {
	bun.BaseModel `bun:"table:conditional_endorsement_triple_entries,alias:vte"`

	TripleDbID    int64 `bun:"triple_db_id"`
	ManifestDbID  int64 `bun:"manifest_db_id"`
	ModuleTagDbID int64 `bun:"module_tag_db_id"`

	IsActive bool

	ManifestIDType TagIDType
	ManifestID     string

	ModuleTagIDType  TagIDType
	ModuleTagID      string
	ModuleTagVersion uint

	Language *string

	Label string `bun:",nullzero"`

	ProfileType ProfileType `bun:",nullzero"`
	Profile     string      `bun:",nullzero"`

	NotBefore *time.Time
	NotAfter  *time.Time
}

func (*ConditionalEndorsementTripleEntry) DbID added in v0.3.0

func (*ConditionalEndorsementTripleEntry) IsTable added in v0.3.0

func (*ConditionalEndorsementTripleEntry) Select added in v0.3.0

func (*ConditionalEndorsementTripleEntry) TableName added in v0.3.0

func (*ConditionalEndorsementTripleEntry) ToManifest added in v0.3.0

func (*ConditionalEndorsementTripleEntry) ToModuleTag added in v0.3.0

func (*ConditionalEndorsementTripleEntry) ToTriple added in v0.3.0

type CryptoKey

type CryptoKey struct {
	bun.BaseModel `bun:"table:cryptokeys,alias:ck"`

	ID int64 `bun:",pk,autoincrement"`

	KeyType  string
	KeyBytes []byte

	OwnerID   int64  `bun:",nullzero"`
	OwnerType string `bun:",nullzero"`
}

func CryptoKeysFromCoRIM

func CryptoKeysFromCoRIM(origin *comid.CryptoKeys) ([]*CryptoKey, error)

func NewCryptoKeyFromCoRIM

func NewCryptoKeyFromCoRIM(origin *comid.CryptoKey) (*CryptoKey, error)

func SelectCryptoKey

func SelectCryptoKey(ctx context.Context, db bun.IDB, id int64) (*CryptoKey, error)

func (*CryptoKey) DbID

func (o *CryptoKey) DbID() int64

func (*CryptoKey) Delete

func (o *CryptoKey) Delete(ctx context.Context, db bun.IDB) error

func (*CryptoKey) FromCoRIM

func (o *CryptoKey) FromCoRIM(origin *comid.CryptoKey) error

func (*CryptoKey) Insert

func (o *CryptoKey) Insert(ctx context.Context, db bun.IDB) error

func (*CryptoKey) IsTable

func (o *CryptoKey) IsTable() bool

func (*CryptoKey) OwnerDbID added in v0.3.0

func (o *CryptoKey) OwnerDbID() int64

func (*CryptoKey) OwnerName added in v0.3.0

func (o *CryptoKey) OwnerName() string

func (*CryptoKey) Select

func (o *CryptoKey) Select(ctx context.Context, db bun.IDB) error

func (*CryptoKey) TableName

func (o *CryptoKey) TableName() string

func (*CryptoKey) ToCoRIM

func (o *CryptoKey) ToCoRIM() (*comid.CryptoKey, error)

type Digest

type Digest struct {
	bun.BaseModel `bun:"table:digests,alias:dgt"`

	ID int64 `bun:",pk,autoincrement"`

	AlgIDInt  int64  `bun:"alg_id_int"`
	AlgIDText string `bun:"alg_id_text"`
	Value     []byte `bun:"value"`

	OwnerID   int64  `bun:",nullzero"`
	OwnerType string `bun:",nullzero"`
}

func DigestsFromCoRIM

func DigestsFromCoRIM(origin *comid.Digests) ([]*Digest, error)

func NewDigestInt added in v0.3.0

func NewDigestInt(alg_id int64, val []byte) *Digest

func NewDigestText added in v0.3.0

func NewDigestText(alg_id string, val []byte) *Digest

func (*Digest) AlgID

func (o *Digest) AlgID() any

func (*Digest) AlgIDString added in v0.3.0

func (o *Digest) AlgIDString() string

func (*Digest) DbID

func (o *Digest) DbID() int64

func (*Digest) Delete

func (o *Digest) Delete(ctx context.Context, db bun.IDB) error

func (*Digest) Insert

func (o *Digest) Insert(ctx context.Context, db bun.IDB) error

func (*Digest) IsTable

func (o *Digest) IsTable() bool

func (*Digest) OwnerDbID added in v0.3.0

func (o *Digest) OwnerDbID() int64

func (*Digest) OwnerName added in v0.3.0

func (o *Digest) OwnerName() string

func (*Digest) Select

func (o *Digest) Select(ctx context.Context, db bun.IDB) error

func (*Digest) TableName

func (o *Digest) TableName() string

type DomainDependencyTriple added in v0.3.0

type DomainDependencyTriple struct {
	bun.BaseModel `bun:"table:domain_dependency_triples,alias:ddt"`

	ID int64 `bun:",pk,autoincrement"`

	EnvironmentID int64        `bun:",nullzero"`
	DomainID      *Environment `bun:"rel:belongs-to,join:environment_id=id"`

	Trustees []*DomainEntry `bun:"rel:has-many,join:id=owner_id,join:type=owner_type,polymorphic:domain_dependency_triple"`

	IsActive bool

	ModuleID int64 `bun:",nullzero"`
}

func DomainDependencyTriplesFromCoRIM added in v0.3.0

func DomainDependencyTriplesFromCoRIM(origin *comid.DomainDependencyTriples) ([]*DomainDependencyTriple, error)

func NewDomainDependencyTripleFromCoRIM added in v0.3.0

func NewDomainDependencyTripleFromCoRIM(origin *comid.DomainDependencyTriple) (*DomainDependencyTriple, error)

func SelectDomainDependencyTriple added in v0.3.0

func SelectDomainDependencyTriple(ctx context.Context, db bun.IDB, id int64) (*DomainDependencyTriple, error)

func (*DomainDependencyTriple) DbID added in v0.3.0

func (o *DomainDependencyTriple) DbID() int64

func (*DomainDependencyTriple) Delete added in v0.3.0

func (o *DomainDependencyTriple) Delete(ctx context.Context, db bun.IDB) error

func (*DomainDependencyTriple) FromCoRIM added in v0.3.0

func (*DomainDependencyTriple) Insert added in v0.3.0

func (o *DomainDependencyTriple) Insert(ctx context.Context, db bun.IDB) error

func (*DomainDependencyTriple) IsTable added in v0.3.0

func (o *DomainDependencyTriple) IsTable() bool

func (*DomainDependencyTriple) OwnerDbID added in v0.3.0

func (o *DomainDependencyTriple) OwnerDbID() int64

func (DomainDependencyTriple) OwnerName added in v0.3.0

func (o DomainDependencyTriple) OwnerName() string

func (*DomainDependencyTriple) Select added in v0.3.0

func (o *DomainDependencyTriple) Select(ctx context.Context, db bun.IDB) error

func (*DomainDependencyTriple) TableName added in v0.3.0

func (o *DomainDependencyTriple) TableName() string

func (*DomainDependencyTriple) ToCoRIM added in v0.3.0

func (*DomainDependencyTriple) Validate added in v0.3.0

func (o *DomainDependencyTriple) Validate() error

type DomainDependencyTripleEntry added in v0.3.0

type DomainDependencyTripleEntry struct {
	bun.BaseModel `bun:"table:domain_dependency_triple_entries,alias:ddte"`

	TripleDbID    int64 `bun:"triple_db_id"`
	ManifestDbID  int64 `bun:"manifest_db_id"`
	ModuleTagDbID int64 `bun:"module_tag_db_id"`
	EnvironmentID int64 `bun:"environment_db_id"`

	IsActive bool

	ManifestIDType TagIDType
	ManifestID     string

	ModuleTagIDType  TagIDType
	ModuleTagID      string
	ModuleTagVersion uint

	Language *string

	Label string `bun:",nullzero"`

	ProfileType ProfileType `bun:",nullzero"`
	Profile     string      `bun:",nullzero"`

	NotBefore *time.Time
	NotAfter  *time.Time
}

func (*DomainDependencyTripleEntry) DbID added in v0.3.0

func (*DomainDependencyTripleEntry) IsTable added in v0.3.0

func (o *DomainDependencyTripleEntry) IsTable() bool

func (*DomainDependencyTripleEntry) Select added in v0.3.0

func (*DomainDependencyTripleEntry) TableName added in v0.3.0

func (o *DomainDependencyTripleEntry) TableName() string

func (*DomainDependencyTripleEntry) ToManifest added in v0.3.0

func (o *DomainDependencyTripleEntry) ToManifest(ctx context.Context, db bun.IDB) (*Manifest, error)

func (*DomainDependencyTripleEntry) ToModuleTag added in v0.3.0

func (o *DomainDependencyTripleEntry) ToModuleTag(ctx context.Context, db bun.IDB) (*ModuleTag, error)

func (*DomainDependencyTripleEntry) ToTriple added in v0.3.0

type DomainEntry added in v0.3.0

type DomainEntry struct {
	bun.BaseModel `bun:"table:domain_entries,alias:de"`

	ID int64 `bun:",pk,autoincrement"`

	EnvironmentID int64        `bun:",nullzero"`
	Environment   *Environment `bun:"rel:belongs-to,join:environment_id=id"`

	OwnerID   int64  `bun:",nullzero"`
	OwnerType string `bun:",nullzero"`
}

func DomainEntriesFromCoRIM added in v0.3.0

func DomainEntriesFromCoRIM(origin []comid.Environment) ([]*DomainEntry, error)

func (*DomainEntry) DbID added in v0.3.0

func (o *DomainEntry) DbID() int64

func (*DomainEntry) Delete added in v0.3.0

func (o *DomainEntry) Delete(ctx context.Context, db bun.IDB) error

func (*DomainEntry) Insert added in v0.3.0

func (o *DomainEntry) Insert(ctx context.Context, db bun.IDB) error

func (*DomainEntry) IsTable added in v0.3.0

func (o *DomainEntry) IsTable() bool

func (*DomainEntry) OwnerDbID added in v0.3.0

func (o *DomainEntry) OwnerDbID() int64

func (DomainEntry) OwnerName added in v0.3.0

func (o DomainEntry) OwnerName() string

func (*DomainEntry) Select added in v0.3.0

func (o *DomainEntry) Select(ctx context.Context, db bun.IDB) error

func (*DomainEntry) TableName added in v0.3.0

func (o *DomainEntry) TableName() string

func (*DomainEntry) Validate added in v0.3.0

func (o *DomainEntry) Validate() error

type DomainMembershipTriple added in v0.3.0

type DomainMembershipTriple struct {
	bun.BaseModel `bun:"table:domain_membership_triples,alias:dmt"`

	ID int64 `bun:",pk,autoincrement"`

	EnvironmentID int64        `bun:",nullzero"`
	DomainID      *Environment `bun:"rel:belongs-to,join:environment_id=id"`

	Members []*DomainEntry `bun:"rel:has-many,join:id=owner_id,join:type=owner_type,polymorphic:domain_membership_triple"`

	IsActive bool

	ModuleID int64 `bun:",nullzero"`
}

func DomainMembershipTriplesFromCoRIM added in v0.3.0

func DomainMembershipTriplesFromCoRIM(origin *comid.DomainMembershipTriples) ([]*DomainMembershipTriple, error)

func NewDomainMembershipTripleFromCoRIM added in v0.3.0

func NewDomainMembershipTripleFromCoRIM(origin *comid.DomainMembershipTriple) (*DomainMembershipTriple, error)

func SelectDomainMembershipTriple added in v0.3.0

func SelectDomainMembershipTriple(ctx context.Context, db bun.IDB, id int64) (*DomainMembershipTriple, error)

func (*DomainMembershipTriple) DbID added in v0.3.0

func (o *DomainMembershipTriple) DbID() int64

func (*DomainMembershipTriple) Delete added in v0.3.0

func (o *DomainMembershipTriple) Delete(ctx context.Context, db bun.IDB) error

func (*DomainMembershipTriple) FromCoRIM added in v0.3.0

func (*DomainMembershipTriple) Insert added in v0.3.0

func (o *DomainMembershipTriple) Insert(ctx context.Context, db bun.IDB) error

func (*DomainMembershipTriple) IsTable added in v0.3.0

func (o *DomainMembershipTriple) IsTable() bool

func (*DomainMembershipTriple) OwnerDbID added in v0.3.0

func (o *DomainMembershipTriple) OwnerDbID() int64

func (DomainMembershipTriple) OwnerName added in v0.3.0

func (o DomainMembershipTriple) OwnerName() string

func (*DomainMembershipTriple) Select added in v0.3.0

func (o *DomainMembershipTriple) Select(ctx context.Context, db bun.IDB) error

func (*DomainMembershipTriple) TableName added in v0.3.0

func (o *DomainMembershipTriple) TableName() string

func (*DomainMembershipTriple) ToCoRIM added in v0.3.0

func (*DomainMembershipTriple) Validate added in v0.3.0

func (o *DomainMembershipTriple) Validate() error

type DomainMembershipTripleEntry added in v0.3.0

type DomainMembershipTripleEntry struct {
	bun.BaseModel `bun:"table:domain_membership_triple_entries,alias:dmte"`

	TripleDbID    int64 `bun:"triple_db_id"`
	ManifestDbID  int64 `bun:"manifest_db_id"`
	ModuleTagDbID int64 `bun:"module_tag_db_id"`
	EnvironmentID int64 `bun:"environment_db_id"`

	IsActive bool

	ManifestIDType TagIDType
	ManifestID     string

	ModuleTagIDType  TagIDType
	ModuleTagID      string
	ModuleTagVersion uint

	Language *string

	Label string `bun:",nullzero"`

	ProfileType ProfileType `bun:",nullzero"`
	Profile     string      `bun:",nullzero"`

	NotBefore *time.Time
	NotAfter  *time.Time
}

func (*DomainMembershipTripleEntry) DbID added in v0.3.0

func (*DomainMembershipTripleEntry) IsTable added in v0.3.0

func (o *DomainMembershipTripleEntry) IsTable() bool

func (*DomainMembershipTripleEntry) Select added in v0.3.0

func (*DomainMembershipTripleEntry) TableName added in v0.3.0

func (o *DomainMembershipTripleEntry) TableName() string

func (*DomainMembershipTripleEntry) ToManifest added in v0.3.0

func (o *DomainMembershipTripleEntry) ToManifest(ctx context.Context, db bun.IDB) (*Manifest, error)

func (*DomainMembershipTripleEntry) ToModuleTag added in v0.3.0

func (o *DomainMembershipTripleEntry) ToModuleTag(ctx context.Context, db bun.IDB) (*ModuleTag, error)

func (*DomainMembershipTripleEntry) ToTriple added in v0.3.0

type Entity

type Entity struct {
	bun.BaseModel `bun:"table:entities,alias:ent"`

	ID int64 `bun:",pk,autoincrement"`

	NameType string
	Name     string
	URI      string `bun:",nullzero"`

	RoleEntries []RoleEntry `bun:"rel:has-many,join:id=entity_id"`

	OwnerID   int64  `bun:",nullzero"`
	OwnerType string `bun:",nullzero"`

	Extensions []*ExtensionValue `bun:"rel:has-many,join:id=owner_id,join:type=owner_type,polymorphic"`
}

func CoMIDEntitiesFromCoRIM

func CoMIDEntitiesFromCoRIM(origin *comid.Entities) ([]*Entity, error)

func CoRIMEntitiesFromCoRIM

func CoRIMEntitiesFromCoRIM(origin *corim.Entities) ([]*Entity, error)

func NewCoMIDEntityFromCoRIM

func NewCoMIDEntityFromCoRIM(origin *comid.Entity) (*Entity, error)

func NewCoRIMEntityFromCoRIM

func NewCoRIMEntityFromCoRIM(origin *corim.Entity) (*Entity, error)

func (*Entity) DbID

func (o *Entity) DbID() int64

func (*Entity) Delete

func (o *Entity) Delete(ctx context.Context, db bun.IDB) error

func (*Entity) FromCoMIDCoRIM

func (o *Entity) FromCoMIDCoRIM(origin *comid.Entity) error

func (*Entity) FromCoRIMCoRIM

func (o *Entity) FromCoRIMCoRIM(origin *corim.Entity) error

func (*Entity) Insert

func (o *Entity) Insert(ctx context.Context, db bun.IDB) error

func (*Entity) IsTable

func (o *Entity) IsTable() bool

func (*Entity) OwnerDbID added in v0.3.0

func (o *Entity) OwnerDbID() int64

func (*Entity) OwnerName added in v0.3.0

func (o *Entity) OwnerName() string

func (*Entity) Roles

func (o *Entity) Roles() []string

func (*Entity) Select

func (o *Entity) Select(ctx context.Context, db bun.IDB) error

func (*Entity) TableName

func (o *Entity) TableName() string

func (*Entity) ToCoMIDCoRIM

func (o *Entity) ToCoMIDCoRIM() (*comid.Entity, error)

func (*Entity) ToCoRIMCoRIM

func (o *Entity) ToCoRIMCoRIM() (*corim.Entity, error)

func (*Entity) Validate

func (o *Entity) Validate() error

type Environment

type Environment struct {
	bun.BaseModel `bun:"table:environments,alias:env"`

	ID int64 `bun:",pk,autoincrement"`

	ClassType  *string
	ClassBytes *[]byte
	Vendor     *string
	Model      *string
	Layer      *uint64
	Index      *uint64

	InstanceType  *string
	InstanceBytes *[]byte

	GroupType  *string
	GroupBytes *[]byte
}

func NewEnvironmentFromCoRIM

func NewEnvironmentFromCoRIM(origin *comid.Environment) (*Environment, error)

func SelectEnvironment

func SelectEnvironment(ctx context.Context, db bun.IDB, id int64) (*Environment, error)

func (*Environment) DbID

func (o *Environment) DbID() int64

func (*Environment) DeleteIfOrphaned

func (o *Environment) DeleteIfOrphaned(ctx context.Context, db bun.IDB) error

func (*Environment) FromCoRIM

func (o *Environment) FromCoRIM(origin *comid.Environment) error

func (*Environment) Insert

func (o *Environment) Insert(ctx context.Context, db bun.IDB) error

func (*Environment) IsEmpty

func (o *Environment) IsEmpty() bool

func (*Environment) IsTable

func (o *Environment) IsTable() bool

func (Environment) RenderParts

func (o Environment) RenderParts() ([][2]string, error)

func (*Environment) Select

func (o *Environment) Select(ctx context.Context, db bun.IDB) error

func (*Environment) TableName

func (o *Environment) TableName() string

func (Environment) ToCoRIM

func (o Environment) ToCoRIM() (*comid.Environment, error)

func (*Environment) Validate

func (o *Environment) Validate() error

type ExtensionValue

type ExtensionValue struct {
	bun.BaseModel `bun:"table:extensions,alias:ext"`

	ID int64 `bun:",pk,autoincrement"`

	FieldKind reflect.Kind
	FieldName string
	JSONTag   string
	CBORTag   string

	ValueBytes []byte
	ValueText  string
	ValueInt   int64
	ValueFloat float64

	OwnerID   int64  `bun:",nullzero"`
	OwnerType string `bun:",nullzero"`
}

func CoMIDExtensionsFromCoRIM

func CoMIDExtensionsFromCoRIM(origin comid.Extensions) ([]*ExtensionValue, error)

func CoRIMExtensionsFromCoRIM

func CoRIMExtensionsFromCoRIM(origin corim.Extensions) ([]*ExtensionValue, error)

func (*ExtensionValue) DbID

func (o *ExtensionValue) DbID() int64

func (*ExtensionValue) Delete

func (o *ExtensionValue) Delete(ctx context.Context, db bun.IDB) error

func (*ExtensionValue) Insert

func (o *ExtensionValue) Insert(ctx context.Context, db bun.IDB) error

func (*ExtensionValue) IsTable

func (o *ExtensionValue) IsTable() bool

func (*ExtensionValue) OwnerDbID added in v0.3.0

func (o *ExtensionValue) OwnerDbID() int64

func (*ExtensionValue) OwnerName added in v0.3.0

func (o *ExtensionValue) OwnerName() string

func (*ExtensionValue) Select

func (o *ExtensionValue) Select(ctx context.Context, db bun.IDB) error

func (*ExtensionValue) TableName

func (o *ExtensionValue) TableName() string

type Flag

type Flag struct {
	bun.BaseModel `bun:"table:flags,alias:flg"`

	ID int64 `bun:",pk,autoincrement"`

	CodePoint int64
	Value     bool

	MeasurementID int64 `bun:",nullzero"`
}

func FlagsFromCoRIM

func FlagsFromCoRIM(origin *comid.FlagsMap) ([]*Flag, error)

func NewFlag

func NewFlag(cp int64, val bool) *Flag

func (*Flag) DbID

func (o *Flag) DbID() int64

func (*Flag) Delete

func (o *Flag) Delete(ctx context.Context, db bun.IDB) error

func (*Flag) Insert

func (o *Flag) Insert(ctx context.Context, db bun.IDB) error

func (*Flag) IsTable

func (o *Flag) IsTable() bool

func (*Flag) OwnerDbID added in v0.3.0

func (o *Flag) OwnerDbID() int64

func (*Flag) OwnerName added in v0.3.0

func (o *Flag) OwnerName() string

func (*Flag) Select

func (o *Flag) Select(ctx context.Context, db bun.IDB) error

func (*Flag) TableName

func (o *Flag) TableName() string

type Href added in v0.3.0

type Href struct {
	bun.BaseModel `bun:"table:hrefs,alias:href"`

	ID int64 `bun:",pk,autoincrement"`

	Value string `bun:"value"`

	LocatorID int64 `bun:"locator_id"`
}

func HrefsFromCoRIM added in v0.3.0

func HrefsFromCoRIM(origin corim.OneOrMore[comid.TaggedURI]) []*Href

func (*Href) DbID added in v0.3.0

func (o *Href) DbID() int64

func (*Href) Delete added in v0.3.0

func (o *Href) Delete(ctx context.Context, db bun.IDB) error

func (*Href) Insert added in v0.3.0

func (o *Href) Insert(ctx context.Context, db bun.IDB) error

func (*Href) IsTable added in v0.3.0

func (o *Href) IsTable() bool

func (*Href) OwnerDbID added in v0.3.0

func (o *Href) OwnerDbID() int64

func (*Href) OwnerName added in v0.3.0

func (o *Href) OwnerName() string

func (*Href) Select added in v0.3.0

func (o *Href) Select(ctx context.Context, db bun.IDB) error

func (*Href) TableName added in v0.3.0

func (o *Href) TableName() string

type IntegrityRegister

type IntegrityRegister struct {
	bun.BaseModel `bun:"table:integrity_registers,alias:int"`

	ID int64 `bun:",pk,autoincrement"`

	IndexUint *uint64
	IndexText *string

	Digests []*Digest `bun:"rel:has-many,join:id=owner_id,join:type=owner_type,polymorphic"`

	MeasurementID int64 `bun:",nullzero"`
}

func IntegerityRegistersFromCoRIM

func IntegerityRegistersFromCoRIM(origin *comid.IntegrityRegisters) ([]*IntegrityRegister, error)

func (*IntegrityRegister) DbID

func (o *IntegrityRegister) DbID() int64

func (*IntegrityRegister) Delete

func (o *IntegrityRegister) Delete(ctx context.Context, db bun.IDB) error

func (*IntegrityRegister) Insert

func (o *IntegrityRegister) Insert(ctx context.Context, db bun.IDB) error

func (*IntegrityRegister) IsTable

func (o *IntegrityRegister) IsTable() bool

func (*IntegrityRegister) OwnerDbID added in v0.3.0

func (o *IntegrityRegister) OwnerDbID() int64

func (*IntegrityRegister) OwnerName added in v0.3.0

func (o *IntegrityRegister) OwnerName() string

func (*IntegrityRegister) Select

func (o *IntegrityRegister) Select(ctx context.Context, db bun.IDB) error

func (*IntegrityRegister) StringIndex

func (o *IntegrityRegister) StringIndex() string

StringIndex return the index of this IntegrityRegister as a string. If IndexText is set, it returns the value it points at, If IndexUint is set, the value it points to formatted as a string is returned. Otherwise, the string "nil" is returned.

func (*IntegrityRegister) TableName

func (o *IntegrityRegister) TableName() string

type KeyTriple

type KeyTriple struct {
	bun.BaseModel `bun:"table:key_triples,alias:kt"`

	ID int64 `bun:",pk,autoincrement"`

	EnvironmentID int64
	Environment   *Environment `bun:"rel:belongs-to,join:environment_id=id"`

	Type    KeyTripleType
	KeyList []*CryptoKey `bun:"rel:has-many,join:id=owner_id,join:type=owner_type,polymorphic:key_triple"`

	ConditionKeyType  *string `bun:"cond_key_type"`
	ConditionKeyBytes *[]byte `bun:"cond_key_bytes"`

	AuthorizedBy []*CryptoKey `bun:"rel:has-many,join:id=owner_id,join:type=owner_type,polymorphic:key_triple_auth"`

	IsActive bool

	ModuleID int64 `bun:",nullzero"`
}

func KeyTriplesFromCoRIM

func KeyTriplesFromCoRIM(origin *comid.KeyTriples, typ KeyTripleType) ([]*KeyTriple, error)

func NewKeyTripleFromCoRIM

func NewKeyTripleFromCoRIM(origin *comid.KeyTriple) (*KeyTriple, error)

func SelectKeyTriple

func SelectKeyTriple(ctx context.Context, db bun.IDB, id int64) (*KeyTriple, error)

func (*KeyTriple) DatabaseID

func (o *KeyTriple) DatabaseID() int64

func (*KeyTriple) DbID

func (o *KeyTriple) DbID() int64

func (*KeyTriple) Delete

func (o *KeyTriple) Delete(ctx context.Context, db bun.IDB) error

func (*KeyTriple) FromCoRIM

func (o *KeyTriple) FromCoRIM(origin *comid.KeyTriple) error

func (*KeyTriple) Insert

func (o *KeyTriple) Insert(ctx context.Context, db bun.IDB) error

func (*KeyTriple) IsTable

func (o *KeyTriple) IsTable() bool

func (*KeyTriple) OwnerDbID added in v0.3.0

func (o *KeyTriple) OwnerDbID() int64

func (*KeyTriple) OwnerName added in v0.3.0

func (o *KeyTriple) OwnerName() string

func (*KeyTriple) Select

func (o *KeyTriple) Select(ctx context.Context, db bun.IDB) error

func (*KeyTriple) TableName

func (o *KeyTriple) TableName() string

func (*KeyTriple) ToCoRIM

func (o *KeyTriple) ToCoRIM() (*comid.KeyTriple, error)

func (*KeyTriple) TripleType

func (o *KeyTriple) TripleType() string

func (*KeyTriple) Validate

func (o *KeyTriple) Validate() error

type KeyTripleEntry

type KeyTripleEntry struct {
	bun.BaseModel `bun:"table:key_triple_entries,alias:kte"`

	TripleDbID    int64 `bun:"triple_db_id"`
	ManifestDbID  int64 `bun:"manifest_db_id"`
	ModuleTagDbID int64 `bun:"module_tag_db_id"`
	EnvironmentID int64 `bun:"environment_db_id"`

	TripleType KeyTripleType

	ConditionKeyType  *string `bun:"cond_key_type"`
	ConditionKeyBytes *[]byte `bun:"cond_key_bytes"`

	IsActive bool

	ManifestIDType TagIDType
	ManifestID     string

	ModuleTagIDType  TagIDType
	ModuleTagID      string
	ModuleTagVersion uint

	Language *string

	Label string `bun:",nullzero"`

	ProfileType ProfileType `bun:",nullzero"`
	Profile     string      `bun:",nullzero"`

	NotBefore *time.Time
	NotAfter  *time.Time
}

func (*KeyTripleEntry) DbID

func (o *KeyTripleEntry) DbID() int64

func (*KeyTripleEntry) IsTable

func (o *KeyTripleEntry) IsTable() bool

func (*KeyTripleEntry) Select

func (o *KeyTripleEntry) Select(ctx context.Context, db bun.IDB) error

func (*KeyTripleEntry) TableName

func (o *KeyTripleEntry) TableName() string

func (*KeyTripleEntry) ToManifest

func (o *KeyTripleEntry) ToManifest(ctx context.Context, db bun.IDB) (*Manifest, error)

func (*KeyTripleEntry) ToModuleTag

func (o *KeyTripleEntry) ToModuleTag(ctx context.Context, db bun.IDB) (*ModuleTag, error)

func (*KeyTripleEntry) ToTriple

func (o *KeyTripleEntry) ToTriple(ctx context.Context, db bun.IDB) (*KeyTriple, error)

type KeyTripleType

type KeyTripleType string
const (
	AttestKeyTriple   KeyTripleType = "attest"
	IdentityKeyTriple KeyTripleType = "identity"
)

type LinkedTag

type LinkedTag struct {
	bun.BaseModel `bun:"table:linked_tags,alias:lnk"`

	ID int64 `bun:",pk,autoincrement"`

	LinkedTagIDType TagIDType
	LinkedTagID     string
	TagRelation     TagRelation

	ModuleID int64 `bun:",nullzero"`
}

func LinkedTagsFromCoRIM

func LinkedTagsFromCoRIM(origin *comid.LinkedTags) ([]*LinkedTag, error)

func NewLinkedTagFromCoRIM

func NewLinkedTagFromCoRIM(origin *comid.LinkedTag) (*LinkedTag, error)

func SelectLinkedTag

func SelectLinkedTag(ctx context.Context, db bun.IDB, id int64) (*LinkedTag, error)

func (*LinkedTag) DbID

func (o *LinkedTag) DbID() int64

func (*LinkedTag) Delete

func (o *LinkedTag) Delete(ctx context.Context, db bun.IDB) error

func (*LinkedTag) FromCoRIM

func (o *LinkedTag) FromCoRIM(origin *comid.LinkedTag) error

func (*LinkedTag) Insert

func (o *LinkedTag) Insert(ctx context.Context, db bun.IDB) error

func (*LinkedTag) IsTable

func (o *LinkedTag) IsTable() bool

func (*LinkedTag) OwnerDbID added in v0.3.0

func (o *LinkedTag) OwnerDbID() int64

func (*LinkedTag) OwnerName added in v0.3.0

func (o *LinkedTag) OwnerName() string

func (*LinkedTag) Select

func (o *LinkedTag) Select(ctx context.Context, db bun.IDB) error

func (*LinkedTag) TableName

func (o *LinkedTag) TableName() string

func (*LinkedTag) ToCoRIM

func (o *LinkedTag) ToCoRIM() (*comid.LinkedTag, error)

type Locator

type Locator struct {
	bun.BaseModel `bun:"table:locators,alias:loc"`

	ID int64 `bun:",pk,autoincrement"`

	Href       []*Href   `bun:"rel:has-many,join:id=locator_id"`
	Thumbprint []*Digest `bun:"rel:has-many,join:id=owner_id,join:type=owner_type,polymorphic:locator"`

	ManifestID int64
}

func LocatorsFromCoRIM

func LocatorsFromCoRIM(origin *[]corim.Locator) ([]*Locator, error)

func NewLocatorFromCoRIM

func NewLocatorFromCoRIM(origin corim.Locator) (*Locator, error)

func (*Locator) DbID

func (o *Locator) DbID() int64

func (*Locator) Delete

func (o *Locator) Delete(ctx context.Context, db bun.IDB) error

func (*Locator) FromCoRIM

func (o *Locator) FromCoRIM(origin corim.Locator) error

func (*Locator) Insert

func (o *Locator) Insert(ctx context.Context, db bun.IDB) error

func (*Locator) IsTable

func (o *Locator) IsTable() bool

func (*Locator) OwnerDbID added in v0.3.0

func (o *Locator) OwnerDbID() int64

func (*Locator) OwnerName added in v0.3.0

func (o *Locator) OwnerName() string

func (*Locator) Select

func (o *Locator) Select(ctx context.Context, db bun.IDB) error

func (*Locator) TableName

func (o *Locator) TableName() string

func (*Locator) ToCoRIM

func (o *Locator) ToCoRIM() (corim.Locator, error)

type Manifest

type Manifest struct {
	bun.BaseModel `bun:"table:manifests,alias:man"`

	ID int64 `bun:",pk,autoincrement"`

	ManifestIDType TagIDType
	ManifestID     string

	Digest    []byte
	TimeAdded time.Time
	Label     string `bun:",nullzero"`

	ProfileType ProfileType `bun:",nullzero"`
	Profile     string      `bun:",nullzero"`

	Entities      []*Entity  `bun:"rel:has-many,join:id=owner_id,join:type=owner_type,polymorphic:manifest"`
	DependentRIMs []*Locator `bun:"rel:has-many,join:id=manifest_id"`

	NotBefore *time.Time
	NotAfter  *time.Time

	ModuleTags []*ModuleTag `bun:"rel:has-many,join:id=manifest_id"`

	Extensions []*ExtensionValue `bun:"rel:has-many,join:id=owner_id,join:type=owner_type,polymorphic:module_tag"`
}

func NewManifestFromCoRIM

func NewManifestFromCoRIM(origin *corim.UnsignedCorim) (*Manifest, error)

func SelectManifest

func SelectManifest(ctx context.Context, db bun.IDB, id int64) (*Manifest, error)

func (*Manifest) DbID

func (o *Manifest) DbID() int64

func (*Manifest) Delete

func (o *Manifest) Delete(ctx context.Context, db bun.IDB) error

func (*Manifest) FromCoRIM

func (o *Manifest) FromCoRIM(origin *corim.UnsignedCorim) error

func (*Manifest) Insert

func (o *Manifest) Insert(ctx context.Context, db bun.IDB) error

func (*Manifest) IsTable

func (o *Manifest) IsTable() bool

func (*Manifest) Select

func (o *Manifest) Select(ctx context.Context, db bun.IDB) error

func (*Manifest) SetActive

func (o *Manifest) SetActive(value bool)

func (*Manifest) TableName

func (o *Manifest) TableName() string

func (*Manifest) ToCoRIM

func (o *Manifest) ToCoRIM() (*corim.UnsignedCorim, error)

func (*Manifest) Validate

func (o *Manifest) Validate() error

type ManifestEntry

type ManifestEntry struct {
	bun.BaseModel `bun:"table:manifest_entries,alias:mte"`

	ManifestDbID int64 `bun:"manifest_db_id"`

	ManifestIDType TagIDType
	ManifestID     string

	Label string `bun:",nullzero"`

	ProfileType ProfileType `bun:",nullzero"`
	Profile     string      `bun:",nullzero"`

	NotBefore *time.Time
	NotAfter  *time.Time
}

func (*ManifestEntry) DbID

func (o *ManifestEntry) DbID() int64

func (*ManifestEntry) IsTable

func (o *ManifestEntry) IsTable() bool

func (*ManifestEntry) Select

func (o *ManifestEntry) Select(ctx context.Context, db bun.IDB) error

func (*ManifestEntry) TableName

func (o *ManifestEntry) TableName() string

func (*ManifestEntry) ToManifest

func (o *ManifestEntry) ToManifest(ctx context.Context, db bun.IDB) (*Manifest, error)

type ManifestIDType

type ManifestIDType string

type Measurement

type Measurement struct {
	bun.BaseModel `bun:"table:measurements,alias:mea"`

	ID int64 `bun:",pk,autoincrement"`

	KeyType  *string
	KeyBytes *[]byte

	ValueEntries       []*MeasurementValueEntry `bun:"rel:has-many,join:id=measurement_id"`
	Digests            []*Digest                `bun:"rel:has-many,join:id=owner_id,join:type=owner_type,polymorphic:measurement"`
	Flags              []*Flag                  `bun:"rel:has-many,join:id=measurement_id"`
	IntegrityRegisters []*IntegrityRegister     `bun:"rel:has-many,join:id=measurement_id"`
	Extensions         []*ExtensionValue        `bun:"rel:has-many,join:id=owner_id,join:type=owner_type,polymorphic:measurement"`

	CryptoKeys   []*CryptoKey `bun:"rel:has-many,join:id=owner_id,join:type=owner_type,polymorphic:measurement"`
	AuthorizedBy []*CryptoKey `bun:"rel:has-many,join:id=owner_id,join:type=owner_type,polymorphic:measurement_auth"`
	OwnerID      int64        `bun:",nullzero"`
	OwnerType    string       `bun:",nullzero"`
}

func MeasurementsFromCoRIM

func MeasurementsFromCoRIM(origin comid.Measurements) ([]*Measurement, error)

func NewMeasurementFromCoRIM

func NewMeasurementFromCoRIM(origin *comid.Measurement) (*Measurement, error)

func SelectMeasurement

func SelectMeasurement(ctx context.Context, db bun.IDB, id int64) (*Measurement, error)

func (*Measurement) DbID

func (o *Measurement) DbID() int64

func (*Measurement) Delete

func (o *Measurement) Delete(ctx context.Context, db bun.IDB) error

func (*Measurement) FromCoRIM

func (o *Measurement) FromCoRIM(origin *comid.Measurement) error

func (*Measurement) Insert

func (o *Measurement) Insert(ctx context.Context, db bun.IDB) error

func (*Measurement) IsTable

func (o *Measurement) IsTable() bool

func (*Measurement) OwnerDbID added in v0.3.0

func (o *Measurement) OwnerDbID() int64

func (*Measurement) OwnerName added in v0.3.0

func (o *Measurement) OwnerName() string

func (*Measurement) Select

func (o *Measurement) Select(ctx context.Context, db bun.IDB) error

func (*Measurement) TableName

func (o *Measurement) TableName() string

func (*Measurement) ToCoRIM

func (o *Measurement) ToCoRIM() (*comid.Measurement, error)

type MeasurementValueEntry

type MeasurementValueEntry struct {
	bun.BaseModel `bun:"table:measurement_value_entries,alias:mve"`

	ID int64 `bun:",pk,autoincrement"`

	CodePoint  int64
	ValueType  string
	ValueBytes *[]byte
	ValueText  *string
	ValueInt   *int64

	MeasurementID int64
}

func (*MeasurementValueEntry) DbID

func (o *MeasurementValueEntry) DbID() int64

func (*MeasurementValueEntry) Delete

func (o *MeasurementValueEntry) Delete(ctx context.Context, db bun.IDB) error

func (*MeasurementValueEntry) Insert

func (o *MeasurementValueEntry) Insert(ctx context.Context, db bun.IDB) error

func (*MeasurementValueEntry) IsTable

func (o *MeasurementValueEntry) IsTable() bool

func (*MeasurementValueEntry) OwnerDbID added in v0.3.0

func (o *MeasurementValueEntry) OwnerDbID() int64

func (*MeasurementValueEntry) OwnerName added in v0.3.0

func (o *MeasurementValueEntry) OwnerName() string

func (*MeasurementValueEntry) Select

func (o *MeasurementValueEntry) Select(ctx context.Context, db bun.IDB) error

func (*MeasurementValueEntry) TableName

func (o *MeasurementValueEntry) TableName() string

type Model

type Model interface {
	// DbID is the database ID of this Model; it is guaranteed to be unique
	// among all models of its type. For table models, this correponds to
	// the value of the primary key "id" column of the table; for view
	// models, this corresponds to the "id" column of the primary element
	// comprising the view.
	DbID() int64
	// IsTable returns true if the Model corresponds to a database table;
	// otherwise, the model correponds to a view.
	IsTable() bool
	// TableName is the name of the table/view in the database this Model
	// is populated from.
	TableName() string
	// Select populates the Model from the database, including any nested
	// sub-models. If the field corresponding to the Model's DB ID is not
	// set, an error is returned.
	Select(context.Context, bun.IDB) error
}

Model interface is implemented by all models.

type ModuleTag

type ModuleTag struct {
	bun.BaseModel `bun:"table:module_tags,alias:mt"`

	ID int64 `bun:",pk,autoincrement"`

	TagIDType  TagIDType
	TagID      string
	TagVersion uint

	Language *string

	Entities []*Entity `bun:"rel:has-many,join:id=owner_id,join:type=owner_type,polymorphic:module_tag"`

	ValueTriples                        []*ValueTriple                        `bun:"rel:has-many,join:id=owner_id,join:type=owner_type,polymorphic:module_tag"`
	KeyTriples                          []*KeyTriple                          `bun:"rel:has-many,join:id=module_id"`
	ConditionalEndorsementTriples       []*ConditionalEndorsementTriple       `bun:"rel:has-many,join:id=module_id"`
	ConditionalEndorsementSeriesTriples []*ConditionalEndorsementSeriesTriple `bun:"rel:has-many,join:id=module_id"`
	DomainDependencyTriples             []*DomainDependencyTriple             `bun:"rel:has-many,join:id=module_id"`
	DomainMembershipTriples             []*DomainMembershipTriple             `bun:"rel:has-many,join:id=module_id"`

	LinkedTags []*LinkedTag `bun:"rel:has-many,join:id=module_id"`

	Extensions        []*ExtensionValue `bun:"rel:has-many,join:id=owner_id,join:type=owner_type,polymorphic:module_tag"`
	TriplesExtensions []*ExtensionValue `bun:"rel:has-many,join:id=owner_id,join:type=owner_type,polymorphic:triples"`

	ManifestID int64
}

func NewModuleTagFromCoRIM

func NewModuleTagFromCoRIM(origin *comid.Comid) (*ModuleTag, error)

func SelectModuleTag

func SelectModuleTag(ctx context.Context, db bun.IDB, id int64) (*ModuleTag, error)

func (*ModuleTag) DbID

func (o *ModuleTag) DbID() int64

func (*ModuleTag) Delete

func (o *ModuleTag) Delete(ctx context.Context, db bun.IDB) error

func (*ModuleTag) FromCoRIM

func (o *ModuleTag) FromCoRIM(origin *comid.Comid) error

func (*ModuleTag) Insert

func (o *ModuleTag) Insert(ctx context.Context, db bun.IDB) error

func (*ModuleTag) IsTable

func (o *ModuleTag) IsTable() bool

func (*ModuleTag) OwnerDbID added in v0.3.0

func (o *ModuleTag) OwnerDbID() int64

func (*ModuleTag) OwnerName added in v0.3.0

func (o *ModuleTag) OwnerName() string

func (*ModuleTag) Select

func (o *ModuleTag) Select(ctx context.Context, db bun.IDB) error

func (*ModuleTag) SetActive

func (o *ModuleTag) SetActive(value bool)

func (*ModuleTag) TableName

func (o *ModuleTag) TableName() string

func (*ModuleTag) ToCoRIM

func (o *ModuleTag) ToCoRIM() (*comid.Comid, error)

func (*ModuleTag) Validate

func (o *ModuleTag) Validate() error

type ModuleTagEntry

type ModuleTagEntry struct {
	bun.BaseModel `bun:"table:module_tag_entries,alias:mte"`

	ManifestDbID  int64 `bun:"manifest_db_id"`
	ModuleTagDbID int64 `bun:"module_tag_db_id"`

	ManifestIDType TagIDType
	ManifestID     string

	ModuleTagIDType  TagIDType
	ModuleTagID      string
	ModuleTagVersion uint

	Language *string

	Label string `bun:",nullzero"`

	ProfileType ProfileType `bun:",nullzero"`
	Profile     string      `bun:",nullzero"`

	NotBefore *time.Time
	NotAfter  *time.Time
}

func (*ModuleTagEntry) DbID

func (o *ModuleTagEntry) DbID() int64

func (*ModuleTagEntry) IsTable

func (o *ModuleTagEntry) IsTable() bool

func (*ModuleTagEntry) Select

func (o *ModuleTagEntry) Select(ctx context.Context, db bun.IDB) error

func (*ModuleTagEntry) TableName

func (o *ModuleTagEntry) TableName() string

func (*ModuleTagEntry) ToManifest

func (o *ModuleTagEntry) ToManifest(ctx context.Context, db bun.IDB) (*Manifest, error)

func (*ModuleTagEntry) ToModuleTag

func (o *ModuleTagEntry) ToModuleTag(ctx context.Context, db bun.IDB) (*ModuleTag, error)

type OwnedModel added in v0.3.0

type OwnedModel interface {
	Model

	// OwnerDbID returns the unique database ID of the owner of this
	// model.
	OwnerDbID() int64

	// OwnerName returns the name of the owner model. In case of Bun
	// polymorphic ownership, this must match the values specified in the
	// "polymorphic" part of the  field's tag (i.e. OwnerType). For
	// non-polymorphic ownership, a constant value is returned. In all
	// cases, the value typically correspeonds to the singular version of
	// the owner's table name. For example, values owned by a ModuleTag
	// (table name "module_tags") will return "module_tag".
	OwnerName() string
}

OwnedModel is a Model that is owned by another Model.

type ProfileType

type ProfileType string
const (
	OIDProfile ProfileType = "oid"
	URIProfile ProfileType = "uri"
)

type RoleEntry

type RoleEntry struct {
	bun.BaseModel `bun:"table:roles,alias:rol"`

	ID int64 `bun:",pk,autoincrement"`

	Role string

	EntityID int64
}

func CoMIDRolesFromCoRIM

func CoMIDRolesFromCoRIM(origin comid.Roles) ([]RoleEntry, error)

func CoRIMRolesFromCoRIM

func CoRIMRolesFromCoRIM(origin corim.Roles) ([]RoleEntry, error)

func MustNewCoMIDRoleEntry

func MustNewCoMIDRoleEntry(text string) *RoleEntry

func MustNewCoRIMRoleEntry

func MustNewCoRIMRoleEntry(text string) *RoleEntry

func NewCoMIDRoleEntry

func NewCoMIDRoleEntry(text string) (*RoleEntry, error)

func NewCoRIMRoleEntry

func NewCoRIMRoleEntry(text string) (*RoleEntry, error)

func (*RoleEntry) DbID

func (o *RoleEntry) DbID() int64

func (*RoleEntry) Delete

func (o *RoleEntry) Delete(ctx context.Context, db bun.IDB) error

func (*RoleEntry) Insert

func (o *RoleEntry) Insert(ctx context.Context, db bun.IDB) error

func (*RoleEntry) IsTable

func (o *RoleEntry) IsTable() bool

func (*RoleEntry) OwnerDbID added in v0.3.0

func (o *RoleEntry) OwnerDbID() int64

func (*RoleEntry) OwnerName added in v0.3.0

func (o *RoleEntry) OwnerName() string

func (*RoleEntry) Select

func (o *RoleEntry) Select(ctx context.Context, db bun.IDB) error

func (*RoleEntry) TableName

func (o *RoleEntry) TableName() string

type StatefulEnvironment added in v0.3.0

type StatefulEnvironment struct {
	bun.BaseModel `bun:"table:stateful_environments,alias:senv"`

	ID int64 `bun:",pk,autoincrement"`

	EnvironmentID int64        `bun:",nullzero"`
	Environment   *Environment `bun:"rel:belongs-to,join:environment_id=id"`

	Measurements []*Measurement `bun:"rel:has-many,join:id=owner_id,join:type=owner_type,polymorphic:stateful_environment"`

	TripleID int64 `bun:",nullzero"`
}

func NewStatefulEnvironmentFromCoRIM added in v0.3.0

func NewStatefulEnvironmentFromCoRIM(origin *comid.StatefulEnvironment) (*StatefulEnvironment, error)

func SelectStatefulEnvironment added in v0.3.0

func SelectStatefulEnvironment(ctx context.Context, db bun.IDB, id int64) (*StatefulEnvironment, error)

func StatefulEnvironmentsFromCoRIM added in v0.3.0

func StatefulEnvironmentsFromCoRIM(origin *comid.StatefulEnvironments) ([]*StatefulEnvironment, error)

func (*StatefulEnvironment) DbID added in v0.3.0

func (o *StatefulEnvironment) DbID() int64

func (*StatefulEnvironment) Delete added in v0.3.0

func (o *StatefulEnvironment) Delete(ctx context.Context, db bun.IDB) error

func (*StatefulEnvironment) FromCoRIM added in v0.3.0

func (o *StatefulEnvironment) FromCoRIM(origin *comid.StatefulEnvironment) error

func (*StatefulEnvironment) Insert added in v0.3.0

func (o *StatefulEnvironment) Insert(ctx context.Context, db bun.IDB) error

func (*StatefulEnvironment) IsTable added in v0.3.0

func (o *StatefulEnvironment) IsTable() bool

func (*StatefulEnvironment) OwnerDbID added in v0.3.0

func (o *StatefulEnvironment) OwnerDbID() int64

func (*StatefulEnvironment) OwnerName added in v0.3.0

func (o *StatefulEnvironment) OwnerName() string

func (*StatefulEnvironment) Select added in v0.3.0

func (o *StatefulEnvironment) Select(ctx context.Context, db bun.IDB) error

func (*StatefulEnvironment) TableName added in v0.3.0

func (o *StatefulEnvironment) TableName() string

func (*StatefulEnvironment) ToCoRIM added in v0.3.0

func (*StatefulEnvironment) Validate added in v0.3.0

func (o *StatefulEnvironment) Validate() error

type TagIDType

type TagIDType string
const (
	StringTagID TagIDType = "string"
	UUIDTagID   TagIDType = "uuid"
)

func ParseSWIDTagID added in v0.3.0

func ParseSWIDTagID(tag swid.TagID) (TagIDType, string)

ParseSWIDTagID convets a swid.TagID into a string representation of its value and a TagIDType indicting the value's type.

type TagRelation

type TagRelation string
const (
	SupplementsRelation TagRelation = "supplements"
	ReplacesRelation    TagRelation = "replaces"
)

type Token

type Token struct {
	bun.BaseModel `bun:"table:tokens,alias:tok"`

	ID int64 `bun:",pk,autoincrement"`

	ManifestID string `bun:",unique"`
	IsSigned   bool
	Data       []byte

	Authority []*CryptoKey `bun:"rel:has-many,join:id=owner_id,join:type=owner_type,polymorphic:token"`
}

func (*Token) DbID

func (o *Token) DbID() int64

func (*Token) Delete

func (o *Token) Delete(ctx context.Context, db bun.IDB) error

func (*Token) Insert

func (o *Token) Insert(ctx context.Context, db bun.IDB) error

func (*Token) IsTable

func (o *Token) IsTable() bool

func (*Token) Select

func (o *Token) Select(ctx context.Context, db bun.IDB) error

func (*Token) TableName

func (o *Token) TableName() string

type ValueTriple

type ValueTriple struct {
	bun.BaseModel `bun:"table:value_triples,alias:vt"`

	ID int64 `bun:",pk,autoincrement"`

	EnvironmentID int64        `bun:",nullzero"`
	Environment   *Environment `bun:"rel:belongs-to,join:environment_id=id"`

	Type         ValueTripleType
	Measurements []*Measurement `bun:"rel:has-many,join:id=owner_id,join:type=owner_type,polymorphic:value_triple"`

	IsActive bool

	OwnerID   int64  `bun:",nullzero"`
	OwnerType string `bun:",nullzero"`
}

func NewValueTripleFromCoRIM

func NewValueTripleFromCoRIM(origin *comid.ValueTriple) (*ValueTriple, error)

func SelectValueTriple

func SelectValueTriple(ctx context.Context, db bun.IDB, id int64) (*ValueTriple, error)

func ValueTriplesFromCoRIM

func ValueTriplesFromCoRIM(origin *comid.ValueTriples, typ ValueTripleType) ([]*ValueTriple, error)

func (*ValueTriple) DatabaseID

func (o *ValueTriple) DatabaseID() int64

func (*ValueTriple) DbID

func (o *ValueTriple) DbID() int64

func (*ValueTriple) Delete

func (o *ValueTriple) Delete(ctx context.Context, db bun.IDB) error

func (*ValueTriple) FromCoRIM

func (o *ValueTriple) FromCoRIM(origin *comid.ValueTriple) error

func (*ValueTriple) Insert

func (o *ValueTriple) Insert(ctx context.Context, db bun.IDB) error

func (*ValueTriple) IsTable

func (o *ValueTriple) IsTable() bool

func (*ValueTriple) OwnerDbID added in v0.3.0

func (o *ValueTriple) OwnerDbID() int64

func (*ValueTriple) OwnerName added in v0.3.0

func (o *ValueTriple) OwnerName() string

func (*ValueTriple) Select

func (o *ValueTriple) Select(ctx context.Context, db bun.IDB) error

func (*ValueTriple) TableName

func (o *ValueTriple) TableName() string

func (*ValueTriple) ToCoRIM

func (o *ValueTriple) ToCoRIM() (*comid.ValueTriple, error)

func (*ValueTriple) TripleType

func (o *ValueTriple) TripleType() string

func (*ValueTriple) Validate

func (o *ValueTriple) Validate() error

type ValueTripleEntry

type ValueTripleEntry struct {
	bun.BaseModel `bun:"table:value_triple_entries,alias:vte"`

	TripleDbID    int64 `bun:"triple_db_id"`
	ManifestDbID  int64 `bun:"manifest_db_id"`
	ModuleTagDbID int64 `bun:"module_tag_db_id"`
	EnvironmentID int64 `bun:"environment_db_id"`

	TripleType ValueTripleType

	IsActive bool

	ManifestIDType TagIDType
	ManifestID     string

	ModuleTagIDType  TagIDType
	ModuleTagID      string
	ModuleTagVersion uint

	Language *string

	Label string `bun:",nullzero"`

	ProfileType ProfileType `bun:",nullzero"`
	Profile     string      `bun:",nullzero"`

	NotBefore *time.Time
	NotAfter  *time.Time
}

func (*ValueTripleEntry) DbID

func (o *ValueTripleEntry) DbID() int64

func (*ValueTripleEntry) IsTable

func (o *ValueTripleEntry) IsTable() bool

func (*ValueTripleEntry) Select

func (o *ValueTripleEntry) Select(ctx context.Context, db bun.IDB) error

func (*ValueTripleEntry) TableName

func (o *ValueTripleEntry) TableName() string

func (*ValueTripleEntry) ToManifest

func (o *ValueTripleEntry) ToManifest(ctx context.Context, db bun.IDB) (*Manifest, error)

func (*ValueTripleEntry) ToModuleTag

func (o *ValueTripleEntry) ToModuleTag(ctx context.Context, db bun.IDB) (*ModuleTag, error)

func (*ValueTripleEntry) ToTriple

func (o *ValueTripleEntry) ToTriple(ctx context.Context, db bun.IDB) (*ValueTriple, error)

type ValueTripleType

type ValueTripleType string
const (
	ReferenceValueTriple ValueTripleType = "reference"
	EndorsedValueTriple  ValueTripleType = "endorsement"
)

Jump to

Keyboard shortcuts

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