Documentation
¶
Index ¶
- Constants
- Variables
- func CoMIDEntitiesToCoRIM(origin []*Entity) (*comid.Entities, error)
- func CoMIDExtensionsToCoRIM(origin []*ExtensionValue) (comid.Extensions, error)
- func CoRIMEntitiesToCoRIM(origin []*Entity) (*corim.Entities, error)
- func CoRIMExtensionsToCoRIM(origin []*ExtensionValue) (corim.Extensions, error)
- func CryptoKeysToCoRIM(origin []*CryptoKey) (*comid.CryptoKeys, error)
- func DigestsToCoRIM(origin []*Digest) (*comid.Digests, error)
- func FlagsToCoRIM(origin []*Flag) (*comid.FlagsMap, error)
- func IntegerityRegistersToCoRIM(origin []*IntegrityRegister) (*comid.IntegrityRegisters, error)
- func KeyTriplesToCoRIM(origin []*KeyTriple, typ KeyTripleType) (*comid.KeyTriples, error)
- func LinkedTagsToCoRIM(origin []*LinkedTag) (*comid.LinkedTags, error)
- func LocatorsToCoRIM(origin []*Locator) (*[]corim.Locator, error)
- func MeasurementsToCoRIM(origin []*Measurement) (comid.Measurements, error)
- func ParseCoMIDRole(text string) (comid.Role, error)
- func ParseCoRIMRole(text string) (corim.Role, error)
- func RegisterModels(db *bun.DB)
- func ResetModels(ctx context.Context, db *bun.DB) error
- func UpdateSelectQueryFromEnvironment(query *bun.SelectQuery, env *Environment, exact bool, dialect schema.Dialect) *bun.SelectQuery
- func ValueTriplesToCoRIM(origin []*ValueTriple, typ ValueTripleType) (*comid.ValueTriples, error)
- type CryptoKey
- func (o *CryptoKey) DbID() int64
- func (o *CryptoKey) Delete(ctx context.Context, db bun.IDB) error
- func (o *CryptoKey) FromCoRIM(origin *comid.CryptoKey) error
- func (o *CryptoKey) Insert(ctx context.Context, db bun.IDB) error
- func (o *CryptoKey) IsTable() bool
- func (o *CryptoKey) Select(ctx context.Context, db bun.IDB) error
- func (o *CryptoKey) TableName() string
- func (o *CryptoKey) ToCoRIM() (*comid.CryptoKey, error)
- type Digest
- type Entity
- func (o *Entity) DbID() int64
- func (o *Entity) Delete(ctx context.Context, db bun.IDB) error
- func (o *Entity) FromCoMIDCoRIM(origin *comid.Entity) error
- func (o *Entity) FromCoRIMCoRIM(origin *corim.Entity) error
- func (o *Entity) Insert(ctx context.Context, db bun.IDB) error
- func (o *Entity) IsTable() bool
- func (o *Entity) Roles() []string
- func (o *Entity) Select(ctx context.Context, db bun.IDB) error
- func (o *Entity) TableName() string
- func (o *Entity) ToCoMIDCoRIM() (*comid.Entity, error)
- func (o *Entity) ToCoRIMCoRIM() (*corim.Entity, error)
- func (o *Entity) Validate() error
- type Environment
- func (o *Environment) DbID() int64
- func (o *Environment) DeleteIfOrphaned(ctx context.Context, db bun.IDB) error
- func (o *Environment) FromCoRIM(origin *comid.Environment) error
- func (o *Environment) Insert(ctx context.Context, db bun.IDB) error
- func (o *Environment) IsEmpty() bool
- func (o *Environment) IsTable() bool
- func (o Environment) RenderParts() ([][2]string, error)
- func (o *Environment) Select(ctx context.Context, db bun.IDB) error
- func (o *Environment) TableName() string
- func (o Environment) ToCoRIM() (*comid.Environment, error)
- func (o *Environment) Validate() error
- type ExtensionValue
- func (o *ExtensionValue) DbID() int64
- func (o *ExtensionValue) Delete(ctx context.Context, db bun.IDB) error
- func (o *ExtensionValue) Insert(ctx context.Context, db bun.IDB) error
- func (o *ExtensionValue) IsTable() bool
- func (o *ExtensionValue) Select(ctx context.Context, db bun.IDB) error
- func (o *ExtensionValue) TableName() string
- type Flag
- type IntegrityRegister
- func (o *IntegrityRegister) DbID() int64
- func (o *IntegrityRegister) Delete(ctx context.Context, db bun.IDB) error
- func (o *IntegrityRegister) Insert(ctx context.Context, db bun.IDB) error
- func (o *IntegrityRegister) IsTable() bool
- func (o *IntegrityRegister) Select(ctx context.Context, db bun.IDB) error
- func (o *IntegrityRegister) StringIndex() string
- func (o *IntegrityRegister) TableName() string
- type KeyTriple
- func (o *KeyTriple) DatabaseID() int64
- func (o *KeyTriple) DbID() int64
- func (o *KeyTriple) Delete(ctx context.Context, db bun.IDB) error
- func (o *KeyTriple) FromCoRIM(origin *comid.KeyTriple) error
- func (o *KeyTriple) Insert(ctx context.Context, db bun.IDB) error
- func (o *KeyTriple) IsTable() bool
- func (o *KeyTriple) Select(ctx context.Context, db bun.IDB) error
- func (o *KeyTriple) TableName() string
- func (o *KeyTriple) ToCoRIM() (*comid.KeyTriple, error)
- func (o *KeyTriple) TripleType() string
- func (o *KeyTriple) Validate() error
- type KeyTripleEntry
- func (o *KeyTripleEntry) DbID() int64
- func (o *KeyTripleEntry) IsTable() bool
- func (o *KeyTripleEntry) Select(ctx context.Context, db bun.IDB) error
- func (o *KeyTripleEntry) TableName() string
- func (o *KeyTripleEntry) ToManifest(ctx context.Context, db bun.IDB) (*Manifest, error)
- func (o *KeyTripleEntry) ToModuleTag(ctx context.Context, db bun.IDB) (*ModuleTag, error)
- func (o *KeyTripleEntry) ToTriple(ctx context.Context, db bun.IDB) (*KeyTriple, error)
- type KeyTripleType
- type LinkedTag
- func (o *LinkedTag) DbID() int64
- func (o *LinkedTag) Delete(ctx context.Context, db bun.IDB) error
- func (o *LinkedTag) FromCoRIM(origin *comid.LinkedTag) error
- func (o *LinkedTag) Insert(ctx context.Context, db bun.IDB) error
- func (o *LinkedTag) IsTable() bool
- func (o *LinkedTag) Select(ctx context.Context, db bun.IDB) error
- func (o *LinkedTag) TableName() string
- func (o *LinkedTag) ToCoRIM() (*comid.LinkedTag, error)
- type Locator
- func (o *Locator) DbID() int64
- func (o *Locator) Delete(ctx context.Context, db bun.IDB) error
- func (o *Locator) FromCoRIM(origin corim.Locator) error
- func (o *Locator) Insert(ctx context.Context, db bun.IDB) error
- func (o *Locator) IsTable() bool
- func (o *Locator) Select(ctx context.Context, db bun.IDB) error
- func (o *Locator) TableName() string
- func (o *Locator) ToCoRIM() (corim.Locator, error)
- type Manifest
- func (o *Manifest) DbID() int64
- func (o *Manifest) Delete(ctx context.Context, db bun.IDB) error
- func (o *Manifest) FromCoRIM(origin *corim.UnsignedCorim) error
- func (o *Manifest) Insert(ctx context.Context, db bun.IDB) error
- func (o *Manifest) IsTable() bool
- func (o *Manifest) Select(ctx context.Context, db bun.IDB) error
- func (o *Manifest) SetActive(value bool)
- func (o *Manifest) TableName() string
- func (o *Manifest) ToCoRIM() (*corim.UnsignedCorim, error)
- func (o *Manifest) Validate() error
- type ManifestEntry
- type ManifestIDType
- type Measurement
- func (o *Measurement) DbID() int64
- func (o *Measurement) Delete(ctx context.Context, db bun.IDB) error
- func (o *Measurement) FromCoRIM(origin *comid.Measurement) error
- func (o *Measurement) Insert(ctx context.Context, db bun.IDB) error
- func (o *Measurement) IsTable() bool
- func (o *Measurement) Select(ctx context.Context, db bun.IDB) error
- func (o *Measurement) TableName() string
- func (o *Measurement) ToCoRIM() (*comid.Measurement, error)
- type MeasurementValueEntry
- func (o *MeasurementValueEntry) DbID() int64
- func (o *MeasurementValueEntry) Delete(ctx context.Context, db bun.IDB) error
- func (o *MeasurementValueEntry) Insert(ctx context.Context, db bun.IDB) error
- func (o *MeasurementValueEntry) IsTable() bool
- func (o *MeasurementValueEntry) Select(ctx context.Context, db bun.IDB) error
- func (o *MeasurementValueEntry) TableName() string
- type Model
- type ModuleTag
- func (o *ModuleTag) DbID() int64
- func (o *ModuleTag) Delete(ctx context.Context, db bun.IDB) error
- func (o *ModuleTag) FromCoRIM(origin *comid.Comid) error
- func (o *ModuleTag) Insert(ctx context.Context, db bun.IDB) error
- func (o *ModuleTag) IsTable() bool
- func (o *ModuleTag) Select(ctx context.Context, db bun.IDB) error
- func (o *ModuleTag) SetActive(value bool)
- func (o *ModuleTag) TableName() string
- func (o *ModuleTag) ToCoRIM() (*comid.Comid, error)
- func (o *ModuleTag) Validate() error
- type ModuleTagEntry
- func (o *ModuleTagEntry) DbID() int64
- func (o *ModuleTagEntry) IsTable() bool
- func (o *ModuleTagEntry) Select(ctx context.Context, db bun.IDB) error
- func (o *ModuleTagEntry) TableName() string
- func (o *ModuleTagEntry) ToManifest(ctx context.Context, db bun.IDB) (*Manifest, error)
- func (o *ModuleTagEntry) ToModuleTag(ctx context.Context, db bun.IDB) (*ModuleTag, error)
- type ProfileType
- type RoleEntry
- func CoMIDRolesFromCoRIM(origin comid.Roles) ([]RoleEntry, error)
- func CoRIMRolesFromCoRIM(origin corim.Roles) ([]RoleEntry, error)
- func MustNewCoMIDRoleEntry(text string) *RoleEntry
- func MustNewCoRIMRoleEntry(text string) *RoleEntry
- func NewCoMIDRoleEntry(text string) (*RoleEntry, error)
- func NewCoRIMRoleEntry(text string) (*RoleEntry, error)
- func (o *RoleEntry) DbID() int64
- func (o *RoleEntry) Delete(ctx context.Context, db bun.IDB) error
- func (o *RoleEntry) Insert(ctx context.Context, db bun.IDB) error
- func (o *RoleEntry) IsTable() bool
- func (o *RoleEntry) Select(ctx context.Context, db bun.IDB) error
- func (o *RoleEntry) TableName() string
- type TagIDType
- type TagRelation
- type Token
- type ValueTriple
- func (o *ValueTriple) DatabaseID() int64
- func (o *ValueTriple) DbID() int64
- func (o *ValueTriple) Delete(ctx context.Context, db bun.IDB) error
- func (o *ValueTriple) FromCoRIM(origin *comid.ValueTriple) error
- func (o *ValueTriple) Insert(ctx context.Context, db bun.IDB) error
- func (o *ValueTriple) IsTable() bool
- func (o *ValueTriple) Select(ctx context.Context, db bun.IDB) error
- func (o *ValueTriple) TableName() string
- func (o *ValueTriple) ToCoRIM() (*comid.ValueTriple, error)
- func (o *ValueTriple) TripleType() string
- func (o *ValueTriple) Validate() error
- type ValueTripleEntry
- func (o *ValueTripleEntry) DbID() int64
- func (o *ValueTripleEntry) IsTable() bool
- func (o *ValueTripleEntry) Select(ctx context.Context, db bun.IDB) error
- func (o *ValueTripleEntry) TableName() string
- func (o *ValueTripleEntry) ToManifest(ctx context.Context, db bun.IDB) (*Manifest, error)
- func (o *ValueTripleEntry) ToModuleTag(ctx context.Context, db bun.IDB) (*ModuleTag, error)
- func (o *ValueTripleEntry) ToTriple(ctx context.Context, db bun.IDB) (*ValueTriple, error)
- type ValueTripleType
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 CoMIDExtensionsToCoRIM ¶
func CoMIDExtensionsToCoRIM(origin []*ExtensionValue) (comid.Extensions, error)
func CoRIMExtensionsToCoRIM ¶
func CoRIMExtensionsToCoRIM(origin []*ExtensionValue) (corim.Extensions, error)
func CryptoKeysToCoRIM ¶
func CryptoKeysToCoRIM(origin []*CryptoKey) (*comid.CryptoKeys, error)
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 MeasurementsToCoRIM ¶
func MeasurementsToCoRIM(origin []*Measurement) (comid.Measurements, error)
func RegisterModels ¶
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 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 SelectCryptoKey ¶
type Digest ¶
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 CoRIMEntitiesFromCoRIM ¶
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 (*Environment) DbID ¶
func (o *Environment) DbID() int64
func (*Environment) DeleteIfOrphaned ¶
func (*Environment) FromCoRIM ¶
func (o *Environment) FromCoRIM(origin *comid.Environment) 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) 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) IsTable ¶
func (o *ExtensionValue) IsTable() bool
func (*ExtensionValue) TableName ¶
func (o *ExtensionValue) TableName() string
type Flag ¶
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) IsTable ¶
func (o *IntegrityRegister) IsTable() bool
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"`
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 SelectKeyTriple ¶
func (*KeyTriple) DatabaseID ¶
func (*KeyTriple) TripleType ¶
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
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) TableName ¶
func (o *KeyTripleEntry) TableName() string
func (*KeyTripleEntry) ToManifest ¶
func (*KeyTripleEntry) ToModuleTag ¶
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 SelectLinkedTag ¶
type Locator ¶
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 ¶
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) TableName ¶
func (o *ManifestEntry) TableName() string
func (*ManifestEntry) ToManifest ¶
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"`
AuthorizedBy []*CryptoKey `bun:"rel:has-many,join:id=owner_id,join:type=owner_type,polymorphic:measurement"`
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 (*Measurement) DbID ¶
func (o *Measurement) DbID() int64
func (*Measurement) FromCoRIM ¶
func (o *Measurement) FromCoRIM(origin *comid.Measurement) error
func (*Measurement) IsTable ¶
func (o *Measurement) IsTable() bool
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) IsTable ¶
func (o *MeasurementValueEntry) IsTable() bool
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=module_id"`
KeyTriples []*KeyTriple `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 SelectModuleTag ¶
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) TableName ¶
func (o *ModuleTagEntry) TableName() string
func (*ModuleTagEntry) ToManifest ¶
func (*ModuleTagEntry) ToModuleTag ¶
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 MustNewCoMIDRoleEntry ¶
func MustNewCoRIMRoleEntry ¶
func NewCoMIDRoleEntry ¶
func NewCoRIMRoleEntry ¶
type TagRelation ¶
type TagRelation string
const ( SupplementsRelation TagRelation = "supplements" ReplacesRelation TagRelation = "replaces" )
type Token ¶
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
ModuleID int64 `bun:",nullzero"`
}
func NewValueTripleFromCoRIM ¶
func NewValueTripleFromCoRIM(origin *comid.ValueTriple) (*ValueTriple, error)
func SelectValueTriple ¶
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) FromCoRIM ¶
func (o *ValueTriple) FromCoRIM(origin *comid.ValueTriple) error
func (*ValueTriple) IsTable ¶
func (o *ValueTriple) IsTable() bool
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) TableName ¶
func (o *ValueTripleEntry) TableName() string
func (*ValueTripleEntry) ToManifest ¶
func (*ValueTripleEntry) ToModuleTag ¶
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" )
Click to show internal directories.
Click to hide internal directories.