Documentation ¶
Index ¶
- Variables
- func GetAppContextFromId(ctx context.Context, ctxid string) (appcontext.AppContext, error)
- func GetAppContextStatus(ctx context.Context, ctxid string) (appcontext.AppContextStatus, error)
- func GetContextIdForStatusContextId(s StateInfo, ctxid string) (string, error)
- func GetContextIdsFromStateInfo(s StateInfo) []string
- func GetLastContextIdFromStateInfo(s StateInfo) string
- func GetLatestRevisionFromStateInfo(s StateInfo) (int64, error)
- func GetMatchingContextIDforRevision(s StateInfo, r int64) (string, error)
- func GetStatusContextIdForContextId(s StateInfo, ctxid string) (string, error)
- func GetStatusContextIdFromStateInfo(s StateInfo) string
- func UpdateAppContextStatusContextID(ctx context.Context, ctxid string, sctxid string) error
- func UpdateAppContextStopFlag(ctx context.Context, ctxid string, sf bool) error
- type ActionEntry
- type StateInfo
- type StateValue
Constants ¶
This section is empty.
Variables ¶
var StateEnum = &states{
Undefined: "Undefined",
Created: "Created",
Approved: "Approved",
Applied: "Applied",
Instantiated: "Instantiated",
Terminated: "Terminated",
InstantiateStopped: "InstantiateStopped",
TerminateStopped: "TerminateStopped",
Updated: "Updated",
}
Functions ¶
func GetAppContextFromId ¶
func GetAppContextFromId(ctx context.Context, ctxid string) (appcontext.AppContext, error)
GetAppContextFromStateInfo loads the appcontext present in the StateInfo input
func GetAppContextStatus ¶
func GetAppContextStatus(ctx context.Context, ctxid string) (appcontext.AppContextStatus, error)
func GetContextIdForStatusContextId ¶
GetContextIdForStatusContextId given a statusContextId (not checked), get the most recent ContextId - i.e. either end of the list or up to "Terminated" Assumed that 'ctxid' has already been identified as a status contextId.
func GetContextIdsFromStateInfo ¶
GetContextIdsFromStatInfo return a list of the unique AppContext Ids in the StateInfo
func GetLastContextIdFromStateInfo ¶
GetLastContextFromStatInfo gets the last (most recent) context id from StateInfo
func GetLatestRevisionFromStateInfo ¶
GetLatestRevisionFromStateInfo returns the latest revision from StateInfo
func GetMatchingContextIDforRevision ¶
GetMatchingContextIDforRevision returns the matching contextID for a given revision and stateInfo
func GetStatusContextIdForContextId ¶
GetStatusContextIdForContextId gets the status context id associated with the input context id. This will be the context id of the most recent "Instantiated" state. If the provided 'ctxid' is not found, then that is an error
func GetStatusContextIdFromStateInfo ¶
GetStatusContextIdFromStateInfo gets status AppContext
func UpdateAppContextStatusContextID ¶
UpdateAppContextStatusContextID updates status context id in the AppContext
Types ¶
type ActionEntry ¶
type ActionEntry struct { State StateValue `json:"state"` ContextId string `json:"instance"` TimeStamp time.Time `json:"time"` Revision int64 `json:"revision"` }
ActionEntry is used to keep track of the time an action (e.g. Created, Instantiate, Terminate) was invoked For actions where an AppContext is relevent, the ContextId field will be non-zero length
type StateInfo ¶
type StateInfo struct { // Same Status AppContext between instantiation and termination for a DIG StatusContextId string `json:"statusctxid"` Actions []ActionEntry `json:"actions"` }
StateInfo struct is used to maintain the values for state, contextid, (and other) information about resources which can be instantiated via rsync. The last Actions entry holds the current state of the container object.
type StateValue ¶
type StateValue = string
func GetCurrentStateFromStateInfo ¶
func GetCurrentStateFromStateInfo(s StateInfo) (StateValue, error)
GetCurrentStateFromStatInfo gets the last (current) state from StateInfo