Documentation ¶
Index ¶
Constants ¶
View Source
const (
ImplicitRefPrefix = "$kusion_path."
)
Variables ¶
View Source
var ImplicitReplaceFun = func(resourceIndex map[string]*models.Resource, refPath string) (reflect.Value, status.Status) { const Sep = "." split := strings.Split(refPath, Sep) key := split[0] priorState := resourceIndex[key] if priorState == nil { msg := fmt.Sprintf("can't find state by key:%s when replacing %s", key, refPath) return reflect.Value{}, status.NewErrorStatusWithMsg(status.IllegalManifest, msg) } attributes := priorState.Attributes if attributes == nil { msg := fmt.Sprintf("attributes is nil in resource:%s", key) return reflect.Value{}, status.NewErrorStatusWithMsg(status.IllegalManifest, msg) } var valueMap interface{} valueMap = attributes if len(split) > 1 { split := split[1:] for _, k := range split { if valueMap.(map[string]interface{})[k] == nil { msg := fmt.Sprintf("can't find specified value in resource:%s by ref:%s", key, refPath) return reflect.Value{}, status.NewErrorStatusWithMsg(status.IllegalManifest, msg) } valueMap = valueMap.(map[string]interface{})[k] } } return reflect.ValueOf(valueMap), nil }
Functions ¶
func NewBaseNode ¶
Types ¶
type ExecutableNode ¶
type ResourceNode ¶
type ResourceNode struct { Action types.ActionType // contains filtered or unexported fields }
func NewResourceNode ¶
func NewResourceNode(key string, state *models.Resource, action types.ActionType) (*ResourceNode, status.Status)
func (*ResourceNode) Execute ¶
func (rn *ResourceNode) Execute(operation *opsmodels.Operation) status.Status
func (*ResourceNode) State ¶
func (rn *ResourceNode) State() *models.Resource
Click to show internal directories.
Click to hide internal directories.