solution

package
v0.68.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const MAX_SUBSCRIBE_TRIES = 4
View Source
const TagFileName = ".tag" // tag file in solution directory, similar to .env files; should NOT be version controlled

Variables

View Source
var ErrDeleteWalkedFile = errors.New("delete walked file")

ErrDeleteWalkedFile is a special error that can be returned by the callback to WalkFiles to cause the file to be deleted. This error will never be returned by WalkFiles.

View Source
var ErrNoEffect = errors.New("requested operation is not required as it will have no effect")
View Source
var ErrStopWalking = errors.New("stop walking")

ErrStopWalking is a special error that can be returned by the callback to WalkFiles to stop the walk. This error will never be returned by WalkFiles.

Functions

func DetermineTagEnvFile deprecated added in v0.67.0

func DetermineTagEnvFile(cmd *cobra.Command, sourceDir string) (string, string)

DetermineTagEnvFile returns the tag value and the optional env file path. Note that the --env-file flag has priority over the FSOC_SOLUTION_TAG env var and the .tag file, just like --tag. The priority is:

  1. --tag value or --stable flag
  2. env file if specified explicitly with the --env-file flag
  3. FSOC_SOLUTION_TAG env var
  4. .tag file in the solution directory
  5. env.json file in the solution directory (implied name)

Deprecated: This code duplicates the logic of getEmbeddedTag() to allow support for env files. The function, along with the entire source file, will be removed once the pseudo-isolation support is removed. This function is exported for use by `melt model` when modeling data from pseudo-isolated solutions.

func DownloadSolutionPackage added in v0.68.0

func DownloadSolutionPackage(name string, tag string, targetPath string) (string, error)

DownloadSolutionPackage downloads the solution package into the specified target path targetPath may be one of the following: - the empty string: download to a temporary file - a directory: download to a file in that directory - a file: download to that file The function returns the path to the downloaded file and error.

func ExtractZipToDirectory added in v0.68.0

func ExtractZipToDirectory(archive string, targetFs afero.Fs) error

func Fetch

func Fetch(path string, httpOptions *api.Options) map[string]interface{}

func GetPseudoIsolationTag added in v0.67.0

func GetPseudoIsolationTag(envVars interface{}) string

func GetSolutionForkCommand

func GetSolutionForkCommand() *cobra.Command

func IsValidSolutionName added in v0.68.0

func IsValidSolutionName(name string) bool

IsValidSolutionName checks if the solution name is valid

func IsValidSolutionTag added in v0.67.0

func IsValidSolutionTag(tag string) bool

IsValidTag checks if a tag is valid for use in solution isolation. A valid tag is a non-empty string that starts with an ASCII letter and contains only lowercase ASCII letters and digits, for a max of 10 characters. TODO: add link to documentation on tags

func LoadEnvVars added in v0.45.0

func LoadEnvVars(cmd *cobra.Command, tag, envVarsFile string) (interface{}, error)

func NewSubCmd

func NewSubCmd() *cobra.Command

func ReplaceStringInFile added in v0.45.0

func ReplaceStringInFile(fileSystem afero.Fs, filePath string, searchValue string, replaceValue string) error

func UnzipToAferoFs added in v0.68.0

func UnzipToAferoFs(zipFile string, targetFs afero.Fs, skipLevels int) error

UnzipToAferoFs extracts files from a zip file to an afero file system. skipLevels specifies how many directories from the top level should be skipped over when constructing the target path (similar to the -p flag of the patch command). Note that there should be no files in the skipped levels; otherwise, this function will return an error.

func WithSolutionInstallVersion added in v0.62.0

func WithSolutionInstallVersion(version string) uploadOption

func WithSolutionName added in v0.62.0

func WithSolutionName(name string) uploadOption

func WithSolutionZipPath added in v0.62.0

func WithSolutionZipPath(path string) uploadOption

Types

type ComponentDef

type ComponentDef struct {
	Type        string `json:"type,omitempty" yaml:"type,omitempty"`
	ObjectsFile string `json:"objectsFile,omitempty" yaml:"objectsFile,omitempty"`
	ObjectsDir  string `json:"objectsDir,omitempty" yaml:"objectsDir,omitempty"`
}

type DashuiCartesian added in v0.38.0

type DashuiCartesian struct {
	*DashuiWidget `json:",inline" yaml:",inline"`
	Children      []*DashuiCartesianSeries `json:"children" yaml:"children"`
}

func NewDashuiCartesian added in v0.38.0

func NewDashuiCartesian() *DashuiCartesian

type DashuiCartesianAxis added in v0.38.0

type DashuiCartesianAxis struct {
	Field string `json:"type" yaml:"type"`
}

type DashuiCartesianMetric added in v0.38.0

type DashuiCartesianMetric struct {
	Name   string               `json:"name" yaml:"name"`
	Source string               `json:"source" yaml:"source"`
	Y      *DashuiCartesianAxis `json:"y" yaml:"y"`
}

type DashuiCartesianSeries added in v0.38.0

type DashuiCartesianSeries struct {
	Props  interface{}            `json:"props" yaml:"props"`
	Metric *DashuiCartesianMetric `json:"metric" yaml:"metric"`
	Type   string                 `json:"type" yaml:"type"`
}

func NewDashuiCartesianSeries added in v0.38.0

func NewDashuiCartesianSeries(seriesName string, metricName string, metricSource string, seriesType string) *DashuiCartesianSeries

type DashuiClickable added in v0.38.0

type DashuiClickable struct {
	*DashuiWidget `json:",inline" yaml:",inline"`
	OnClick       *DashuiEvent `json:"onClick,omitempty" yaml:"onClick,omitempty"`
	Trigger       *DashuiLabel `json:"trigger,omitempty" yaml:"trigger,omitempty"`
}

func NewDashuiClickable added in v0.38.0

func NewDashuiClickable() *DashuiClickable

type DashuiEcpHomeEntity added in v0.38.0

type DashuiEcpHomeEntity struct {
	Index           int    `json:"index" yaml:"index"`
	Section         string `json:"section" yaml:"section"`
	EntityAttribute string `json:"entityAttribute" yaml:"entityAttribute"`
	TargetType      string `json:"targetType" yaml:"targetType"`
}

type DashuiEcpHomeSection added in v0.38.0

type DashuiEcpHomeSection struct {
	Index int    `json:"index" yaml:"index"`
	Name  string `json:"name" yaml:"name"`
	Title string `json:"title" yaml:"title"`
}

type DashuiEvent added in v0.38.0

type DashuiEvent struct {
	Type       string   `json:"type" yaml:"type"`
	Paths      []string `json:"paths,omitempty" yaml:"paths,omitempty"`
	Expression string   `json:"expression" yaml:"expression"`
}

type DashuiFocusedEntity added in v0.38.0

type DashuiFocusedEntity struct {
	*DashuiWidget `json:",inline" yaml:",inline"`
	Mode          string `json:"mode" yaml:"mode"`
}

type DashuiGrid added in v0.38.0

type DashuiGrid struct {
	*DashuiWidget    `json:",inline" yaml:",inline"`
	RowSets          interface{}         `json:"rowSets" yaml:"rowSets"`
	Style            interface{}         `json:"style,omitempty" yaml:"style,omitempty"`
	Mode             string              `json:"mode" yaml:"mode"`
	Columns          []*DashuiGridColumn `json:"columns" yaml:"columns"`
	OnRowSingleClick *DashuiEvent        `json:"onRowSingleClick,omitempty" yaml:"onRowSingleClick,omitempty"`
	OnRowDoubleClick *DashuiEvent        `json:"onRowDoubleClick,omitempty" yaml:"onRowDoubleClick,omitempty"`
}

func NewDashuiGrid added in v0.38.0

func NewDashuiGrid() *DashuiGrid

type DashuiGridCell added in v0.38.0

type DashuiGridCell struct {
	Default interface{} `json:"default,omitempty" yaml:"default,omitempty"`
}

func NewClickableDashuiGridCell added in v0.38.0

func NewClickableDashuiGridCell(attribute string) *DashuiGridCell

func NewDashuiGridCell added in v0.38.0

func NewDashuiGridCell(attribute string) *DashuiGridCell

type DashuiGridColumn added in v0.38.0

type DashuiGridColumn struct {
	Label string          `json:"label" yaml:"label"`
	Flex  int             `json:"flex" yaml:"flex"`
	Width int             `json:"width" yaml:"width"`
	Cell  *DashuiGridCell `json:"cell" yaml:"cell"`
}

type DashuiHtmlWidget added in v0.38.0

type DashuiHtmlWidget struct {
	*DashuiWidget `json:",inline" yaml:",inline"`
	Style         interface{} `json:"style,omitempty" yaml:"style,omitempty"`
}

func NewDashuiHtmlWidget added in v0.38.0

func NewDashuiHtmlWidget() *DashuiHtmlWidget

type DashuiLabel added in v0.38.0

type DashuiLabel struct {
	InstanceOf interface{} `json:"instanceOf" yaml:"instanceOf"`
	Path       interface{} `json:"path" yaml:"path"`
}

type DashuiLogsWidget added in v0.38.0

type DashuiLogsWidget struct {
	InstanceOf interface{} `json:"instanceOf" yaml:"instanceOf"`
	Source     string      `json:"source" yaml:"source"`
}

func NewDashuiLogsWidget added in v0.38.0

func NewDashuiLogsWidget() *DashuiLogsWidget

type DashuiOcpSingle added in v0.38.0

type DashuiOcpSingle struct {
	*DashuiWidget `json:",inline" yaml:",inline"`
	NameAttribute string `json:"nameAttribute" yaml:"nameAttribute"`
}

func NewDashuiOcpSingle added in v0.38.0

func NewDashuiOcpSingle(nameAttribute string) *DashuiOcpSingle

type DashuiProperties added in v0.38.0

type DashuiProperties struct {
	InstanceOf interface{}       `json:"instanceOf" yaml:"instanceOf"`
	Elements   []*DashuiProperty `json:"elements" yaml:"elements"`
}

func NewDashuiProperties added in v0.38.0

func NewDashuiProperties() *DashuiProperties

type DashuiProperty added in v0.38.0

type DashuiProperty struct {
	Label *DashuiString `json:"label" yaml:"label"`
	Value *DashuiLabel  `json:"value" yaml:"value"`
}

type DashuiString added in v0.38.0

type DashuiString struct {
	Content    string `json:"content" yaml:"content"`
	InstanceOf string `json:"instanceOf" yaml:"instanceOf"`
}

type DashuiTemplate added in v0.38.0

type DashuiTemplate struct {
	Kind    string      `json:"kind" yaml:"kind"`
	Name    string      `json:"name" yaml:"name"`
	Target  string      `json:"target" yaml:"target"`
	View    string      `json:"view" yaml:"view"`
	Element interface{} `json:"element" yaml:"element"`
}

type DashuiTemplatePropsExtension added in v0.38.0

type DashuiTemplatePropsExtension struct {
	Kind                string      `json:"kind" yaml:"kind"`
	Id                  string      `json:"id" yaml:"id"`
	Name                string      `json:"name" yaml:"name"`
	View                string      `json:"view" yaml:"view"`
	Target              string      `json:"target" yaml:"target"`
	RequiredEntityTypes []string    `json:"requiredEntityTypes" yaml:"requiredEntityTypes"`
	Props               interface{} `json:"props" yaml:"props"`
}

func NewDashuiTemplatePropsExtension added in v0.38.0

func NewDashuiTemplatePropsExtension(id string, name string, target string, view string, requiredEntityTypes []string) *DashuiTemplatePropsExtension

type DashuiTooltip added in v0.38.0

type DashuiTooltip struct {
	*DashuiWidget `json:",inline" yaml:",inline"`
	Truncate      bool        `json:"truncate,omitempty" yaml:"truncate,omitempty"`
	Trigger       interface{} `json:"trigger,omitempty" yaml:"trigger,omitempty"`
}

func NewDashuiTooltip added in v0.38.0

func NewDashuiTooltip(attributeName string, isClickable bool) *DashuiTooltip

type DashuiWidget added in v0.38.0

type DashuiWidget struct {
	InstanceOf interface{} `json:"instanceOf" yaml:"instanceOf"`
	Props      interface{} `json:"props,omitempty" yaml:"props,omitempty"`
	Elements   interface{} `json:"elements,omitempty" yaml:"elements,omitempty"`
	Element    interface{} `json:"element,omitempty" yaml:"element,omitempty"`
}

type EcpHome added in v0.38.0

type EcpHome struct {
	Sections []*DashuiEcpHomeSection `json:"sections" yaml:"sections"`
	Entities []*DashuiEcpHomeEntity  `json:"entities" yaml:"entities"`
}

type EcpInspectorWidget added in v0.38.0

type EcpInspectorWidget struct {
	*DashuiWidget `json:",inline" yaml:",inline"`
	Title         string `json:"title" yaml:"title"`
}

func NewEcpInspectorWidget added in v0.38.0

func NewEcpInspectorWidget(title string) *EcpInspectorWidget

type EcpLeftBar added in v0.38.0

type EcpLeftBar struct {
	*DashuiWidget `json:",inline" yaml:",inline"`
	Label         string `json:"label" yaml:"label"`
}

type EcpRelationshipMapEntry added in v0.38.0

type EcpRelationshipMapEntry struct {
	Key             string `json:"key" yaml:"key"`
	Path            string `json:"path" yaml:"path"`
	EntityAttribute string `json:"entityAttribute" yaml:"entityAttribute"`
	IconName        string `json:"iconName" yaml:"iconName"`
}

type ErrorItem

type ErrorItem struct {
	Error  string `json:"error"`
	Source string `json:"source"`
}

type Errors

type Errors struct {
	Items []ErrorItem `json:"items"`
	Total int         `json:"total"`
}

type ExtensibilitySolutionObjectData added in v0.46.0

type ExtensibilitySolutionObjectData struct {
	IsSubscribed bool   `json:"isSubscribed,omitempty"`
	SolutionType string `json:"solutionType,omitempty"`
}

func (ExtensibilitySolutionObjectData) IsEmpty added in v0.46.0

type FileFormat added in v0.65.0

type FileFormat int8
const (
	FileFormatJSON FileFormat = iota
	FileFormatYAML
)

func (FileFormat) String added in v0.65.0

func (f FileFormat) String() string

type FmmAssociationDeclaration added in v0.38.0

type FmmAssociationDeclaration struct {
	*FmmTypeDef     `json:",inline" yaml:",inline"`
	ScopeFilter     string `json:"scopeFilter" yaml:"scopeFilter"`
	FromType        string `json:"fromType" yaml:"fromType"`
	ToType          string `json:"toType" yaml:"toType"`
	AssociationType string `json:"associationType" yaml:"associationType"`
}

type FmmAssociationTypesTypeDef

type FmmAssociationTypesTypeDef struct {
	Aggregates_of []string `json:"common:aggregates_of,omitempty" yaml:"common:aggregates_of,omitempty"`
	Consists_of   []string `json:"common:consists_of,omitempty" yaml:"common:consists_of,omitempty"`
	Is_a          []string `json:"common:is_a,omitempty" yaml:"common:is_a,omitempty"`
	Has           []string `json:"common:has,omitempty" yaml:"common:has,omitempty"`
	Relates_to    []string `json:"common:relates_to,omitempty" yaml:"common:relates_to,omitempty"`
	Uses          []string `json:"common:uses,omitempty" yaml:"common:uses,omitempty"`
}

type FmmAttributeDefinitionsTypeDef

type FmmAttributeDefinitionsTypeDef struct {
	Optimized  []string                        `json:"optimized" yaml:"optimized"`
	Attributes map[string]*FmmAttributeTypeDef `json:"attributes" yaml:"attributes"`
}

type FmmAttributeTypeDef

type FmmAttributeTypeDef struct {
	Type        string `json:"type" yaml:"type"`
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
}

type FmmEntity

type FmmEntity struct {
	*FmmTypeDef           `json:",inline" yaml:",inline"`
	AttributeDefinitions  *FmmRequiredAttributeDefinitionsTypeDef `json:"attributeDefinitions,omitempty" yaml:"attributeDefinitions,omitempty"`
	LifecyleConfiguration *FmmLifecycleConfigTypeDef              `json:"lifecycleConfiguration" yaml:"lifecycleConfiguration"`
	MetricTypes           []string                                `json:"metricTypes,omitempty" yaml:"metricTypes,omitempty"`
	EventTypes            []string                                `json:"eventTypes,omitempty" yaml:"eventTypes,omitempty"`
	AssociationTypes      *FmmAssociationTypesTypeDef             `json:"associationTypes,omitempty" yaml:"associationTypes,omitempty"`
}

func (*FmmEntity) GetTypeName added in v0.38.0

func (entity *FmmEntity) GetTypeName() string

type FmmEvent added in v0.28.0

type FmmEvent struct {
	*FmmTypeDef          `json:",inline" yaml:",inline"`
	AttributeDefinitions *FmmAttributeDefinitionsTypeDef `json:"attributeDefinitions" yaml:"attributeDefinitions"` // required always, do not omitempty
}

type FmmLifecycleConfigTypeDef

type FmmLifecycleConfigTypeDef struct {
	PurgeTtlInMinutes     int64 `json:"purgeTtlInMinutes" yaml:"purgeTtlInMinutes"`
	RetentionTtlInMinutes int64 `json:"retentionTtlInMinutes" yaml:"retentionTtlInMinutes"`
}

type FmmMapAndTransform

type FmmMapAndTransform struct {
	To   string `json:"to" yaml:"to"`
	From string `json:"from" yaml:"from"`
}

type FmmMetric

type FmmMetric struct {
	*FmmTypeDef            `json:",inline" yaml:",inline"`
	Category               FmmMetricCategory               `json:"category" yaml:"category"`
	ContentType            FmmMetricContentType            `json:"contentType" yaml:"contentType"`
	AggregationTemporality string                          `json:"aggregationTemporality" yaml:"aggregationTemporality"`
	IsMonotonic            bool                            `json:"isMonotonic" yaml:"isMonotonic"`
	Type                   FmmMetricType                   `json:"type" yaml:"type"`
	Unit                   string                          `json:"unit" yaml:"unit"`
	AttributeDefinitions   *FmmAttributeDefinitionsTypeDef `json:"attributeDefinitions,omitempty" yaml:"attributeDefinitions,omitempty"`
	IngestGranularities    []int                           `json:"ingestGranularities,omitempty" yaml:"ingestGranularities,omitempty"`
}

type FmmMetricCategory

type FmmMetricCategory string
const (
	Category_Sum     FmmMetricCategory = "sum"
	Category_Average FmmMetricCategory = "average"
	Category_Rate    FmmMetricCategory = "rate"
	Category_Current FmmMetricCategory = "current"
)

type FmmMetricContentType

type FmmMetricContentType string
const (
	ContentType_Sum          FmmMetricContentType = "sum"
	ContentType_Gauge        FmmMetricContentType = "gauge"
	ContentType_Distribution FmmMetricContentType = "distribution"
)

type FmmMetricType

type FmmMetricType string
const (
	Type_Long   FmmMetricType = "long"
	Type_Double FmmMetricType = "double"
)

type FmmNameMappings

type FmmNameMappings map[string]string

type FmmNamespace

type FmmNamespace struct {
	Name string `json:"name" yaml:"name"`
}

type FmmNamespaceAssignTypeDef

type FmmNamespaceAssignTypeDef struct {
	Name    string `json:"name" yaml:"name"`
	Version int    `json:"version" yaml:"version"`
}

type FmmRequiredAttributeDefinitionsTypeDef added in v0.58.1

type FmmRequiredAttributeDefinitionsTypeDef struct {
	Required                        []string `json:"required" yaml:"required"`
	*FmmAttributeDefinitionsTypeDef `json:",inline" yaml:",inline"`
}

type FmmResourceMapping

type FmmResourceMapping struct {
	*FmmTypeDef           `json:",inline" yaml:",inline"`
	EntityType            string               `json:"entityType" yaml:"entityType"`
	ScopeFilter           string               `json:"scopeFilter" yaml:"scopeFilter"`
	Mappings              []FmmMapAndTransform `json:"mappings,omitempty" yaml:"mappings,omitempty"`
	AttributeNameMappings FmmNameMappings      `json:"attributeNameMappings,omitempty" yaml:"attributeNameMappings,omitempty"`
}

type FmmTemporality

type FmmTemporality string
const (
	Temp_Delta FmmTemporality = "delta"
	Temp_False FmmTemporality = "unspecified"
)

type FmmTypeDef

type FmmTypeDef struct {
	Namespace   *FmmNamespaceAssignTypeDef `json:"namespace" yaml:"namespace"`
	Kind        string                     `json:"kind" yaml:"kind"`
	Name        string                     `json:"name" yaml:"name"`
	DisplayName string                     `json:"displayName,omitempty" yaml:"displayName,omitempty"`
}

type GetExtensibilitySolutionObjectByIdResponse added in v0.46.0

type GetExtensibilitySolutionObjectByIdResponse struct {
	Id        string                          `json:"id,omitempty"`
	LayerId   string                          `json:"layerId,omitempty"`
	LayerType string                          `json:"layerType,omitempty"`
	Data      ExtensibilitySolutionObjectData `json:"data,omitempty"`
}

type KnowledgeDef

type KnowledgeDef struct {
	Name                  string                 `json:"name,omitempty" yaml:"name,omitempty"`
	AllowedLayers         []string               `json:"allowedLayers,omitempty" yaml:"allowedLayers,omitempty"`
	IdentifyingProperties []string               `json:"identifyingProperties,omitempty" yaml:"identifyingProperties,omitempty"`
	SecureProperties      []string               `json:"secureProperties,omitempty" yaml:"secureProperties,omitempty"`
	JsonSchema            map[string]interface{} `json:"jsonSchema,omitempty" yaml:"jsonSchema,omitempty"`
}

type Manifest

type Manifest struct {
	ManifestVersion string         `json:"manifestVersion,omitempty" yaml:"manifestVersion,omitempty"`
	ManifestFormat  FileFormat     `json:"-" yaml:"-"` // not serialized, in memory
	Name            string         `json:"name,omitempty" yaml:"name,omitempty"`
	SolutionVersion string         `json:"solutionVersion,omitempty" yaml:"solutionVersion,omitempty"`
	SolutionType    string         `json:"solutionType,omitempty" yaml:"solutionType,omitempty"`
	Dependencies    []string       `json:"dependencies" yaml:"dependencies"`
	Description     string         `json:"description,omitempty" yaml:"description,omitempty"`
	Contact         string         `json:"contact,omitempty" yaml:"contact,omitempty"`
	HomePage        string         `json:"homepage,omitempty" yaml:"homepage,omitempty"`
	GitRepoUrl      string         `json:"gitRepoUrl,omitempty" yaml:"gitRepoUrl,omitempty"`
	Readme          string         `json:"readme,omitempty" yaml:"readme,omitempty"`
	Objects         []ComponentDef `json:"objects,omitempty" yaml:"objects,omitempty"`
	Types           []string       `json:"types,omitempty" yaml:"types,omitempty"`
}

func GetManifest added in v0.30.0

func GetManifest(path string) (*Manifest, error)

func (*Manifest) AppendDependency added in v0.38.0

func (manifest *Manifest) AppendDependency(solutionName string)

func (*Manifest) CheckDependencyExists added in v0.38.0

func (manifest *Manifest) CheckDependencyExists(solutionName string) bool

func (*Manifest) GetComponentDef added in v0.38.0

func (manifest *Manifest) GetComponentDef(typeName string) *ComponentDef

func (*Manifest) GetComponentDefs added in v0.38.0

func (manifest *Manifest) GetComponentDefs(typeName string) []ComponentDef

func (*Manifest) GetDashuiTemplates added in v0.38.0

func (manifest *Manifest) GetDashuiTemplates() []*DashuiTemplate

func (*Manifest) GetFmmEntities added in v0.38.0

func (manifest *Manifest) GetFmmEntities() []*FmmEntity

func (*Manifest) GetFmmEvents added in v0.38.0

func (manifest *Manifest) GetFmmEvents() []*FmmEvent

func (*Manifest) GetFmmMetrics added in v0.38.0

func (manifest *Manifest) GetFmmMetrics() []*FmmMetric

func (*Manifest) GetNamespaceName added in v0.45.0

func (manifest *Manifest) GetNamespaceName() string

func (*Manifest) GetSolutionName added in v0.45.0

func (manifest *Manifest) GetSolutionName() string

func (*Manifest) HasPseudoIsolation added in v0.67.0

func (manifest *Manifest) HasPseudoIsolation() bool

type ResponseBlob

type ResponseBlob struct {
	Items []StatusItem `json:"items"`
}

type Result

type Result struct {
	Errors Errors `json:"errors"`
	Valid  bool   `json:"valid"`
}

type ServiceDef

type ServiceDef struct {
	Name  string `json:"name,omitempty" yaml:"name,omitempty"`
	Image string `json:"image,omitempty" yaml:"image,omitempty"`
}

type Solution added in v0.28.0

type Solution struct {
	ID             string `json:"id" yaml:"id"`
	LayerID        string `json:"layerId" yaml:"layerId"`
	LayerType      string `json:"layerType" yaml:"layerType"`
	ObjectMimeType string `json:"objectMimeType" yaml:"objectMimeType"`
	TargetObjectId string `json:"targetObjectId" yaml:"targetObjectId"`
	CreatedAt      string `json:"createdAt" yaml:"createdAt"`
	UpdatedAt      string `json:"updatedAt" yaml:"updatedAt"`
	DisplayName    string `json:"displayName" yaml:"displayName"`
}

type SolutionDef

type SolutionDef struct {
	Dependencies []string `json:"dependencies,omitempty" yaml:"dependencies,omitempty"`
	IsSubscribed bool     `json:"isSubscribed,omitempty" yaml:"isSubscribed,omitempty"`
	IsSystem     bool     `json:"isSystem,omitempty" yaml:"isSystem,omitempty"`
	Name         string   `json:"name,omitempty" yaml:"name,omitempty"`
}

type SolutionDeletionData added in v0.67.0

type SolutionDeletionData struct {
	DeleteTime    string `json:"deleteTime,omitempty"`
	DeleteMessage string `json:"deleteMessage,omitempty"`
	SolutionName  string `json:"solutionName,omitempty"`
	Tag           string `json:"tag,omitempty"`
	Status        string `json:"status,omitempty"`
}

func (SolutionDeletionData) IsEmpty added in v0.67.0

func (s SolutionDeletionData) IsEmpty() bool

type SolutionDeletionRecord added in v0.67.0

type SolutionDeletionRecord struct {
	DeletionData SolutionDeletionData `json:"data,omitempty"`
	ID           string               `json:"id,omitempty"`
}

func (SolutionDeletionRecord) IsEmpty added in v0.67.0

func (s SolutionDeletionRecord) IsEmpty() bool

type SolutionDeletionResponseBlob added in v0.67.0

type SolutionDeletionResponseBlob struct {
	Items []SolutionDeletionRecord `json:"items"`
}

type SolutionDirectoryContents added in v0.68.0

type SolutionDirectoryContents struct {
	Manifest    Manifest
	Directories []SolutionSubDirectory
	RootFiles   []SolutionFile // any files in the root dir except the manifest
}

func NewSolutionDirectoryContents added in v0.68.0

func NewSolutionDirectoryContents(name string, solutionType SolutionType) (*SolutionDirectoryContents, error)

NewSolutionDirectoryContents creates a new SolutionDirectoryContents object with a simple manifest

func NewSolutionDirectoryContentsFromDisk added in v0.68.0

func NewSolutionDirectoryContentsFromDisk(path string) (*SolutionDirectoryContents, error)

Read reads the full contents of the solution directory from the specified root

func (*SolutionDirectoryContents) Dump added in v0.68.0

func (s *SolutionDirectoryContents) Dump(cmd *cobra.Command)

Dump displays the contents of the solution contents object

func (*SolutionDirectoryContents) GetSolutionDirectory added in v0.68.0

func (s *SolutionDirectoryContents) GetSolutionDirectory(name string) *SolutionSubDirectory

GetSolutionDirectory returns a pointer to the solution directory with the specified name, or nil if not found

func (*SolutionDirectoryContents) GetSolutionFile added in v0.68.0

func (s *SolutionDirectoryContents) GetSolutionFile(name string) *SolutionFile

GetSolutionFile returns a pointer to the solution file with the specified name, or nil if not found

func (*SolutionDirectoryContents) SetComponentDefType added in v0.68.0

func (s *SolutionDirectoryContents) SetComponentDefType(obj *ComponentDef, objType string)

SetComponentDefType sets the component definition type for the specified object, updatinig the directory & file types as needed. It returns the number of replacements made.

func (*SolutionDirectoryContents) WalkFiles added in v0.68.0

func (s *SolutionDirectoryContents) WalkFiles(callback func(*SolutionFile, *SolutionSubDirectory) error) error

WalkFiles goes through each file, including root files and provides a callback to process each file. Each file is passed by reference, allowing the callback to modify the file contents. The subdirectory is passed by reference as well, but the callback should not modify it; it will be nil for the root files. The callback can return an error to stop the walk. It can also return the special error ErrDeleteWalkedFile to delete the file from the solution. TODO: when deleting a file, the file should be removed from the manifest, if referenced

func (*SolutionDirectoryContents) Write added in v0.68.0

func (s *SolutionDirectoryContents) Write(fs afero.Fs) error

Write writes the full contents of the solution directory to the specified filesystem. Using Afero's filesystem abstraction allows for safe writing (as well as testing). The directory must be empty, otherwise an error is returned.

type SolutionDirectoryContentsType added in v0.68.0

type SolutionDirectoryContentsType string
const (
	KnowledgeTypes SolutionDirectoryContentsType = "types"
	ObjectsDir     SolutionDirectoryContentsType = "objectsDir"
	ObjectsFile    SolutionDirectoryContentsType = "objectsFile"
)

type SolutionFile added in v0.68.0

type SolutionFile struct {
	Name       string // file name relative to the directory
	FileKind   SolutionFileKinds
	ObjectType string // empty if not known or not KindObjectType
	Encoding   SolutionFileEncoding
	Contents   bytes.Buffer
}

func (SolutionFile) String added in v0.68.0

func (s SolutionFile) String() string

type SolutionFileEncoding added in v0.68.0

type SolutionFileEncoding string
const (
	EncodingUnknown SolutionFileEncoding = ""
	EncodingJSON    SolutionFileEncoding = "json"
	EncodingYAML    SolutionFileEncoding = "yaml"
)

type SolutionFileKinds added in v0.68.0

type SolutionFileKinds string
const (
	KindUnknown       SolutionFileKinds = ""
	KindKnowledgeType SolutionFileKinds = "knowledge type"
	KindObjectType    SolutionFileKinds = "object"
	KindHidden        SolutionFileKinds = "hidden"
)

type SolutionManifestOption added in v0.62.0

type SolutionManifestOption func(*solutionManifestOptions)

func WithManifestVersion added in v0.62.0

func WithManifestVersion(version string) SolutionManifestOption

func WithSolutionType added in v0.62.0

func WithSolutionType(solutionType string) SolutionManifestOption

func WithSolutionVersion added in v0.62.0

func WithSolutionVersion(version string) SolutionManifestOption

type SolutionSubDirectory added in v0.68.0

type SolutionSubDirectory struct {
	Name        string // full name relative to the solution root
	Type        SolutionDirectoryContentsType
	ObjectsType string // used only for ObjecsDir directory types
	Files       []SolutionFile
}

func (SolutionSubDirectory) String added in v0.68.0

func (s SolutionSubDirectory) String() string

type SolutionTestAssertion added in v0.38.0

type SolutionTestAssertion struct {
	UQL        string                           `json:"uql"`
	Transforms []SolutionTestAssertionTransform `json:"transforms"`
}

type SolutionTestAssertionTransform added in v0.38.0

type SolutionTestAssertionTransform struct {
	Type       string `json:"type"`
	Expression string `json:"expression,omitempty"`
	Message    string `json:"message,omitempty"`
	Location   string `json:"location,omitempty"`
}

type SolutionTestObject added in v0.38.0

type SolutionTestObject struct {
	Name        string                  `json:"name,omitempty"`
	Type        string                  `json:"type,omitempty"`
	Description string                  `json:"description,omitempty"`
	Setup       SolutionTestSetup       `json:"setup"`
	Assertions  []SolutionTestAssertion `json:"assertions"`
}

type SolutionTestObjects added in v0.38.0

type SolutionTestObjects struct {
	Tests         []SolutionTestObject `json:"tests"`
	InitialDelay  int                  `json:"initialDelay,omitempty"`
	MaxRetryCount int                  `json:"retryCount,omitempty"`
	RetryDelay    int                  `json:"retryDelay,omitempty"`
}

type SolutionTestResult added in v0.38.0

type SolutionTestResult struct {
	ID string `json:"testRunId"`
}

type SolutionTestSetup added in v0.38.0

type SolutionTestSetup struct {
	Type     string      `json:"type"`
	Input    interface{} `json:"input,omitempty"`
	Location string      `json:"location,omitempty"`
}

type SolutionTestStatusResult added in v0.38.0

type SolutionTestStatusResult struct {
	Complete       bool            `json:"completed"`
	Status         string          `json:"status"`
	StatusMessages []StatusMessage `json:"statusMessages"`
}

type SolutionType added in v0.68.0

type SolutionType string
const (
	ComponentSolutionType SolutionType = "component"
	ModuleSolutionType    SolutionType = "module"
	AppSolutionType       SolutionType = "app"
)

type StatusData

type StatusData struct {
	InstallTime       string `json:"installTime,omitempty"`
	InstallMessage    string `json:"installMessage,omitempty"`
	SuccessfulInstall bool   `json:"isSuccessful,omitempty"`
	SolutionName      string `json:"solutionName,omitempty"`
	SolutionVersion   string `json:"solutionVersion,omitempty"`
}

func (StatusData) IsEmpty added in v0.62.0

func (s StatusData) IsEmpty() bool

type StatusItem

type StatusItem struct {
	StatusData StatusData `json:"data"`
	CreatedAt  string     `json:"createdAt"`
}

type StatusMessage added in v0.38.0

type StatusMessage struct {
	Timestamp string   `json:"timestamp"`
	Message   string   `json:"message,omitempty"`
	Statuses  []string `json:"statuses,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL