Documentation
¶
Index ¶
Constants ¶
View Source
const ( StatusUnspecified = "STATUS_UNSPECIFIED" // unknown StatusPending = "STATUS_PENDING" // intermediate StatusError = "STATUS_ERROR" // terminal StatusDeleted = "STATUS_DELETED" // terminal StatusCompleted = "STATUS_COMPLETED" // terminal )
Variables ¶
This section is empty.
Functions ¶
func GenerateURN ¶
GenerateURN generates an Entropy URN address for the given combination. Note: Changing this will invalidate all existing resource identifiers.
Types ¶
type Filter ¶
type MutationHook ¶
MutationHook values are passed to mutation operations of resource storage to handle any transactional requirements.
type PagedResource ¶ added in v0.1.22
type PendingHandler ¶
type Resource ¶
type Resource struct {
URN string `json:"urn"`
Kind string `json:"kind"`
Name string `json:"name"`
Project string `json:"project"`
Labels map[string]string `json:"labels"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
UpdatedBy string `json:"updated_by"`
CreatedBy string `json:"created_by"`
Spec Spec `json:"spec"`
State State `json:"state"`
}
type RevisionsSelector ¶
type RevisionsSelector struct {
URN string `json:"urn"`
}
type Spec ¶
type Spec struct {
Configs json.RawMessage `json:"configs"`
Dependencies map[string]string `json:"dependencies"`
}
type State ¶
type State struct {
Status string `json:"status"`
Output json.RawMessage `json:"output"`
ModuleData json.RawMessage `json:"module_data,omitempty"`
NextSyncAt *time.Time `json:"next_sync_at,omitempty"`
SyncResult SyncResult `json:"sync_result"`
}
func (State) InDeletion ¶
InDeletion returns true if the state represents a resource that is scheduled for deletion.
func (State) IsTerminal ¶
IsTerminal returns true if state is terminal. A terminal state is one where resource needs no further sync.
type Store ¶
type Store interface {
GetByURN(ctx context.Context, urn string) (*Resource, error)
List(ctx context.Context, filter Filter, withSpecConfigs bool) ([]Resource, error)
Create(ctx context.Context, r Resource, hooks ...MutationHook) error
Update(ctx context.Context, r Resource, saveRevision bool, reason string, hooks ...MutationHook) error
Delete(ctx context.Context, urn string, hooks ...MutationHook) error
Revisions(ctx context.Context, selector RevisionsSelector) ([]Revision, error)
SyncOne(ctx context.Context, scope map[string][]string, syncFn SyncFn) error
}
type SyncResult ¶
Click to show internal directories.
Click to hide internal directories.