Documentation
¶
Index ¶
- Constants
- func HashPayload(payload []byte) []byte
- func MarshalDeterministic(msg proto.Message) ([]byte, error)
- func ResourceSummaryFromCluster(cluster inventoryv1.Cluster, activeLeases uint32, softwareVersion string, ...) inventoryv1.SnapshotResourceSummary
- func ValidateNonce(nonce []byte) error
- func ValidateSnapshot(snapshot *Snapshot) error
- func ValidateSnapshotRecord(record SnapshotRecord) error
- type Builder
- type Collector
- type EvidenceSection
- type MaterialPayloadSource
- type MaterialPayloadSourceConfig
- type MemorySnapshotStore
- type OperatorMaterialSource
- type OperatorMaterialSourceConfig
- type PayloadSource
- type PersistentSnapshotStore
- func (s *PersistentSnapshotStore) Get(ctx context.Context, provider string, hash []byte) (SnapshotRecord, bool, error)
- func (s *PersistentSnapshotStore) Latest(ctx context.Context, provider string) (SnapshotRecord, bool, error)
- func (s *PersistentSnapshotStore) Put(ctx context.Context, record SnapshotRecord) error
- type RecordingSnapshotter
- func (s *RecordingSnapshotter) Build(ctx context.Context, req SnapshotRequest) (*Snapshot, error)
- func (s *RecordingSnapshotter) Committed(ctx context.Context, hash []byte) (SnapshotRecord, bool, error)
- func (s *RecordingSnapshotter) LatestCommitted(ctx context.Context) (SnapshotRecord, bool, error)
- func (s *RecordingSnapshotter) Provider() string
- type Snapshot
- type SnapshotBuilder
- type SnapshotMaterial
- type SnapshotMaterialSource
- type SnapshotRecord
- type SnapshotRequest
- type SnapshotStore
- type SnapshotValidation
- type SnapshotValidationStatus
- type StatusClient
- type StatusPayloadSource
- type StatusPayloadSourceConfig
Constants ¶
View Source
const ( SnapshotPayloadSchemaVersion uint32 = 1 EvidenceSectionProviderStatus = "akash.provider.v1.Status" )
View Source
const EvidenceSectionInventoryOperator = "akash.provider.inventory.operator.v1.Cluster"
View Source
const NonceSize = 32
Variables ¶
This section is empty.
Functions ¶
func HashPayload ¶
func ResourceSummaryFromCluster ¶
func ResourceSummaryFromCluster( cluster inventoryv1.Cluster, activeLeases uint32, softwareVersion string, softwareSignature []byte, softwareIdentity *inventoryv1.SoftwareIdentity, ) inventoryv1.SnapshotResourceSummary
func ValidateNonce ¶
func ValidateSnapshot ¶
func ValidateSnapshotRecord ¶
func ValidateSnapshotRecord(record SnapshotRecord) error
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func NewBuilder ¶
func NewBuilder(payload PayloadSource, signer ptypes.ProviderSigner) (*Builder, error)
type Collector ¶
type Collector interface {
Name() string
Collect(context.Context) (EvidenceSection, error)
}
type EvidenceSection ¶
type MaterialPayloadSource ¶
type MaterialPayloadSource struct {
// contains filtered or unexported fields
}
func NewMaterialPayloadSource ¶
func NewMaterialPayloadSource(cfg MaterialPayloadSourceConfig) (*MaterialPayloadSource, error)
func (*MaterialPayloadSource) Payload ¶
func (s *MaterialPayloadSource) Payload(ctx context.Context, req SnapshotRequest) ([]byte, error)
type MaterialPayloadSourceConfig ¶
type MaterialPayloadSourceConfig struct {
Source SnapshotMaterialSource
Provider string
ChainID string
Now func() time.Time
}
type MemorySnapshotStore ¶
type MemorySnapshotStore struct {
// contains filtered or unexported fields
}
func NewMemorySnapshotStore ¶
func NewMemorySnapshotStore() *MemorySnapshotStore
func (*MemorySnapshotStore) Get ¶
func (s *MemorySnapshotStore) Get(_ context.Context, provider string, hash []byte) (SnapshotRecord, bool, error)
func (*MemorySnapshotStore) Latest ¶
func (s *MemorySnapshotStore) Latest(_ context.Context, provider string) (SnapshotRecord, bool, error)
func (*MemorySnapshotStore) Put ¶
func (s *MemorySnapshotStore) Put(_ context.Context, record SnapshotRecord) error
type OperatorMaterialSource ¶
type OperatorMaterialSource struct {
// contains filtered or unexported fields
}
func NewOperatorMaterialSource ¶
func NewOperatorMaterialSource(ctx context.Context, cfg OperatorMaterialSourceConfig) (*OperatorMaterialSource, error)
func (*OperatorMaterialSource) SnapshotMaterial ¶
func (s *OperatorMaterialSource) SnapshotMaterial(ctx context.Context) (SnapshotMaterial, error)
type OperatorMaterialSourceConfig ¶
type OperatorMaterialSourceConfig struct {
Inventory cinventory.Client
Status StatusClient
SoftwareVersion string
SoftwareSignature []byte
SoftwareIdentity *inventoryv1.SoftwareIdentity
Collectors []Collector
}
type PayloadSource ¶
type PayloadSource interface {
Payload(context.Context, SnapshotRequest) ([]byte, error)
}
type PersistentSnapshotStore ¶
type PersistentSnapshotStore struct {
// contains filtered or unexported fields
}
func NewPersistentSnapshotStore ¶
func NewPersistentSnapshotStore(store pconfig.Verification) (*PersistentSnapshotStore, error)
func (*PersistentSnapshotStore) Get ¶
func (s *PersistentSnapshotStore) Get(ctx context.Context, provider string, hash []byte) (SnapshotRecord, bool, error)
func (*PersistentSnapshotStore) Latest ¶
func (s *PersistentSnapshotStore) Latest(ctx context.Context, provider string) (SnapshotRecord, bool, error)
func (*PersistentSnapshotStore) Put ¶
func (s *PersistentSnapshotStore) Put(ctx context.Context, record SnapshotRecord) error
type RecordingSnapshotter ¶
type RecordingSnapshotter struct {
// contains filtered or unexported fields
}
func NewRecordingSnapshotter ¶
func NewRecordingSnapshotter(next SnapshotBuilder, store SnapshotStore, now func() time.Time) (*RecordingSnapshotter, error)
func (*RecordingSnapshotter) Build ¶
func (s *RecordingSnapshotter) Build(ctx context.Context, req SnapshotRequest) (*Snapshot, error)
func (*RecordingSnapshotter) Committed ¶
func (s *RecordingSnapshotter) Committed(ctx context.Context, hash []byte) (SnapshotRecord, bool, error)
func (*RecordingSnapshotter) LatestCommitted ¶
func (s *RecordingSnapshotter) LatestCommitted(ctx context.Context) (SnapshotRecord, bool, error)
func (*RecordingSnapshotter) Provider ¶
func (s *RecordingSnapshotter) Provider() string
type SnapshotBuilder ¶
type SnapshotMaterial ¶
type SnapshotMaterial struct {
Cluster inventoryv1.Cluster
ActiveLeases uint32
EvidenceSections []inventoryv1.SnapshotEvidenceSection
SoftwareVersion string
SoftwareSignature []byte
SoftwareIdentity *inventoryv1.SoftwareIdentity
}
type SnapshotMaterialSource ¶
type SnapshotMaterialSource interface {
SnapshotMaterial(context.Context) (SnapshotMaterial, error)
}
type SnapshotRecord ¶
type SnapshotRecord struct {
Snapshot Snapshot `json:"snapshot"`
SchemaVersion uint32 `json:"schema_version"`
CreatedAt time.Time `json:"created_at"`
Validation SnapshotValidation `json:"validation"`
}
func NewSnapshotRecord ¶
type SnapshotRequest ¶
type SnapshotRequest struct {
Nonce []byte
}
type SnapshotStore ¶
type SnapshotValidation ¶
type SnapshotValidation struct {
Status SnapshotValidationStatus `json:"status"`
Error string `json:"error,omitempty"`
ValidatedAt time.Time `json:"validated_at,omitempty"`
}
type SnapshotValidationStatus ¶
type SnapshotValidationStatus string
const ( SnapshotValidationStatusUnvalidated SnapshotValidationStatus = "unvalidated" SnapshotValidationStatusValid SnapshotValidationStatus = "valid" SnapshotValidationStatusInvalid SnapshotValidationStatus = "invalid" )
type StatusClient ¶
type StatusClient interface {
StatusV1(context.Context) (*providerv1.Status, error)
}
type StatusPayloadSource ¶
type StatusPayloadSource struct {
// contains filtered or unexported fields
}
func NewStatusPayloadSource ¶
func NewStatusPayloadSource(cfg StatusPayloadSourceConfig) (*StatusPayloadSource, error)
func (*StatusPayloadSource) Payload ¶
func (s *StatusPayloadSource) Payload(ctx context.Context, req SnapshotRequest) ([]byte, error)
func (*StatusPayloadSource) SnapshotMaterial ¶
func (s *StatusPayloadSource) SnapshotMaterial(ctx context.Context) (SnapshotMaterial, error)
type StatusPayloadSourceConfig ¶
type StatusPayloadSourceConfig struct {
Status StatusClient
Provider string
ChainID string
SoftwareVersion string
SoftwareSignature []byte
SoftwareIdentity *inventoryv1.SoftwareIdentity
Now func() time.Time
Collectors []Collector
}
Click to show internal directories.
Click to hide internal directories.