Documentation ¶
Index ¶
- Constants
- Variables
- func GetGlobalStateKV(p *cptype.ComponentProtocol, key string) interface{}
- func MustRegisterComponent(r *CompRenderSpec)
- func MustRegisterProtocolsFromFS(rootFS embed.FS)
- func RegisterComponent(r *CompRenderSpec) error
- func RegisterDefaultProtocols(protocolYAMLs ...[]byte)
- func RegisterDefaultProtocolsFromBasePath(basePath string)
- func RunScenarioRender(ctx context.Context, req *cptype.ComponentProtocolRequest) error
- type CompRender
- type CompRenderSpec
- type ComponentCreator
- type FRAMEWORK
- type Node
- type RenderCreator
- type ScenarioRender
Constants ¶
View Source
const I18n = "i18n"
I18n ${{ i18n.button }} i18n prefix
Variables ¶
View Source
var CpPlaceHolderRe = regexp.MustCompile(`\${{[ ]{1}([^{}\s]+)[ ]{1}}}`)
CpPlaceHolderRe ${{ configs.key }} only one space
View Source
var ScenarioRenders = make(map[string]*ScenarioRender)
ScenarioRenders contains all scenario renders.
Functions ¶
func GetGlobalStateKV ¶
func GetGlobalStateKV(p *cptype.ComponentProtocol, key string) interface{}
GetGlobalStateKV .
func MustRegisterProtocolsFromFS ¶
MustRegisterProtocolsFromFS registry protocols from embed fs.
func RegisterComponent ¶
func RegisterComponent(r *CompRenderSpec) error
RegisterComponent register a component under scenario
func RegisterDefaultProtocols ¶
func RegisterDefaultProtocols(protocolYAMLs ...[]byte)
RegisterDefaultProtocols register protocol contents.
func RegisterDefaultProtocolsFromBasePath ¶
func RegisterDefaultProtocolsFromBasePath(basePath string)
RegisterDefaultProtocolsFromBasePath register default component protocols under base path. default path: libs/erda-configs/permission
func RunScenarioRender ¶
func RunScenarioRender(ctx context.Context, req *cptype.ComponentProtocolRequest) error
RunScenarioRender .
Types ¶
type CompRender ¶
type CompRender interface {
Render(ctx context.Context, c *cptype.Component, scenario cptype.Scenario, event cptype.ComponentEvent, gs *cptype.GlobalStateData) error
}
CompRender .
type CompRenderSpec ¶
type CompRenderSpec struct { // Scenario key Scenario string `json:"scenario"` // CompName is component name CompName string `json:"name"` // RenderC used to created component RenderC RenderCreator // Creator used to create component instance Creator ComponentCreator }
CompRenderSpec .
type Node ¶
type Node struct { Name string Parallel bool NextNodes []*Node PreviousNode *Node BindingStates []cptype.RendingState // contains filtered or unexported fields }
Node used for parallel rendering.
type ScenarioRender ¶
type ScenarioRender map[string]*CompRenderSpec
ScenarioRender is a group of component renders. key: componentName value: componentRender
Source Files ¶
Click to show internal directories.
Click to hide internal directories.