collector

package
v0.36.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const MetadataPrefix = "cti."

Variables

This section is empty.

Functions

This section is empty.

Types

type AnnotationsCollector

type AnnotationsCollector struct {
	// contains filtered or unexported fields
}

func NewAnnotationsCollector

func NewAnnotationsCollector() *AnnotationsCollector

func (*AnnotationsCollector) Collect

func (c *AnnotationsCollector) Collect(s raml.Shape) map[metadata.GJsonPath]metadata.Annotations

func (*AnnotationsCollector) Visit

func (c *AnnotationsCollector) Visit(ctx string, s raml.Shape)

func (*AnnotationsCollector) VisitArrayShape

func (c *AnnotationsCollector) VisitArrayShape(ctx string, s *raml.ArrayShape) any

func (*AnnotationsCollector) VisitObjectShape

func (c *AnnotationsCollector) VisitObjectShape(ctx string, s *raml.ObjectShape) any

func (*AnnotationsCollector) VisitUnionShape

func (c *AnnotationsCollector) VisitUnionShape(ctx string, s *raml.UnionShape) any

type Collector

type Collector struct {

	// Local Registry holds entities that are declared by the package.
	LocalRegistry *MetadataRegistry

	// Global Registry holds all entities collected during the session. May include both local and external entities.
	GlobalRegistry *MetadataRegistry
	// contains filtered or unexported fields
}

func New

func New() *Collector

func (*Collector) Collect

func (c *Collector) Collect(isLocal bool) error

func (*Collector) MakeMetadataInstanceFromExtension

func (c *Collector) MakeMetadataInstanceFromExtension(id string, definedBy *raml.ArrayShape, values map[string]interface{}, valuesLocation string) *metadata.Entity

func (*Collector) MakeMetadataTypeFromShape

func (c *Collector) MakeMetadataTypeFromShape(id string, shape *raml.BaseShape) (*metadata.Entity, error)

func (*Collector) SetRaml added in v0.33.0

func (c *Collector) SetRaml(r *raml.RAML)

type MetadataRegistry

type MetadataRegistry struct {
	// TODO: Too many indexes that are not efficient on operations other than add.
	Types            metadata.EntitiesMap
	Instances        metadata.EntitiesMap
	FragmentEntities map[string]metadata.Entities
	Index            metadata.EntitiesMap
}

func NewMetadataRegistry added in v0.33.0

func NewMetadataRegistry() *MetadataRegistry

func (*MetadataRegistry) Add added in v0.33.0

func (r *MetadataRegistry) Add(originalPath string, entity *metadata.Entity) error

func (*MetadataRegistry) Clone

func (r *MetadataRegistry) Clone() *MetadataRegistry

Jump to

Keyboard shortcuts

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