Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Global is the global locality. Global = GlobalLocality("global") )
Variables ¶
View Source
var ErrResourceNotFound = errors.New("store: resource not found")
ErrResourceNotFound is returned when a resource is not found.
Functions ¶
This section is empty.
Types ¶
type Actionable ¶ added in v0.2.0
type CockpitMetadata ¶
type CockpitMetadata struct { // CanViewLogs is true if the logs associated with the resource can be viewed Scaleway Cockpit. CanViewLogs bool // ResourceName is the name of the resource in Scaleway Cockpit. ResourceName string // ResourceID is the ID of the resource in Scaleway Cockpit. ResourceID string // ResourceType is the type of the resource in Scaleway Cockpit. ResourceType string }
type GlobalLocality ¶
type GlobalLocality string
func (GlobalLocality) IsRegion ¶
func (g GlobalLocality) IsRegion() bool
func (GlobalLocality) IsZone ¶
func (g GlobalLocality) IsZone() bool
func (GlobalLocality) String ¶
func (g GlobalLocality) String() string
type Indexer ¶ added in v0.2.1
type Indexer interface { // Index indexes the given resource. Index(ctx context.Context, r Resource) error // Deindex deindexes the given resource. Deindex(ctx context.Context, r Resource) error }
Indexer is a very simple wrapper around a Storer and a Searcher. It makes it harder to forget to update one of the two when adding a new resource.
type Metadata ¶
type Metadata struct { // Name is the name of the resource. Name string `json:"name"` // ID is the unique identifier of the resource. ID string `json:"id"` // ProjectID is the unique identifier of the project the resource belongs to. ProjectID string `json:"project_id"` // Status is the status of the resource. // Maybe nil if not available. Status *Status `json:"status"` // Description is the description of the resource. // May be empty. Description *string `json:"description"` // CreatedAt is the date the resource was created. // Maybe nil if not available. CreatedAt *time.Time `json:"created_at,omitempty"` // Tags is the list of tags associated with the resource. Tags []string `json:"tags"` // Type is the type of the resource. Type Type `json:"type"` // Locality is the locality of the resource. Locality Locality `json:"locality,omitempty"` }
type Resource ¶
type Resource interface { // Metadata returns the metadatas of the resource. Metadata() Metadata // CockpitMetadata returns the metadatas of the resource for Scaleway Cockpit. CockpitMetadata() CockpitMetadata // Delete deletes the resource. // It will also remove the resource from the index. Delete(ctx context.Context, index Indexer, client *scw.Client) error }
type Status ¶
type Status string
const ( StatusUnknown Status = "unknown" StatusActive Status = "active" StatusError Status = "error" StatusDeleted Status = "deleted" StatusReady Status = "ready" StatusPending Status = "pending" StatusRunning Status = "running" StatusQueued Status = "queued" StatusSucceded Status = "succeeded" StatusFailed Status = "failed" StatusCanceled Status = "canceled" )
type Type ¶
type Type int
const ( TypeProject Type = iota TypeIAMApplication // IAM Application TypeCockpit TypeFunctionNamespace // Function Namespace TypeFunction TypeContainerNamespace // Container Namespace TypeContainer TypeRegistryNamespace // Registry Namespace TypeRdbInstance // RDB Instance TypeKapsuleCluster // Kapsule Cluster TypeInstance TypeJobDefinition // Job Definition TypeJobRun // Job Run NumberOfResourceTypes )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.