github.com/kubevela/workflow@v0.6.0/pkg/context/interface.go (about)

     1  /*
     2  Copyright 2022 The KubeVela Authors.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  package context
    18  
    19  import (
    20  	corev1 "k8s.io/api/core/v1"
    21  
    22  	"github.com/kubevela/workflow/pkg/cue/model/value"
    23  )
    24  
    25  // Context is workflow context interface
    26  type Context interface {
    27  	GetVar(paths ...string) (*value.Value, error)
    28  	SetVar(v *value.Value, paths ...string) error
    29  	GetStore() *corev1.ConfigMap
    30  	GetMutableValue(path ...string) string
    31  	SetMutableValue(data string, path ...string)
    32  	DeleteMutableValue(paths ...string)
    33  	IncreaseCountValueInMemory(paths ...string) int
    34  	SetValueInMemory(data interface{}, paths ...string)
    35  	GetValueInMemory(paths ...string) (interface{}, bool)
    36  	DeleteValueInMemory(paths ...string)
    37  	Commit() error
    38  	MakeParameter(parameter string) (*value.Value, error)
    39  	StoreRef() *corev1.ObjectReference
    40  }