Documentation
¶
Index ¶
- Variables
- type AggregateRoot
- type BIOS
- type Blob
- type Board
- type CPUInfo
- type Chassis
- type Index
- type KeyValueEntity
- type Organization
- type Product
- type Reference
- type Registration
- type Role
- type Service
- type System
- type SystemRuntime
- type TimeSeriesIndexer
- type User
- func (user *User) AddCredential(credential *webauthn.Credential)
- func (user *User) AddRole(role *Role)
- func (user *User) EntityID() uint64
- func (user *User) HasRole(name string) bool
- func (user *User) SetEntityID(id uint64)
- func (user *User) UpdateCredential(credential *webauthn.Credential)
- func (user *User) WebAuthnCredentials() []webauthn.Credential
- func (user *User) WebAuthnDisplayName() string
- func (user *User) WebAuthnID() []byte
- func (user *User) WebAuthnName() string
Constants ¶
This section is empty.
Variables ¶
var (
ErrEmptyReferencesSlice = errors.New("entity/aggregate-root: empty references slice")
)
Functions ¶
This section is empty.
Types ¶
type AggregateRoot ¶
type AggregateRoot struct { References []KeyValueEntity `yaml:"-" json:"-"` ReferencePartition string `yaml:"-" json:"-"` Root KeyValueEntity `yaml:"-" json:"-"` RootPartition string `yaml:"-" json:"-"` }
Aggretate root used to manage key/value entity relationships
func NewAggregateRoot ¶
func NewAggregateRoot( root KeyValueEntity, rootPartition string, references []KeyValueEntity, referencesPartition string) (*AggregateRoot, error)
Create a new key/value aggregate root
func (*AggregateRoot) EntityIDs ¶
func (aggregate *AggregateRoot) EntityIDs() []uint64
Returns a list of the referenced entity ids
func (*AggregateRoot) Partition ¶
func (aggregate *AggregateRoot) Partition() string
Returns the aggregate root partition
type BIOS ¶
type Blob ¶
type Blob struct { ID uint64 `yaml:"id" json:"id"` Bytes []byte `yaml:"bytes" json:"bytes"` Entity interface{} `yaml:"entity" json:"entity"` KeyValueEntity `yaml:"-" json:"-"` // contains filtered or unexported fields }
func (*Blob) SetEntityID ¶
func (*Blob) SetPartition ¶
type Board ¶
type CPUInfo ¶
type Chassis ¶
type Index ¶
type Index interface { Name() string RefID() uint64 KeyValueEntity }
type KeyValueEntity ¶
type Organization ¶
type Organization struct { ID uint64 `yaml:"id" json:"id"` Name string `yaml:"name" json:"name"` KeyValueEntity `yaml:"-" json:"-"` }
func NewOrganization ¶
func NewOrganization(name string) *Organization
func (*Organization) EntityID ¶
func (organization *Organization) EntityID() uint64
func (*Organization) SetEntityID ¶
func (organization *Organization) SetEntityID(id uint64)
type Product ¶
type Reference ¶
type Reference struct { ID uint64 `yaml:"id" json:"id"` ReferenceID uint64 `yaml:"ref-id" json:"ref_id"` Index `yaml:"-" json:"-"` // contains filtered or unexported fields }
func (*Reference) SetEntityID ¶
type Registration ¶
type Registration struct { ID uint64 `yaml:"id" json:"id"` Email string `yaml:"email" json:"email"` Password string `yaml:"password" json:"password"` OrgID uint64 `yaml:"org-id" json:"org_id"` OrgName string `yaml:"org-name" json:"org_name"` SessionData []byte `yaml:"session-data" json:"session_data"` KeyValueEntity `yaml:"-" json:"-"` }
func NewRegistration ¶
func NewRegistration(email string) *Registration
func (*Registration) EntityID ¶
func (r *Registration) EntityID() uint64
func (*Registration) SetEntityID ¶
func (r *Registration) SetEntityID(id uint64)
type Role ¶
type Role struct { ID uint64 `json:"id"` Name string `json:"name"` KeyValueEntity `yaml:"-" json:"-"` }
func (*Role) SetEntityID ¶
type Service ¶
type Service struct { ID uint64 Name string KeyAttributes *keystore.KeyAttributes }
func NewService ¶
func (*Service) SetEntityID ¶
type System ¶
type System struct { BIOS *BIOS `yaml:"bios" json:"bios,omitempty"` Board *Board `yaml:"board" json:"board,omitempty"` Chassis *Chassis `yaml:"chassis" json:"chassis,omitempty"` CPU *CPUInfo `yaml:"cpu" json:"cpu"` Mode string `yaml:"mode" json:"mode"` Product *Product `yaml:"product" json:"product"` Runtime *SystemRuntime `yaml:"runtime" json:"runtime"` Services int `yaml:"services" json:"services"` }
type SystemRuntime ¶
type SystemRuntime struct { Version string `yaml:"version" json:"version"` Goroutines int `yaml:"goroutines" json:"goroutines"` Cpus int `yaml:"cpus" json:"cpus"` Cgo int64 `yaml:"cgo" json:"cgo"` HeapSize uint64 `yaml:"heap-alloc" json:"heapAlloc"` Alloc uint64 `yaml:"alloc" json:"alloc"` Sys uint64 `yaml:"sys" json:"sys"` Mallocs uint64 `yaml:"mallocs" json:"mallocs"` Frees uint64 `yaml:"frees" json:"frees"` NumGC uint32 `yaml:"gc" json:"gc"` NumForcedGC uint32 `yaml:"num-forced-gc" json:"numForcedGC"` }
func (SystemRuntime) Print ¶
func (sr SystemRuntime) Print()
type TimeSeriesIndexer ¶
type TimeSeriesIndexer interface { KeyValueEntity SetTimestamp(timestamp uint64) Timestamp() uint64 }
type User ¶
type User struct { ID uint64 `yaml:"id" json:"id"` Credentials []webauthn.Credential `yaml:"credentials" json:"credentials"` DisplayName string `yaml:"display" json:"display"` Email string `yaml:"email" json:"email"` OrganizationRefs []uint64 `yaml:"orgs" json:"orgs"` Password string `yaml:"password" json:"password"` Roles []*Role `yaml:"roles" json:"roles"` ServiceRefs []uint64 `yaml:"services" json:"services"` SessionData []byte `yaml:"session" json:"session"` KeyValueEntity `yaml:"-" json:"-"` webauthn.User `yaml:"-" json:"-"` }
func (*User) AddCredential ¶
func (user *User) AddCredential(credential *webauthn.Credential)
Adds a new WebAuthn credential
func (*User) SetEntityID ¶
func (*User) UpdateCredential ¶
func (user *User) UpdateCredential(credential *webauthn.Credential)
func (*User) WebAuthnCredentials ¶
func (user *User) WebAuthnCredentials() []webauthn.Credential
WebAuthnCredentials provides the list of Credential objects owned by the user.
func (*User) WebAuthnDisplayName ¶
Specification: §5.4.3. User Account Parameters for Credential Generation https://www.w3.org/TR/webauthn/#dom-publickeycredentialuserentity-displayname
func (*User) WebAuthnID ¶
Specification: §5.4.3. User Account Parameters for Credential Generation https://w3c.github.io/webauthn/#dom-publickeycredentialuserentity-id
func (*User) WebAuthnName ¶
Specification: §5.4.3. User Account Parameters for Credential Generation https://w3c.github.io/webauthn/#dictdef-publickeycredentialuserentity