semantics

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package semantics derives a note for an operation and applies a file overlay.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequireKnown added in v0.1.9

func RequireKnown(n Notes, cat *catalog.Catalog) error

RequireKnown fails when a semantics file names an operation the catalog does not have.

Types

type Derived

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

func New added in v0.1.2

func New(cat *catalog.Catalog) *Derived

func (*Derived) AllSynonyms

func (d *Derived) AllSynonyms() map[string][]string

func (*Derived) Note

func (d *Derived) Note(operationID string) Note

func (*Derived) Synonyms

func (d *Derived) Synonyms(operationID string) []string

type FileOverlay

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

func ParseOverlay

func ParseOverlay(data []byte, base Notes) (*FileOverlay, error)

func (*FileOverlay) AllSynonyms

func (f *FileOverlay) AllSynonyms() map[string][]string

func (*FileOverlay) Note

func (f *FileOverlay) Note(operationID string) Note

func (*FileOverlay) Synonyms

func (f *FileOverlay) Synonyms(operationID string) []string

type Note

type Note struct {
	OperationID string
	Sentence    string
	Synonyms    []string
	Relation    string // from a declared edge, such as "Order.customerId identifies customers.get"
}

func (Note) Text

func (n Note) Text() string

type Notes added in v0.1.6

type Notes interface {
	Note(operationID string) Note
	AllSynonyms() map[string][]string
}

Notes is a note and the synonym map search uses.

type OverlayEntry

type OverlayEntry struct {
	OperationID string   `yaml:"operation"`
	Sentence    string   `yaml:"sentence"`
	Synonyms    []string `yaml:"synonyms"`
}

Jump to

Keyboard shortcuts

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