cti

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Cti           = "cti.cti"
	Final         = "cti.final"
	ID            = "cti.id"
	L10n          = "cti.l10n"
	DisplayName   = "cti.display_name"
	Description   = "cti.description"
	Asset         = "cti.asset"
	Overridable   = "cti.overridable"
	Reference     = "cti.reference"
	Schema        = "cti.schema"
	Meta          = "cti.meta"
	PropertyNames = "cti.propertyNames"
)
View Source
const (
	Traits = "cti-traits"
)

Variables

This section is empty.

Functions

func GetBaseCti

func GetBaseCti(cti string) string

func GetParentCti

func GetParentCti(cti string) string

Types

type AnnotationType

type AnnotationType struct {
	Name string `json:"name,omitempty"`
	Type string `json:"type,omitempty"`

	// Reference is a reference to the annotation type that was used to define the instance.
	Reference string `json:"reference,omitempty"`
}

type Annotations

type Annotations struct {
	Cti           interface{}            `json:"cti.cti,omitempty"` // string or []string
	ID            *bool                  `json:"cti.id,omitempty"`  // string or []string
	DisplayName   *bool                  `json:"cti.display_name,omitempty"`
	Description   *bool                  `json:"cti.description,omitempty"`
	Reference     interface{}            `json:"cti.reference,omitempty"` // bool or string or []string
	Overridable   *bool                  `json:"cti.overridable,omitempty"`
	Final         *bool                  `json:"cti.final,omitempty"`
	Asset         *bool                  `json:"cti.asset,omitempty"`
	L10N          *bool                  `json:"cti.l10n,omitempty"`
	Schema        interface{}            `json:"cti.schema,omitempty"` // string or []string
	Meta          string                 `json:"cti.meta,omitempty"`
	PropertyNames map[string]interface{} `json:"cti.propertyNames,omitempty"`
}

func (Annotations) ReadCti

func (a Annotations) ReadCti() []string

func (Annotations) ReadReference

func (a Annotations) ReadReference() string

type Entities

type Entities []*Entity

type EntitiesMap

type EntitiesMap map[string]*Entity

type Entity

type Entity struct {
	Final             bool                      `json:"final"`
	Cti               string                    `json:"cti"`
	DisplayName       string                    `json:"display_name,omitempty"`
	Description       string                    `json:"description,omitempty"`
	Dictionaries      map[string]interface{}    `json:"dictionaries,omitempty"` // Deprecated
	Values            json.RawMessage           `json:"values,omitempty"`
	Schema            json.RawMessage           `json:"schema,omitempty"`
	TraitsSchema      json.RawMessage           `json:"traits_schema,omitempty"`
	TraitsAnnotations map[GJsonPath]Annotations `json:"traits_annotations,omitempty"`
	Traits            json.RawMessage           `json:"traits,omitempty"`
	Annotations       map[GJsonPath]Annotations `json:"annotations,omitempty"`
	SourceMap         SourceMap                 `json:"source_map,omitempty"`
}

type EntityStructured

type EntityStructured struct {
	Final             bool                      `json:"final"`
	Cti               string                    `json:"cti"`
	DisplayName       string                    `json:"display_name,omitempty"`
	Description       string                    `json:"description,omitempty"`
	Dictionaries      map[string]interface{}    `json:"dictionaries,omitempty"` // Deprecated
	Values            map[string]interface{}    `json:"values,omitempty"`
	Schema            *raml.JSONSchema          `json:"schema,omitempty"`
	TraitsSchema      *raml.JSONSchema          `json:"traits_schema,omitempty"`
	TraitsAnnotations map[GJsonPath]Annotations `json:"traits_annotations,omitempty"`
	Traits            map[string]interface{}    `json:"traits,omitempty"`
	Annotations       map[GJsonPath]Annotations `json:"annotations,omitempty"`
	SourceMap         SourceMap                 `json:"source_map,omitempty"`
}

TODO: This is a temporary structure until proper model is outlined. Used by tests.

type GJsonPath

type GJsonPath string

func (GJsonPath) GetValue

func (k GJsonPath) GetValue(obj []byte) gjson.Result

func (GJsonPath) String

func (k GJsonPath) String() string

type InstanceAnnotationReference

type InstanceAnnotationReference struct {
	AnnotationType *AnnotationType `json:"$annotationType,omitempty"`
}

type SourceMap

type SourceMap struct {
	TypeAnnotationReference
	InstanceAnnotationReference

	// SourcePath is a relative path to the RAML file where the CTI parent is defined.
	SourcePath string `json:"$sourcePath,omitempty"`

	// OriginalPath is a relative path to RAML fragment where the CTI entity is defined.
	OriginalPath string `json:"$originalPath,omitempty"`
}

func (*SourceMap) HasOriginalPath

func (a *SourceMap) HasOriginalPath() bool

func (*SourceMap) ToBytes

func (a *SourceMap) ToBytes() []byte

type TypeAnnotationReference

type TypeAnnotationReference struct {
	Name string `json:"$name,omitempty"`
}

Jump to

Keyboard shortcuts

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