Documentation
¶
Index ¶
- type ComputeCapabilityListFilters
- type ComputeCapabilityRecord
- type ComputeCapabilityState
- type ComputeCapabilityStatus
- type CreateRequest
- type CreateResponse
- type DeleteRequest
- type GetResponse
- type Ledger
- type ListRequest
- type ListResponse
- type Repository
- type UpdateResponse
- type UpdateStateRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ComputeCapabilityListFilters ¶
type ComputeCapabilityListFilters struct {
IDIn []string // IN condition
NameIn []string // IN condition
VersionGte *uint64 // Greater than or equal condition
VersionLte *uint64 // Less than or equal condition
VersionEq *uint64 // Equal condition
IncludeDeleted bool // IncludeDeleted indicates whether to include soft-deleted records in the result.
Limit uint32 // Limit is the maximum number of records to return.
StateIn []ComputeCapabilityState
StateNotIn []ComputeCapabilityState
TypeIn []string
}
ComputeCapabilityFilters contains filters for querying the ComputeCapability table.
type ComputeCapabilityRecord ¶
type ComputeCapabilityRecord struct {
Metadata core.Metadata // Metadata is the metadata that identifies the ComputeCapability. It is a combination of the ComputeCapability's name and version.
Name string // Name is the name of the ComputeCapability.
Status ComputeCapabilityStatus // Status is the status of the ComputeCapability.
Type string // Type is the type of the ComputeCapability.
Score uint32 // Score is the score of the ComputeCapability. This is relative to the other ComputeCapabilities of the same type.
}
ComputeCapability is a representation of the ComputeCapability of an application.
type ComputeCapabilityState ¶
type ComputeCapabilityState string
ComputeCapabilityState is the state of a ComputeCapability.
const ( ComputeCapabilityStateUnknown ComputeCapabilityState = "ComputeCapabilityState_UNKNOWN" ComputeCapabilityStatePending ComputeCapabilityState = "ComputeCapabilityState_PENDING" ComputeCapabilityStateActive ComputeCapabilityState = "ComputeCapabilityState_ACTIVE" ComputeCapabilityStateInActive ComputeCapabilityState = "ComputeCapabilityState_INACTIVE" )
func ComputeCapabilityStateFromString ¶
func ComputeCapabilityStateFromString(s string) ComputeCapabilityState
FromString converts a string into a ComputeCapabilityState if valid, otherwise returns an error.
func (ComputeCapabilityState) ToString ¶
func (s ComputeCapabilityState) ToString() string
ToString returns the string representation of the ComputeCapabilityState.
type ComputeCapabilityStatus ¶
type ComputeCapabilityStatus struct {
State ComputeCapabilityState // State is the discrete condition of the resource.
Message string // Message is a human-readable description of the resource's state.
}
type CreateRequest ¶
CreateRequest represents the ComputeCapability creation request.
type CreateResponse ¶
type CreateResponse struct {
Record ComputeCapabilityRecord
}
CreateResponse represents the response after creating a new ComputeCapability.
type DeleteRequest ¶
type GetResponse ¶
type GetResponse struct {
Record ComputeCapabilityRecord
}
GetResponse represents the response for fetching a ComputeCapability.
type Ledger ¶
type Ledger interface {
// Create creates a new ComputeCapability.
Create(context.Context, *CreateRequest) (*CreateResponse, error)
// GetByMetadata retrieves a ComputeCapability by its metadata.
GetByID(context.Context, string) (*GetResponse, error)
// GetByName retrieves a ComputeCapability by its name.
GetByName(context.Context, string) (*GetResponse, error)
// UpdateStatus updates the state and message of an existing ComputeCapability.
UpdateStatus(context.Context, *UpdateStateRequest) (*UpdateResponse, error)
// List returns a list of ComputeCapability that match the provided filters.
List(context.Context, *ListRequest) (*ListResponse, error)
// Delete deletes a ComputeCapability.
Delete(context.Context, *DeleteRequest) error
}
Ledger provides the methods for managing ComputeCapability records.
type ListRequest ¶
type ListRequest struct {
Filters ComputeCapabilityListFilters
}
ListRequest represents the request to list ComputeCapabilitys with filters.
type ListResponse ¶
type ListResponse struct {
Records []ComputeCapabilityRecord
}
ListResponse represents the response to a list request.
type Repository ¶
type Repository interface {
Insert(context.Context, ComputeCapabilityRecord) error
GetByID(context.Context, string) (ComputeCapabilityRecord, error)
GetByName(context.Context, string) (ComputeCapabilityRecord, error)
UpdateState(context.Context, core.Metadata, ComputeCapabilityStatus) error
Delete(context.Context, core.Metadata) error
List(context.Context, ComputeCapabilityListFilters) ([]ComputeCapabilityRecord, error)
}
Repository provides the methods that the storage layer must implement to support the ledger.
type UpdateResponse ¶
type UpdateResponse struct {
Record ComputeCapabilityRecord
}
UpdateResponse represents the response after updating the state of a ComputeCapability.
type UpdateStateRequest ¶
type UpdateStateRequest struct {
Metadata core.Metadata
Status ComputeCapabilityStatus
}
UpdateStateRequest represents the request to update the state and message of a ComputeCapability.