Documentation ¶
Overview ¶
Copyright 2022 Napptive
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- type AppPolicy
- type Application
- func (a *Application) ApplyParameters(applicationName string, newName string, newAppSpec string) error
- func (a *Application) GetConfigurations() (map[string]*InstanceConf, error)
- func (a *Application) GetNames() map[string]string
- func (a *Application) GetParameters() (map[string]string, error)
- func (a *Application) ToYAML() ([][]byte, [][]byte, error)
- type ApplicationDefinition
- type ApplicationFile
- type ApplicationSpec
- type ComponentsNode
- type ComponentsYAML
- type EntityType
- type InstanceConf
- type Metadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppPolicy ¶
type AppPolicy struct { // Name of the policy Name string `json:"name"` // Type of the policy Type string `json:"type"` // Properties of the policy Properties *runtime.RawExtension `json:"properties,omitempty"` }
AppPolicy with the application policy
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
Application with a catalog application
func NewApplication ¶
func NewApplication(files []*ApplicationFile) (*Application, error)
NewApplication converts an oam application from an array of yaml files into an Application
func NewApplicationFromTGZ ¶
func NewApplicationFromTGZ(rawApplication []byte) (*Application, error)
NewApplicationFromTGZ receives a tgz file and returns convert the content into an application
func (*Application) ApplyParameters ¶
func (a *Application) ApplyParameters(applicationName string, newName string, newAppSpec string) error
ApplyParameters overwrite the application name and the components spec in application named `applicationName`
func (*Application) GetConfigurations ¶
func (a *Application) GetConfigurations() (map[string]*InstanceConf, error)
GetConfigurations return the name and the componentSpec by application
func (*Application) GetNames ¶
func (a *Application) GetNames() map[string]string
GetNames returns the application name
func (*Application) GetParameters ¶
func (a *Application) GetParameters() (map[string]string, error)
GetParameters returns the components spec of an application indexed by application name
type ApplicationDefinition ¶
type ApplicationDefinition struct { // ApiVersion ApiVersion string `json:"apiVersion"` // Kind Kind string `json:"kind"` // Metadata Metadata Metadata `json:"metadata"` // Spec Spec ApplicationSpec `json:"spec"` }
ApplicationDefinition with the definition of an OAM application
type ApplicationFile ¶
ApplicationFile with a struct that relates the name of a file to its content
type ApplicationSpec ¶
type ApplicationSpec struct { // Components of the applcication Components *runtime.RawExtension `json:"components"` // Policies of the application Policies []AppPolicy `json:"policies,omitempty"` // Workflow with the workflowsteps of the application Workflow *runtime.RawExtension `json:"workflow,omitempty"` }
ApplicationSpec with the application specification
type ComponentsNode ¶
type ComponentsNode struct {
Spec ComponentsYAML
}
ComponentsNode with the components Spec in YAML (with comments) This struct is required to return Application parameters: components: - name: component1 ...
type ComponentsYAML ¶
ComponentsYAML with the components in YAML (the array of components)
type EntityType ¶
type EntityType uint
const ( EntityType_UNKNOWN EntityType = iota EntityType_APP EntityType_METADATA )