asyncapi

package
v0.0.0-...-f2c7550 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Root-level fields
	AsyncAPILabel           = "asyncapi"
	IDLabel                 = "id"
	DefaultContentTypeLabel = "defaultContentType"

	// Channel fields
	AddressLabel  = "address"
	MessagesLabel = "messages"
	ChannelsLabel = "channels"

	// Operation fields
	ActionLabel     = "action"
	ChannelLabel    = "channel"
	OperationsLabel = "operations"
	TraitsLabel     = "traits"
	ReplyLabel      = "reply"

	// Message fields
	HeadersLabel       = "headers"
	PayloadLabel       = "payload"
	CorrelationIDLabel = "correlationId"
	ContentTypeLabel   = "contentType"

	// Server fields
	HostLabel            = "host"
	ProtocolLabel        = "protocol"
	ProtocolVersionLabel = "protocolVersion"
	PathnameLabel        = "pathname"
	VariablesLabel       = "variables"

	// Parameter fields
	EnumLabel     = "enum"
	DefaultLabel  = "default"
	LocationLabel = "location"

	// Multi-format schema fields
	SchemaFormatLabel = "schemaFormat"
	SchemaLabel       = "schema"

	// Security fields
	TypeLabel             = "type"
	SchemeLabel           = "scheme"
	BearerFormatLabel     = "bearerFormat"
	FlowsLabel            = "flows"
	OpenIDConnectURLLabel = "openIdConnectUrl"
	ScopesLabel           = "scopes"
	InLabel               = "in"
	AvailableScopesLabel  = "availableScopes"

	// OAuth flow labels
	ImplicitLabel          = "implicit"
	PasswordLabel          = "password"
	ClientCredentialsLabel = "clientCredentials"
	AuthorizationCodeLabel = "authorizationCode"
	AuthorizationURLLabel  = "authorizationUrl"
	TokenURLLabel          = "tokenUrl"
	RefreshURLLabel        = "refreshUrl"

	// Common fields
	TitleLabel        = "title"
	SummaryLabel      = "summary"
	DescriptionLabel  = "description"
	TagsLabel         = "tags"
	ExternalDocsLabel = "externalDocs"
	ServersLabel      = "servers"
	ParametersLabel   = "parameters"
	SecurityLabel     = "security"
	BindingsLabel     = "bindings"
	ComponentsLabel   = "components"
	InfoLabel         = "info"
	NameLabel         = "name"
	ExamplesLabel     = "examples"
	VersionLabel      = "version"

	// Binding labels
	HTTPLabel           = "http"
	KafkaLabel          = "kafka"
	WebSocketLabel      = "ws"
	AMQPLabel           = "amqp"
	MQTTLabel           = "mqtt"
	BindingVersionLabel = "bindingVersion"

	// HTTP binding fields
	QueryLabel      = "query"
	MethodLabel     = "method"
	StatusCodeLabel = "statusCode"

	// Kafka binding fields
	TopicLabel                   = "topic"
	PartitionsLabel              = "partitions"
	ReplicasLabel                = "replicas"
	TopicConfigurationLabel      = "topicConfiguration"
	SchemaRegistryURLLabel       = "schemaRegistryUrl"
	SchemaRegistryVendorLabel    = "schemaRegistryVendor"
	GroupIDLabel                 = "groupId"
	ClientIDLabel                = "clientId"
	KeyLabel                     = "key"
	SchemaIDLocationLabel        = "schemaIdLocation"
	SchemaIDPayloadEncodingLabel = "schemaIdPayloadEncoding"
	SchemaLookupStrategyLabel    = "schemaLookupStrategy"

	// Kafka topic configuration fields
	CleanupPolicyLabel                     = "cleanup.policy"
	RetentionMsLabel                       = "retention.ms"
	RetentionBytesLabel                    = "retention.bytes"
	DeleteRetentionMsLabel                 = "delete.retention.ms"
	MaxMessageBytesLabel                   = "max.message.bytes"
	ConfluentKeySchemaValidationLabel      = "confluent.key.schema.validation"
	ConfluentKeySubjectNameStrategyLabel   = "confluent.key.subject.name.strategy"
	ConfluentValueSchemaValidationLabel    = "confluent.value.schema.validation"
	ConfluentValueSubjectNameStrategyLabel = "confluent.value.subject.name.strategy"

	// AMQP binding fields
	IsLabel              = "is"
	ExchangeLabel        = "exchange"
	QueueLabel           = "queue"
	DurableLabel         = "durable"
	AutoDeleteLabel      = "autoDelete"
	ExclusiveLabel       = "exclusive"
	VHostLabel           = "vhost"
	ExpirationLabel      = "expiration"
	UserIDLabel          = "userId"
	CCLabel              = "cc"
	PriorityLabel        = "priority"
	DeliveryModeLabel    = "deliveryMode"
	MandatoryLabel       = "mandatory"
	BCCLabel             = "bcc"
	TimestampLabel       = "timestamp"
	AckLabel             = "ack"
	ContentEncodingLabel = "contentEncoding"
	MessageTypeLabel     = "messageType"

	// MQTT binding fields
	CleanSessionLabel           = "cleanSession"
	LastWillLabel               = "lastWill"
	KeepAliveLabel              = "keepAlive"
	SessionExpiryIntervalLabel  = "sessionExpiryInterval"
	MaximumPacketSizeLabel      = "maximumPacketSize"
	QoSLabel                    = "qos"
	RetainLabel                 = "retain"
	MessageExpiryIntervalLabel  = "messageExpiryInterval"
	PayloadFormatIndicatorLabel = "payloadFormatIndicator"
	CorrelationDataLabel        = "correlationData"
	ResponseTopicLabel          = "responseTopic"

	// Reference field
	RefLabel = "$ref"

	// Operation action values
	ActionSend    = "send"
	ActionReceive = "receive"

	// Components section labels
	SchemasLabel           = "schemas"
	SecuritySchemesLabel   = "securitySchemes"
	ServerVariablesLabel   = "serverVariables"
	CorrelationIDsLabel    = "correlationIds"
	RepliesLabel           = "replies"
	ReplyAddressesLabel    = "replyAddresses"
	OperationTraitsLabel   = "operationTraits"
	MessageTraitsLabel     = "messageTraits"
	ServerBindingsLabel    = "serverBindings"
	ChannelBindingsLabel   = "channelBindings"
	OperationBindingsLabel = "operationBindings"
	MessageBindingsLabel   = "messageBindings"

	// Contact/License fields (reused from base)
	ContactLabel = "contact"
	LicenseLabel = "license"
	EmailLabel   = "email"
	URLLabel     = "url"

	// Terms of service
	TermsOfServiceLabel = "termsOfService"
)

Constants for labels used to look up values within AsyncAPI 3.0 specifications.

Variables

View Source
var ErrNoAsyncAPIVersion = errors.New("no asyncapi version found in document")

ErrNoAsyncAPIVersion is returned when the asyncapi version field is missing from the specification. This matches the naming convention used in the top-level package for consistency.

Functions

This section is empty.

Types

type AMQPChannelBinding

type AMQPChannelBinding struct {
	BaseBinding
	Is             low.NodeReference[string]
	Exchange       low.NodeReference[*AMQPExchange]
	Queue          low.NodeReference[*AMQPQueue]
	BindingVersion low.NodeReference[string]
}

AMQPChannelBinding represents a low-level AsyncAPI 3.0 AMQP Channel Binding object.

https://github.com/asyncapi/bindings/blob/master/amqp/README.md#channel

func (*AMQPChannelBinding) Build

func (a *AMQPChannelBinding) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

func (*AMQPChannelBinding) Hash

func (a *AMQPChannelBinding) Hash() [32]byte

type AMQPExchange

type AMQPExchange struct {
	BaseBinding
	Name       low.NodeReference[string]
	Type       low.NodeReference[string]
	Durable    low.NodeReference[bool]
	AutoDelete low.NodeReference[bool]
	VHost      low.NodeReference[string]
}

AMQPExchange represents AMQP exchange configuration.

func (*AMQPExchange) Build

func (a *AMQPExchange) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

func (*AMQPExchange) Hash

func (a *AMQPExchange) Hash() [32]byte

type AMQPMessageBinding

type AMQPMessageBinding struct {
	BaseBinding
	ContentEncoding low.NodeReference[string]
	MessageType     low.NodeReference[string]
	BindingVersion  low.NodeReference[string]
}

AMQPMessageBinding represents a low-level AsyncAPI 3.0 AMQP Message Binding object.

https://github.com/asyncapi/bindings/blob/master/amqp/README.md#message

func (*AMQPMessageBinding) Build

func (a *AMQPMessageBinding) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

func (*AMQPMessageBinding) Hash

func (a *AMQPMessageBinding) Hash() [32]byte

type AMQPOperationBinding

type AMQPOperationBinding struct {
	BaseBinding
	Expiration     low.NodeReference[int]
	UserID         low.NodeReference[string]
	CC             low.NodeReference[[]low.ValueReference[string]]
	Priority       low.NodeReference[int]
	DeliveryMode   low.NodeReference[int]
	Mandatory      low.NodeReference[bool]
	BCC            low.NodeReference[[]low.ValueReference[string]]
	Timestamp      low.NodeReference[bool]
	Ack            low.NodeReference[bool]
	BindingVersion low.NodeReference[string]
}

AMQPOperationBinding represents a low-level AsyncAPI 3.0 AMQP Operation Binding object.

https://github.com/asyncapi/bindings/blob/master/amqp/README.md#operation

func (*AMQPOperationBinding) Build

func (a *AMQPOperationBinding) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

func (*AMQPOperationBinding) Hash

func (a *AMQPOperationBinding) Hash() [32]byte

type AMQPQueue

type AMQPQueue struct {
	BaseBinding
	Name       low.NodeReference[string]
	Durable    low.NodeReference[bool]
	Exclusive  low.NodeReference[bool]
	AutoDelete low.NodeReference[bool]
	VHost      low.NodeReference[string]
}

AMQPQueue represents AMQP queue configuration.

func (*AMQPQueue) Build

func (a *AMQPQueue) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

func (*AMQPQueue) Hash

func (a *AMQPQueue) Hash() [32]byte

type AsyncAPI

AsyncAPI represents a low-level AsyncAPI 3.0 Document object.

This is the root document object of the AsyncAPI document.

https://www.asyncapi.com/docs/reference/specification/v3.0.0#A2SObject

func CreateDocument

func CreateDocument(rootNode *yaml.Node) (*AsyncAPI, error)

CreateDocument creates a new AsyncAPI low-level document from the provided root node.

func CreateDocumentWithConfig

func CreateDocumentWithConfig(rootNode *yaml.Node, config *DocumentConfiguration) (*AsyncAPI, error)

CreateDocumentWithConfig creates a new AsyncAPI low-level document with the provided configuration.

func (*AsyncAPI) Build

func (a *AsyncAPI) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

Build extracts the AsyncAPI document from the supplied root node.

func (*AsyncAPI) FindExtension

func (a *AsyncAPI) FindExtension(ext string) *low.ValueReference[*yaml.Node]

FindExtension attempts to locate an extension with the supplied key.

func (*AsyncAPI) GetContext

func (a *AsyncAPI) GetContext() context.Context

GetContext returns the context.Context instance used when building the AsyncAPI document.

func (*AsyncAPI) GetExtensions

GetExtensions returns all extensions for AsyncAPI.

func (*AsyncAPI) GetIndex

func (a *AsyncAPI) GetIndex() *index.SpecIndex

GetIndex returns the index.SpecIndex instance attached to the AsyncAPI document.

func (*AsyncAPI) GetKeyNode

func (a *AsyncAPI) GetKeyNode() *yaml.Node

GetKeyNode returns the key yaml node of the AsyncAPI document.

func (*AsyncAPI) GetRootNode

func (a *AsyncAPI) GetRootNode() *yaml.Node

GetRootNode returns the root yaml node of the AsyncAPI document.

func (*AsyncAPI) Hash

func (a *AsyncAPI) Hash() [32]byte

Hash returns a consistent SHA256 Hash of the AsyncAPI document.

type BaseBinding

type BaseBinding struct {
	Extensions *orderedmap.Map[low.KeyReference[string], low.ValueReference[*yaml.Node]]
	KeyNode    *yaml.Node
	RootNode   *yaml.Node

	*low.Reference
	low.NodeMap
	// contains filtered or unexported fields
}

BaseBinding provides common fields and methods for all binding types. This reduces code duplication across the 15+ binding structs.

func (*BaseBinding) GetContext

func (b *BaseBinding) GetContext() context.Context

GetContext returns the context.

func (*BaseBinding) GetExtensions

GetExtensions returns all extensions for the binding.

func (*BaseBinding) GetIndex

func (b *BaseBinding) GetIndex() *index.SpecIndex

GetIndex returns the spec index.

func (*BaseBinding) GetKeyNode

func (b *BaseBinding) GetKeyNode() *yaml.Node

GetKeyNode returns the key yaml node of the binding.

func (*BaseBinding) GetRootNode

func (b *BaseBinding) GetRootNode() *yaml.Node

GetRootNode returns the root yaml node of the binding.

type Channel

type Channel struct {
	Address      low.NodeReference[*string] // pointer to allow null
	Messages     low.NodeReference[*orderedmap.Map[low.KeyReference[string], low.ValueReference[*Message]]]
	Title        low.NodeReference[string]
	Summary      low.NodeReference[string]
	Description  low.NodeReference[string]
	Servers      low.NodeReference[[]low.ValueReference[*low.Reference]] // references only
	Parameters   low.NodeReference[*orderedmap.Map[low.KeyReference[string], low.ValueReference[*Parameter]]]
	Tags         low.NodeReference[[]low.ValueReference[*Tag]]
	ExternalDocs low.NodeReference[*ExternalDoc]
	Bindings     low.NodeReference[*ChannelBindings]
	Extensions   *orderedmap.Map[low.KeyReference[string], low.ValueReference[*yaml.Node]]
	KeyNode      *yaml.Node
	RootNode     *yaml.Node

	*low.Reference
	low.NodeMap
	// contains filtered or unexported fields
}

Channel represents a low-level AsyncAPI 3.0 Channel object.

Describes a shared communication channel.

https://www.asyncapi.com/docs/reference/specification/v3.0.0#channelObject

func (*Channel) Build

func (c *Channel) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

Build extracts the Channel object from the supplied root node.

func (*Channel) FindExtension

func (c *Channel) FindExtension(ext string) *low.ValueReference[*yaml.Node]

FindExtension attempts to locate an extension with the supplied key.

func (*Channel) GetContext

func (c *Channel) GetContext() context.Context

GetContext returns the context.Context instance used when building the Channel object.

func (*Channel) GetExtensions

GetExtensions returns all extensions for Channel.

func (*Channel) GetIndex

func (c *Channel) GetIndex() *index.SpecIndex

GetIndex returns the index.SpecIndex instance attached to the Channel object.

func (*Channel) GetKeyNode

func (c *Channel) GetKeyNode() *yaml.Node

GetKeyNode returns the key yaml node of the Channel object.

func (*Channel) GetRootNode

func (c *Channel) GetRootNode() *yaml.Node

GetRootNode returns the root yaml node of the Channel object.

func (*Channel) Hash

func (c *Channel) Hash() [32]byte

Hash returns a consistent SHA256 Hash of the Channel object.

type ChannelBindings

type ChannelBindings struct {
	HTTP       low.NodeReference[*HTTPChannelBinding]
	WebSocket  low.NodeReference[*WebSocketChannelBinding]
	Kafka      low.NodeReference[*KafkaChannelBinding]
	AMQP       low.NodeReference[*AMQPChannelBinding]
	Extensions *orderedmap.Map[low.KeyReference[string], low.ValueReference[*yaml.Node]]
	KeyNode    *yaml.Node
	RootNode   *yaml.Node

	*low.Reference
	low.NodeMap
	// contains filtered or unexported fields
}

ChannelBindings represents a low-level AsyncAPI 3.0 Channel Bindings object.

Map of channel binding objects where the keys are protocol names.

https://www.asyncapi.com/docs/reference/specification/v3.0.0#channelBindingsObject

func (*ChannelBindings) Build

func (cb *ChannelBindings) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

Build extracts the ChannelBindings object from the supplied root node.

func (*ChannelBindings) GetContext

func (cb *ChannelBindings) GetContext() context.Context

GetContext returns the context.Context instance.

func (*ChannelBindings) GetExtensions

GetExtensions returns all extensions.

func (*ChannelBindings) GetIndex

func (cb *ChannelBindings) GetIndex() *index.SpecIndex

GetIndex returns the index.SpecIndex instance.

func (*ChannelBindings) GetKeyNode

func (cb *ChannelBindings) GetKeyNode() *yaml.Node

GetKeyNode returns the key yaml node.

func (*ChannelBindings) GetRootNode

func (cb *ChannelBindings) GetRootNode() *yaml.Node

GetRootNode returns the root yaml node.

func (*ChannelBindings) Hash

func (cb *ChannelBindings) Hash() [32]byte

Hash returns a consistent SHA256 Hash.

type Components

type Components struct {
	Schemas           low.NodeReference[*orderedmap.Map[low.KeyReference[string], low.ValueReference[*base.SchemaProxy]]]
	Servers           low.NodeReference[*orderedmap.Map[low.KeyReference[string], low.ValueReference[*Server]]]
	Channels          low.NodeReference[*orderedmap.Map[low.KeyReference[string], low.ValueReference[*Channel]]]
	Operations        low.NodeReference[*orderedmap.Map[low.KeyReference[string], low.ValueReference[*Operation]]]
	Messages          low.NodeReference[*orderedmap.Map[low.KeyReference[string], low.ValueReference[*Message]]]
	SecuritySchemes   low.NodeReference[*orderedmap.Map[low.KeyReference[string], low.ValueReference[*SecurityScheme]]]
	ServerVariables   low.NodeReference[*orderedmap.Map[low.KeyReference[string], low.ValueReference[*ServerVariable]]]
	Parameters        low.NodeReference[*orderedmap.Map[low.KeyReference[string], low.ValueReference[*Parameter]]]
	CorrelationIDs    low.NodeReference[*orderedmap.Map[low.KeyReference[string], low.ValueReference[*CorrelationID]]]
	Replies           low.NodeReference[*orderedmap.Map[low.KeyReference[string], low.ValueReference[*OperationReply]]]
	ReplyAddresses    low.NodeReference[*orderedmap.Map[low.KeyReference[string], low.ValueReference[*OperationReplyAddress]]]
	ExternalDocs      low.NodeReference[*orderedmap.Map[low.KeyReference[string], low.ValueReference[*ExternalDoc]]]
	Tags              low.NodeReference[*orderedmap.Map[low.KeyReference[string], low.ValueReference[*Tag]]]
	OperationTraits   low.NodeReference[*orderedmap.Map[low.KeyReference[string], low.ValueReference[*OperationTrait]]]
	MessageTraits     low.NodeReference[*orderedmap.Map[low.KeyReference[string], low.ValueReference[*MessageTrait]]]
	ServerBindings    low.NodeReference[*orderedmap.Map[low.KeyReference[string], low.ValueReference[*ServerBindings]]]
	ChannelBindings   low.NodeReference[*orderedmap.Map[low.KeyReference[string], low.ValueReference[*ChannelBindings]]]
	OperationBindings low.NodeReference[*orderedmap.Map[low.KeyReference[string], low.ValueReference[*OperationBindings]]]
	MessageBindings   low.NodeReference[*orderedmap.Map[low.KeyReference[string], low.ValueReference[*MessageBindings]]]
	Extensions        *orderedmap.Map[low.KeyReference[string], low.ValueReference[*yaml.Node]]
	KeyNode           *yaml.Node
	RootNode          *yaml.Node

	*low.Reference
	low.NodeMap
	// contains filtered or unexported fields
}

Components represents a low-level AsyncAPI 3.0 Components object.

Holds a set of reusable objects for different aspects of the AsyncAPI specification. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.

https://www.asyncapi.com/docs/reference/specification/v3.0.0#componentsObject

func (*Components) Build

func (c *Components) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

Build extracts the Components object from the supplied root node.

func (*Components) FindChannel

func (c *Components) FindChannel(name string) *low.ValueReference[*Channel]

FindChannel attempts to locate a Channel from 'channels' with a specific name.

func (*Components) FindExtension

func (c *Components) FindExtension(ext string) *low.ValueReference[*yaml.Node]

FindExtension attempts to locate an extension with the supplied key.

func (*Components) FindMessage

func (c *Components) FindMessage(name string) *low.ValueReference[*Message]

FindMessage attempts to locate a Message from 'messages' with a specific name.

func (*Components) FindOperation

func (c *Components) FindOperation(name string) *low.ValueReference[*Operation]

FindOperation attempts to locate an Operation from 'operations' with a specific name.

func (*Components) FindSchema

func (c *Components) FindSchema(name string) *low.ValueReference[*base.SchemaProxy]

FindSchema attempts to locate a SchemaProxy from 'schemas' with a specific name.

func (*Components) FindSecurityScheme

func (c *Components) FindSecurityScheme(name string) *low.ValueReference[*SecurityScheme]

FindSecurityScheme attempts to locate a SecurityScheme from 'securitySchemes' with a specific name.

func (*Components) FindServer

func (c *Components) FindServer(name string) *low.ValueReference[*Server]

FindServer attempts to locate a Server from 'servers' with a specific name.

func (*Components) GetContext

func (c *Components) GetContext() context.Context

GetContext returns the context.Context instance used when building the Components object.

func (*Components) GetExtensions

GetExtensions returns all extensions for Components.

func (*Components) GetIndex

func (c *Components) GetIndex() *index.SpecIndex

GetIndex returns the index.SpecIndex instance attached to the Components object.

func (*Components) GetKeyNode

func (c *Components) GetKeyNode() *yaml.Node

GetKeyNode returns the key yaml node of the Components object.

func (*Components) GetRootNode

func (c *Components) GetRootNode() *yaml.Node

GetRootNode returns the root yaml node of the Components object.

func (*Components) Hash

func (c *Components) Hash() [32]byte

Hash returns a consistent SHA256 Hash of the Components object.

type CorrelationID

type CorrelationID struct {
	Description low.NodeReference[string]
	Location    low.NodeReference[string]
	Extensions  *orderedmap.Map[low.KeyReference[string], low.ValueReference[*yaml.Node]]
	KeyNode     *yaml.Node
	RootNode    *yaml.Node

	*low.Reference
	low.NodeMap
	// contains filtered or unexported fields
}

CorrelationID represents a low-level AsyncAPI 3.0 Correlation ID object.

https://www.asyncapi.com/docs/reference/specification/v3.0.0#correlationIdObject

func (*CorrelationID) Build

func (ci *CorrelationID) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

Build extracts the CorrelationID object from the supplied root node.

func (*CorrelationID) GetContext

func (ci *CorrelationID) GetContext() context.Context

GetContext returns the context.Context instance.

func (*CorrelationID) GetExtensions

GetExtensions returns all extensions.

func (*CorrelationID) GetIndex

func (ci *CorrelationID) GetIndex() *index.SpecIndex

GetIndex returns the index.SpecIndex instance.

func (*CorrelationID) GetKeyNode

func (ci *CorrelationID) GetKeyNode() *yaml.Node

GetKeyNode returns the key yaml node.

func (*CorrelationID) GetRootNode

func (ci *CorrelationID) GetRootNode() *yaml.Node

GetRootNode returns the root yaml node.

func (*CorrelationID) Hash

func (ci *CorrelationID) Hash() [32]byte

Hash returns a consistent SHA256 Hash.

type DocumentBuildError

type DocumentBuildError struct {
	Errors []error
}

DocumentBuildError wraps multiple errors that occurred during document building.

func (*DocumentBuildError) Error

func (e *DocumentBuildError) Error() string

func (*DocumentBuildError) Unwrap

func (e *DocumentBuildError) Unwrap() []error

type DocumentConfiguration

type DocumentConfiguration struct {
	// BasePath is the base path for resolving relative file references.
	BasePath string

	// BaseURL is the base URL for resolving relative remote references.
	BaseURL *url.URL

	// AllowFileReferences enables loading local file references.
	AllowFileReferences bool

	// AllowRemoteReferences enables loading remote references.
	AllowRemoteReferences bool

	// SkipCircularReferenceCheck skips checking for circular references.
	SkipCircularReferenceCheck bool

	// ExtractRefsSequentially extracts references one at a time instead of in parallel.
	ExtractRefsSequentially bool

	// RemoteURLHandler is a custom function for fetching remote URLs.
	RemoteURLHandler RemoteURLHandler

	// LocalFS is a custom filesystem for resolving local file references.
	// If nil, the OS filesystem is used.
	LocalFS fs.FS

	// Logger is the logger to use for debug output.
	Logger *slog.Logger
}

DocumentConfiguration provides options for loading and parsing AsyncAPI documents.

func NewDocumentConfiguration

func NewDocumentConfiguration() *DocumentConfiguration

NewDocumentConfiguration creates a new DocumentConfiguration with default values.

type ExternalDoc

type ExternalDoc struct {
	Description low.NodeReference[string]
	URL         low.NodeReference[string]
	Extensions  *orderedmap.Map[low.KeyReference[string], low.ValueReference[*yaml.Node]]
	KeyNode     *yaml.Node
	RootNode    *yaml.Node

	*low.Reference
	low.NodeMap
	// contains filtered or unexported fields
}

ExternalDoc represents a low-level AsyncAPI 3.0 External Documentation object.

Allows referencing an external resource for extended documentation.

https://www.asyncapi.com/docs/reference/specification/v3.0.0#externalDocumentationObject

func (*ExternalDoc) Build

func (e *ExternalDoc) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

Build extracts the ExternalDoc object from the supplied root node.

func (*ExternalDoc) FindExtension

func (e *ExternalDoc) FindExtension(ext string) *low.ValueReference[*yaml.Node]

FindExtension attempts to locate an extension with the supplied key.

func (*ExternalDoc) GetContext

func (e *ExternalDoc) GetContext() context.Context

GetContext returns the context.Context instance used when building the ExternalDoc object.

func (*ExternalDoc) GetExtensions

GetExtensions returns all extensions for ExternalDoc.

func (*ExternalDoc) GetIndex

func (e *ExternalDoc) GetIndex() *index.SpecIndex

GetIndex returns the index.SpecIndex instance attached to the ExternalDoc object.

func (*ExternalDoc) GetKeyNode

func (e *ExternalDoc) GetKeyNode() *yaml.Node

GetKeyNode returns the key yaml node of the ExternalDoc object.

func (*ExternalDoc) GetRootNode

func (e *ExternalDoc) GetRootNode() *yaml.Node

GetRootNode returns the root yaml node of the ExternalDoc object.

func (*ExternalDoc) Hash

func (e *ExternalDoc) Hash() [32]byte

Hash returns a consistent SHA256 Hash of the ExternalDoc object.

type HTTPChannelBinding

type HTTPChannelBinding struct {
	BaseBinding
}

HTTPChannelBinding represents a low-level AsyncAPI 3.0 HTTP Channel Binding object.

func (*HTTPChannelBinding) Build

func (h *HTTPChannelBinding) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

func (*HTTPChannelBinding) Hash

func (h *HTTPChannelBinding) Hash() [32]byte

type HTTPMessageBinding

type HTTPMessageBinding struct {
	BaseBinding
	Headers        low.NodeReference[*base.SchemaProxy]
	StatusCode     low.NodeReference[int]
	BindingVersion low.NodeReference[string]
}

HTTPMessageBinding represents a low-level AsyncAPI 3.0 HTTP Message Binding object.

https://github.com/asyncapi/bindings/blob/master/http/README.md#message

func (*HTTPMessageBinding) Build

func (h *HTTPMessageBinding) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

func (*HTTPMessageBinding) Hash

func (h *HTTPMessageBinding) Hash() [32]byte

type HTTPOperationBinding

type HTTPOperationBinding struct {
	BaseBinding
	Method         low.NodeReference[string]
	Query          low.NodeReference[*base.SchemaProxy]
	BindingVersion low.NodeReference[string]
}

HTTPOperationBinding represents a low-level AsyncAPI 3.0 HTTP Operation Binding object.

https://github.com/asyncapi/bindings/blob/master/http/README.md#operation

func (*HTTPOperationBinding) Build

func (h *HTTPOperationBinding) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

func (*HTTPOperationBinding) Hash

func (h *HTTPOperationBinding) Hash() [32]byte

type HTTPServerBinding

type HTTPServerBinding struct {
	BaseBinding
}

HTTPServerBinding represents a low-level AsyncAPI 3.0 HTTP Server Binding object.

func (*HTTPServerBinding) Build

func (h *HTTPServerBinding) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

func (*HTTPServerBinding) Hash

func (h *HTTPServerBinding) Hash() [32]byte

type Info

type Info struct {
	Title          low.NodeReference[string]
	Version        low.NodeReference[string]
	Description    low.NodeReference[string]
	TermsOfService low.NodeReference[string]
	Contact        low.NodeReference[*base.Contact]
	License        low.NodeReference[*base.License]
	Tags           low.NodeReference[*orderedmap.Map[low.KeyReference[string], low.ValueReference[*Tag]]]
	ExternalDocs   low.NodeReference[*ExternalDoc]
	Extensions     *orderedmap.Map[low.KeyReference[string], low.ValueReference[*yaml.Node]]
	KeyNode        *yaml.Node
	RootNode       *yaml.Node

	*low.Reference
	low.NodeMap
	// contains filtered or unexported fields
}

Info represents a low-level AsyncAPI 3.0 Info object.

The Info object provides metadata about the API. The metadata can be used by clients if needed, and can be presented in editing or documentation generation tools.

Unlike OpenAPI Info, AsyncAPI Info includes tags and externalDocs fields, and these can contain references ($ref).

https://www.asyncapi.com/docs/reference/specification/v3.0.0#infoObject

func (*Info) Build

func (i *Info) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

Build extracts the Info object from the supplied root node.

func (*Info) FindExtension

func (i *Info) FindExtension(ext string) *low.ValueReference[*yaml.Node]

FindExtension attempts to locate an extension with the supplied key.

func (*Info) GetContext

func (i *Info) GetContext() context.Context

GetContext returns the context.Context instance used when building the Info object.

func (*Info) GetExtensions

func (i *Info) GetExtensions() *orderedmap.Map[low.KeyReference[string], low.ValueReference[*yaml.Node]]

GetExtensions returns all extensions for Info.

func (*Info) GetIndex

func (i *Info) GetIndex() *index.SpecIndex

GetIndex returns the index.SpecIndex instance attached to the Info object.

func (*Info) GetKeyNode

func (i *Info) GetKeyNode() *yaml.Node

GetKeyNode returns the key yaml node of the Info object.

func (*Info) GetRootNode

func (i *Info) GetRootNode() *yaml.Node

GetRootNode returns the root yaml node of the Info object.

func (*Info) Hash

func (i *Info) Hash() [32]byte

Hash returns a consistent SHA256 Hash of the Info object.

type KafkaChannelBinding

type KafkaChannelBinding struct {
	BaseBinding
	Topic              low.NodeReference[string]
	Partitions         low.NodeReference[int]
	Replicas           low.NodeReference[int]
	TopicConfiguration low.NodeReference[*KafkaTopicConfiguration]
	BindingVersion     low.NodeReference[string]
}

KafkaChannelBinding represents a low-level AsyncAPI 3.0 Kafka Channel Binding object.

https://github.com/asyncapi/bindings/blob/master/kafka/README.md#channel

func (*KafkaChannelBinding) Build

func (k *KafkaChannelBinding) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

func (*KafkaChannelBinding) Hash

func (k *KafkaChannelBinding) Hash() [32]byte

type KafkaMessageBinding

type KafkaMessageBinding struct {
	BaseBinding
	Key                     low.NodeReference[*base.SchemaProxy]
	SchemaIDLocation        low.NodeReference[string]
	SchemaIDPayloadEncoding low.NodeReference[string]
	SchemaLookupStrategy    low.NodeReference[string]
	BindingVersion          low.NodeReference[string]
}

KafkaMessageBinding represents a low-level AsyncAPI 3.0 Kafka Message Binding object.

https://github.com/asyncapi/bindings/blob/master/kafka/README.md#message

func (*KafkaMessageBinding) Build

func (k *KafkaMessageBinding) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

func (*KafkaMessageBinding) Hash

func (k *KafkaMessageBinding) Hash() [32]byte

type KafkaOperationBinding

type KafkaOperationBinding struct {
	BaseBinding
	GroupID        low.NodeReference[*base.SchemaProxy]
	ClientID       low.NodeReference[*base.SchemaProxy]
	BindingVersion low.NodeReference[string]
}

KafkaOperationBinding represents a low-level AsyncAPI 3.0 Kafka Operation Binding object.

https://github.com/asyncapi/bindings/blob/master/kafka/README.md#operation

func (*KafkaOperationBinding) Build

func (k *KafkaOperationBinding) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

func (*KafkaOperationBinding) Hash

func (k *KafkaOperationBinding) Hash() [32]byte

type KafkaServerBinding

type KafkaServerBinding struct {
	BaseBinding
	SchemaRegistryURL    low.NodeReference[string]
	SchemaRegistryVendor low.NodeReference[string]
	BindingVersion       low.NodeReference[string]
}

KafkaServerBinding represents a low-level AsyncAPI 3.0 Kafka Server Binding object.

https://github.com/asyncapi/bindings/blob/master/kafka/README.md#server

func (*KafkaServerBinding) Build

func (k *KafkaServerBinding) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

func (*KafkaServerBinding) Hash

func (k *KafkaServerBinding) Hash() [32]byte

type KafkaTopicConfiguration

type KafkaTopicConfiguration struct {
	BaseBinding
	CleanupPolicy                     low.NodeReference[[]low.ValueReference[string]]
	RetentionMs                       low.NodeReference[int64]
	RetentionBytes                    low.NodeReference[int64]
	DeleteRetentionMs                 low.NodeReference[int64]
	MaxMessageBytes                   low.NodeReference[int]
	ConfluentKeySchemaValidation      low.NodeReference[bool]
	ConfluentKeySubjectNameStrategy   low.NodeReference[string]
	ConfluentValueSchemaValidation    low.NodeReference[bool]
	ConfluentValueSubjectNameStrategy low.NodeReference[string]
}

KafkaTopicConfiguration represents Kafka topic configuration.

func (*KafkaTopicConfiguration) Build

func (k *KafkaTopicConfiguration) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

func (*KafkaTopicConfiguration) Hash

func (k *KafkaTopicConfiguration) Hash() [32]byte

type MQTTLastWill

type MQTTLastWill struct {
	BaseBinding
	Topic   low.NodeReference[string]
	QoS     low.NodeReference[int]
	Message low.NodeReference[string]
	Retain  low.NodeReference[bool]
}

MQTTLastWill represents MQTT Last Will configuration.

func (*MQTTLastWill) Build

func (m *MQTTLastWill) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

func (*MQTTLastWill) Hash

func (m *MQTTLastWill) Hash() [32]byte

type MQTTMessageBinding

type MQTTMessageBinding struct {
	BaseBinding
	PayloadFormatIndicator low.NodeReference[int]
	CorrelationData        low.NodeReference[*base.SchemaProxy]
	ContentType            low.NodeReference[string]
	ResponseTopic          low.NodeReference[string]
	BindingVersion         low.NodeReference[string]
}

MQTTMessageBinding represents a low-level AsyncAPI 3.0 MQTT Message Binding object.

https://github.com/asyncapi/bindings/blob/master/mqtt/README.md#message

func (*MQTTMessageBinding) Build

func (m *MQTTMessageBinding) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

func (*MQTTMessageBinding) Hash

func (m *MQTTMessageBinding) Hash() [32]byte

type MQTTOperationBinding

type MQTTOperationBinding struct {
	BaseBinding
	QoS            low.NodeReference[int]
	Retain         low.NodeReference[bool]
	BindingVersion low.NodeReference[string]
}

MQTTOperationBinding represents a low-level AsyncAPI 3.0 MQTT Operation Binding object.

https://github.com/asyncapi/bindings/blob/master/mqtt/README.md#operation

func (*MQTTOperationBinding) Build

func (m *MQTTOperationBinding) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

func (*MQTTOperationBinding) Hash

func (m *MQTTOperationBinding) Hash() [32]byte

type MQTTServerBinding

type MQTTServerBinding struct {
	BaseBinding
	ClientID              low.NodeReference[string]
	CleanSession          low.NodeReference[bool]
	LastWill              low.NodeReference[*MQTTLastWill]
	KeepAlive             low.NodeReference[int]
	SessionExpiryInterval low.NodeReference[int]
	MaximumPacketSize     low.NodeReference[int]
	BindingVersion        low.NodeReference[string]
}

MQTTServerBinding represents a low-level AsyncAPI 3.0 MQTT Server Binding object.

https://github.com/asyncapi/bindings/blob/master/mqtt/README.md#server

func (*MQTTServerBinding) Build

func (m *MQTTServerBinding) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

func (*MQTTServerBinding) Hash

func (m *MQTTServerBinding) Hash() [32]byte

type Message

Message represents a low-level AsyncAPI 3.0 Message object.

Describes a message received on a given channel and operation.

https://www.asyncapi.com/docs/reference/specification/v3.0.0#messageObject

func (*Message) Build

func (m *Message) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

Build extracts the Message object from the supplied root node.

func (*Message) FindExtension

func (m *Message) FindExtension(ext string) *low.ValueReference[*yaml.Node]

FindExtension attempts to locate an extension with the supplied key.

func (*Message) GetContext

func (m *Message) GetContext() context.Context

GetContext returns the context.Context instance used when building the Message object.

func (*Message) GetExtensions

GetExtensions returns all extensions for Message.

func (*Message) GetIndex

func (m *Message) GetIndex() *index.SpecIndex

GetIndex returns the index.SpecIndex instance attached to the Message object.

func (*Message) GetKeyNode

func (m *Message) GetKeyNode() *yaml.Node

GetKeyNode returns the key yaml node of the Message object.

func (*Message) GetRootNode

func (m *Message) GetRootNode() *yaml.Node

GetRootNode returns the root yaml node of the Message object.

func (*Message) Hash

func (m *Message) Hash() [32]byte

Hash returns a consistent SHA256 Hash of the Message object.

type MessageBindings

type MessageBindings struct {
	HTTP       low.NodeReference[*HTTPMessageBinding]
	Kafka      low.NodeReference[*KafkaMessageBinding]
	AMQP       low.NodeReference[*AMQPMessageBinding]
	MQTT       low.NodeReference[*MQTTMessageBinding]
	Extensions *orderedmap.Map[low.KeyReference[string], low.ValueReference[*yaml.Node]]
	KeyNode    *yaml.Node
	RootNode   *yaml.Node

	*low.Reference
	low.NodeMap
	// contains filtered or unexported fields
}

MessageBindings represents a low-level AsyncAPI 3.0 Message Bindings object.

Map of message binding objects where the keys are protocol names.

https://www.asyncapi.com/docs/reference/specification/v3.0.0#messageBindingsObject

func (*MessageBindings) Build

func (mb *MessageBindings) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

Build extracts the MessageBindings object from the supplied root node.

func (*MessageBindings) GetContext

func (mb *MessageBindings) GetContext() context.Context

GetContext returns the context.Context instance.

func (*MessageBindings) GetExtensions

GetExtensions returns all extensions.

func (*MessageBindings) GetIndex

func (mb *MessageBindings) GetIndex() *index.SpecIndex

GetIndex returns the index.SpecIndex instance.

func (*MessageBindings) GetKeyNode

func (mb *MessageBindings) GetKeyNode() *yaml.Node

GetKeyNode returns the key yaml node.

func (*MessageBindings) GetRootNode

func (mb *MessageBindings) GetRootNode() *yaml.Node

GetRootNode returns the root yaml node.

func (*MessageBindings) Hash

func (mb *MessageBindings) Hash() [32]byte

Hash returns a consistent SHA256 Hash.

type MessageExample

type MessageExample struct {
	Headers    low.NodeReference[*yaml.Node]
	Payload    low.NodeReference[*yaml.Node]
	Name       low.NodeReference[string]
	Summary    low.NodeReference[string]
	Extensions *orderedmap.Map[low.KeyReference[string], low.ValueReference[*yaml.Node]]
	KeyNode    *yaml.Node
	RootNode   *yaml.Node

	*low.Reference
	low.NodeMap
	// contains filtered or unexported fields
}

MessageExample represents a low-level AsyncAPI 3.0 Message Example object.

https://www.asyncapi.com/docs/reference/specification/v3.0.0#messageExampleObject

func (*MessageExample) Build

func (me *MessageExample) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

Build extracts the MessageExample object from the supplied root node.

func (*MessageExample) GetContext

func (me *MessageExample) GetContext() context.Context

GetContext returns the context.Context instance.

func (*MessageExample) GetExtensions

GetExtensions returns all extensions.

func (*MessageExample) GetIndex

func (me *MessageExample) GetIndex() *index.SpecIndex

GetIndex returns the index.SpecIndex instance.

func (*MessageExample) GetKeyNode

func (me *MessageExample) GetKeyNode() *yaml.Node

GetKeyNode returns the key yaml node.

func (*MessageExample) GetRootNode

func (me *MessageExample) GetRootNode() *yaml.Node

GetRootNode returns the root yaml node.

func (*MessageExample) Hash

func (me *MessageExample) Hash() [32]byte

Hash returns a consistent SHA256 Hash.

type MessageTrait

type MessageTrait struct {
	Headers       low.NodeReference[*base.SchemaProxy]
	CorrelationID low.NodeReference[*CorrelationID]
	ContentType   low.NodeReference[string]
	Name          low.NodeReference[string]
	Title         low.NodeReference[string]
	Summary       low.NodeReference[string]
	Description   low.NodeReference[string]
	Tags          low.NodeReference[[]low.ValueReference[*Tag]]
	ExternalDocs  low.NodeReference[*ExternalDoc]
	Bindings      low.NodeReference[*MessageBindings]
	Examples      low.NodeReference[[]low.ValueReference[*MessageExample]]
	Extensions    *orderedmap.Map[low.KeyReference[string], low.ValueReference[*yaml.Node]]
	KeyNode       *yaml.Node
	RootNode      *yaml.Node

	*low.Reference
	low.NodeMap
	// contains filtered or unexported fields
}

MessageTrait represents a low-level AsyncAPI 3.0 Message Trait object.

https://www.asyncapi.com/docs/reference/specification/v3.0.0#messageTraitObject

func (*MessageTrait) Build

func (mt *MessageTrait) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

Build extracts the MessageTrait object from the supplied root node.

func (*MessageTrait) GetContext

func (mt *MessageTrait) GetContext() context.Context

GetContext returns the context.Context instance.

func (*MessageTrait) GetExtensions

GetExtensions returns all extensions.

func (*MessageTrait) GetIndex

func (mt *MessageTrait) GetIndex() *index.SpecIndex

GetIndex returns the index.SpecIndex instance.

func (*MessageTrait) GetKeyNode

func (mt *MessageTrait) GetKeyNode() *yaml.Node

GetKeyNode returns the key yaml node.

func (*MessageTrait) GetRootNode

func (mt *MessageTrait) GetRootNode() *yaml.Node

GetRootNode returns the root yaml node.

func (*MessageTrait) Hash

func (mt *MessageTrait) Hash() [32]byte

Hash returns a consistent SHA256 Hash.

type OAuthFlow

type OAuthFlow struct {
	AuthorizationURL low.NodeReference[string]
	TokenURL         low.NodeReference[string]
	RefreshURL       low.NodeReference[string]
	AvailableScopes  low.NodeReference[*orderedmap.Map[low.KeyReference[string], low.ValueReference[string]]]
	Extensions       *orderedmap.Map[low.KeyReference[string], low.ValueReference[*yaml.Node]]
	KeyNode          *yaml.Node
	RootNode         *yaml.Node

	*low.Reference
	low.NodeMap
	// contains filtered or unexported fields
}

OAuthFlow represents a low-level AsyncAPI 3.0 OAuth Flow object.

Configuration details for a supported OAuth Flow.

https://www.asyncapi.com/docs/reference/specification/v3.0.0#oauthFlowObject

func (*OAuthFlow) Build

func (of *OAuthFlow) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

Build extracts the OAuthFlow object from the supplied root node.

func (*OAuthFlow) FindExtension

func (of *OAuthFlow) FindExtension(ext string) *low.ValueReference[*yaml.Node]

FindExtension attempts to locate an extension with the supplied key.

func (*OAuthFlow) FindScope

func (of *OAuthFlow) FindScope(scope string) *low.ValueReference[string]

FindScope attempts to locate a scope using a specified name.

func (*OAuthFlow) GetContext

func (of *OAuthFlow) GetContext() context.Context

GetContext returns the context.Context instance used when building the OAuthFlow object.

func (*OAuthFlow) GetExtensions

GetExtensions returns all extensions for OAuthFlow.

func (*OAuthFlow) GetIndex

func (of *OAuthFlow) GetIndex() *index.SpecIndex

GetIndex returns the index.SpecIndex instance attached to the OAuthFlow object.

func (*OAuthFlow) GetKeyNode

func (of *OAuthFlow) GetKeyNode() *yaml.Node

GetKeyNode returns the key yaml node of the OAuthFlow object.

func (*OAuthFlow) GetRootNode

func (of *OAuthFlow) GetRootNode() *yaml.Node

GetRootNode returns the root yaml node of the OAuthFlow object.

func (*OAuthFlow) Hash

func (of *OAuthFlow) Hash() [32]byte

Hash returns a consistent SHA256 Hash of the OAuthFlow object.

type OAuthFlows

type OAuthFlows struct {
	Implicit          low.NodeReference[*OAuthFlow]
	Password          low.NodeReference[*OAuthFlow]
	ClientCredentials low.NodeReference[*OAuthFlow]
	AuthorizationCode low.NodeReference[*OAuthFlow]
	Extensions        *orderedmap.Map[low.KeyReference[string], low.ValueReference[*yaml.Node]]
	KeyNode           *yaml.Node
	RootNode          *yaml.Node

	*low.Reference
	low.NodeMap
	// contains filtered or unexported fields
}

OAuthFlows represents a low-level AsyncAPI 3.0 OAuth Flows object.

Allows configuration of the supported OAuth Flows.

https://www.asyncapi.com/docs/reference/specification/v3.0.0#oauthFlowsObject

func (*OAuthFlows) Build

func (of *OAuthFlows) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

Build extracts the OAuthFlows object from the supplied root node.

func (*OAuthFlows) FindExtension

func (of *OAuthFlows) FindExtension(ext string) *low.ValueReference[*yaml.Node]

FindExtension attempts to locate an extension with the supplied key.

func (*OAuthFlows) GetContext

func (of *OAuthFlows) GetContext() context.Context

GetContext returns the context.Context instance used when building the OAuthFlows object.

func (*OAuthFlows) GetExtensions

GetExtensions returns all extensions for OAuthFlows.

func (*OAuthFlows) GetIndex

func (of *OAuthFlows) GetIndex() *index.SpecIndex

GetIndex returns the index.SpecIndex instance attached to the OAuthFlows object.

func (*OAuthFlows) GetKeyNode

func (of *OAuthFlows) GetKeyNode() *yaml.Node

GetKeyNode returns the key yaml node of the OAuthFlows object.

func (*OAuthFlows) GetRootNode

func (of *OAuthFlows) GetRootNode() *yaml.Node

GetRootNode returns the root yaml node of the OAuthFlows object.

func (*OAuthFlows) Hash

func (of *OAuthFlows) Hash() [32]byte

Hash returns a consistent SHA256 Hash of the OAuthFlows object.

type Operation

type Operation struct {
	Action       low.NodeReference[string]
	Channel      low.NodeReference[*low.Reference] // reference only
	Title        low.NodeReference[string]
	Summary      low.NodeReference[string]
	Description  low.NodeReference[string]
	Security     low.NodeReference[[]low.ValueReference[*SecurityScheme]]
	Tags         low.NodeReference[[]low.ValueReference[*Tag]]
	ExternalDocs low.NodeReference[*ExternalDoc]
	Bindings     low.NodeReference[*OperationBindings]
	Traits       low.NodeReference[[]low.ValueReference[*OperationTrait]]
	Messages     low.NodeReference[[]low.ValueReference[*low.Reference]] // array of refs
	Reply        low.NodeReference[*OperationReply]
	Extensions   *orderedmap.Map[low.KeyReference[string], low.ValueReference[*yaml.Node]]
	KeyNode      *yaml.Node
	RootNode     *yaml.Node

	*low.Reference
	low.NodeMap
	// contains filtered or unexported fields
}

Operation represents a low-level AsyncAPI 3.0 Operation object.

Describes a specific operation.

https://www.asyncapi.com/docs/reference/specification/v3.0.0#operationObject

func (*Operation) Build

func (o *Operation) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

Build extracts the Operation object from the supplied root node.

func (*Operation) FindExtension

func (o *Operation) FindExtension(ext string) *low.ValueReference[*yaml.Node]

FindExtension attempts to locate an extension with the supplied key.

func (*Operation) GetContext

func (o *Operation) GetContext() context.Context

GetContext returns the context.Context instance used when building the Operation object.

func (*Operation) GetExtensions

GetExtensions returns all extensions for Operation.

func (*Operation) GetIndex

func (o *Operation) GetIndex() *index.SpecIndex

GetIndex returns the index.SpecIndex instance attached to the Operation object.

func (*Operation) GetKeyNode

func (o *Operation) GetKeyNode() *yaml.Node

GetKeyNode returns the key yaml node of the Operation object.

func (*Operation) GetRootNode

func (o *Operation) GetRootNode() *yaml.Node

GetRootNode returns the root yaml node of the Operation object.

func (*Operation) Hash

func (o *Operation) Hash() [32]byte

Hash returns a consistent SHA256 Hash of the Operation object.

type OperationBindings

type OperationBindings struct {
	HTTP       low.NodeReference[*HTTPOperationBinding]
	Kafka      low.NodeReference[*KafkaOperationBinding]
	AMQP       low.NodeReference[*AMQPOperationBinding]
	MQTT       low.NodeReference[*MQTTOperationBinding]
	Extensions *orderedmap.Map[low.KeyReference[string], low.ValueReference[*yaml.Node]]
	KeyNode    *yaml.Node
	RootNode   *yaml.Node

	*low.Reference
	low.NodeMap
	// contains filtered or unexported fields
}

OperationBindings represents a low-level AsyncAPI 3.0 Operation Bindings object.

Map of operation binding objects where the keys are protocol names.

https://www.asyncapi.com/docs/reference/specification/v3.0.0#operationBindingsObject

func (*OperationBindings) Build

func (ob *OperationBindings) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

Build extracts the OperationBindings object from the supplied root node.

func (*OperationBindings) GetContext

func (ob *OperationBindings) GetContext() context.Context

GetContext returns the context.Context instance.

func (*OperationBindings) GetExtensions

GetExtensions returns all extensions.

func (*OperationBindings) GetIndex

func (ob *OperationBindings) GetIndex() *index.SpecIndex

GetIndex returns the index.SpecIndex instance.

func (*OperationBindings) GetKeyNode

func (ob *OperationBindings) GetKeyNode() *yaml.Node

GetKeyNode returns the key yaml node.

func (*OperationBindings) GetRootNode

func (ob *OperationBindings) GetRootNode() *yaml.Node

GetRootNode returns the root yaml node.

func (*OperationBindings) Hash

func (ob *OperationBindings) Hash() [32]byte

Hash returns a consistent SHA256 Hash.

type OperationReply

type OperationReply struct {
	Address    low.NodeReference[*OperationReplyAddress]
	Channel    low.NodeReference[*low.Reference]                       // reference only
	Messages   low.NodeReference[[]low.ValueReference[*low.Reference]] // array of refs
	Extensions *orderedmap.Map[low.KeyReference[string], low.ValueReference[*yaml.Node]]
	KeyNode    *yaml.Node
	RootNode   *yaml.Node

	*low.Reference
	low.NodeMap
	// contains filtered or unexported fields
}

OperationReply represents a low-level AsyncAPI 3.0 Operation Reply object.

https://www.asyncapi.com/docs/reference/specification/v3.0.0#operationReplyObject

func (*OperationReply) Build

func (or *OperationReply) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

Build extracts the OperationReply object from the supplied root node.

func (*OperationReply) GetContext

func (or *OperationReply) GetContext() context.Context

GetContext returns the context.Context instance.

func (*OperationReply) GetExtensions

GetExtensions returns all extensions.

func (*OperationReply) GetIndex

func (or *OperationReply) GetIndex() *index.SpecIndex

GetIndex returns the index.SpecIndex instance.

func (*OperationReply) GetKeyNode

func (or *OperationReply) GetKeyNode() *yaml.Node

GetKeyNode returns the key yaml node.

func (*OperationReply) GetRootNode

func (or *OperationReply) GetRootNode() *yaml.Node

GetRootNode returns the root yaml node.

func (*OperationReply) Hash

func (or *OperationReply) Hash() [32]byte

Hash returns a consistent SHA256 Hash.

type OperationReplyAddress

type OperationReplyAddress struct {
	Description low.NodeReference[string]
	Location    low.NodeReference[string]
	Extensions  *orderedmap.Map[low.KeyReference[string], low.ValueReference[*yaml.Node]]
	KeyNode     *yaml.Node
	RootNode    *yaml.Node

	*low.Reference
	low.NodeMap
	// contains filtered or unexported fields
}

OperationReplyAddress represents a low-level AsyncAPI 3.0 Operation Reply Address object.

https://www.asyncapi.com/docs/reference/specification/v3.0.0#operationReplyAddressObject

func (*OperationReplyAddress) Build

func (ora *OperationReplyAddress) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

Build extracts the OperationReplyAddress object from the supplied root node.

func (*OperationReplyAddress) GetContext

func (ora *OperationReplyAddress) GetContext() context.Context

GetContext returns the context.Context instance.

func (*OperationReplyAddress) GetExtensions

GetExtensions returns all extensions.

func (*OperationReplyAddress) GetIndex

func (ora *OperationReplyAddress) GetIndex() *index.SpecIndex

GetIndex returns the index.SpecIndex instance.

func (*OperationReplyAddress) GetKeyNode

func (ora *OperationReplyAddress) GetKeyNode() *yaml.Node

GetKeyNode returns the key yaml node.

func (*OperationReplyAddress) GetRootNode

func (ora *OperationReplyAddress) GetRootNode() *yaml.Node

GetRootNode returns the root yaml node.

func (*OperationReplyAddress) Hash

func (ora *OperationReplyAddress) Hash() [32]byte

Hash returns a consistent SHA256 Hash.

type OperationTrait

type OperationTrait struct {
	Title        low.NodeReference[string]
	Summary      low.NodeReference[string]
	Description  low.NodeReference[string]
	Security     low.NodeReference[[]low.ValueReference[*SecurityScheme]]
	Tags         low.NodeReference[[]low.ValueReference[*Tag]]
	ExternalDocs low.NodeReference[*ExternalDoc]
	Bindings     low.NodeReference[*OperationBindings]
	Extensions   *orderedmap.Map[low.KeyReference[string], low.ValueReference[*yaml.Node]]
	KeyNode      *yaml.Node
	RootNode     *yaml.Node

	*low.Reference
	low.NodeMap
	// contains filtered or unexported fields
}

OperationTrait represents a low-level AsyncAPI 3.0 Operation Trait object.

https://www.asyncapi.com/docs/reference/specification/v3.0.0#operationTraitObject

func (*OperationTrait) Build

func (ot *OperationTrait) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

Build extracts the OperationTrait object from the supplied root node.

func (*OperationTrait) GetContext

func (ot *OperationTrait) GetContext() context.Context

GetContext returns the context.Context instance.

func (*OperationTrait) GetExtensions

GetExtensions returns all extensions.

func (*OperationTrait) GetIndex

func (ot *OperationTrait) GetIndex() *index.SpecIndex

GetIndex returns the index.SpecIndex instance.

func (*OperationTrait) GetKeyNode

func (ot *OperationTrait) GetKeyNode() *yaml.Node

GetKeyNode returns the key yaml node.

func (*OperationTrait) GetRootNode

func (ot *OperationTrait) GetRootNode() *yaml.Node

GetRootNode returns the root yaml node.

func (*OperationTrait) Hash

func (ot *OperationTrait) Hash() [32]byte

Hash returns a consistent SHA256 Hash.

type Parameter

type Parameter struct {
	Enum        low.NodeReference[[]low.ValueReference[string]]
	Default     low.NodeReference[string]
	Description low.NodeReference[string]
	Examples    low.NodeReference[[]low.ValueReference[string]]
	Location    low.NodeReference[string]
	Extensions  *orderedmap.Map[low.KeyReference[string], low.ValueReference[*yaml.Node]]
	KeyNode     *yaml.Node
	RootNode    *yaml.Node

	*low.Reference
	low.NodeMap
	// contains filtered or unexported fields
}

Parameter represents a low-level AsyncAPI 3.0 Parameter object.

Describes a parameter included in a channel address.

https://www.asyncapi.com/docs/reference/specification/v3.0.0#parameterObject

func (*Parameter) Build

func (p *Parameter) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

Build extracts the Parameter object from the supplied root node.

func (*Parameter) GetContext

func (p *Parameter) GetContext() context.Context

GetContext returns the context.Context instance used when building the Parameter object.

func (*Parameter) GetExtensions

GetExtensions returns all extensions for Parameter.

func (*Parameter) GetIndex

func (p *Parameter) GetIndex() *index.SpecIndex

GetIndex returns the index.SpecIndex instance attached to the Parameter object.

func (*Parameter) GetKeyNode

func (p *Parameter) GetKeyNode() *yaml.Node

GetKeyNode returns the key yaml node of the Parameter object.

func (*Parameter) GetRootNode

func (p *Parameter) GetRootNode() *yaml.Node

GetRootNode returns the root yaml node of the Parameter object.

func (*Parameter) Hash

func (p *Parameter) Hash() [32]byte

Hash returns a consistent SHA256 Hash of the Parameter object.

type RemoteURLHandler

type RemoteURLHandler = func(url string) (*http.Response, error)

RemoteURLHandler is a function type for custom remote URL fetching.

type SecurityScheme

type SecurityScheme struct {
	Type             low.NodeReference[string]
	Description      low.NodeReference[string]
	Name             low.NodeReference[string]
	In               low.NodeReference[string]
	Scheme           low.NodeReference[string]
	BearerFormat     low.NodeReference[string]
	Flows            low.NodeReference[*OAuthFlows]
	OpenIDConnectURL low.NodeReference[string]
	Scopes           low.NodeReference[[]low.ValueReference[string]]
	Extensions       *orderedmap.Map[low.KeyReference[string], low.ValueReference[*yaml.Node]]
	KeyNode          *yaml.Node
	RootNode         *yaml.Node

	*low.Reference
	low.NodeMap
	// contains filtered or unexported fields
}

SecurityScheme represents a low-level AsyncAPI 3.0 Security Scheme object.

Defines a security scheme that can be used by the operations. Supported schemes are: User/Password, API key, X.509, Symmetric/Asymmetric Encryption, HTTP (including Bearer), OAuth2, OpenID Connect, SASL (plain, scramSha256, scramSha512, gssapi).

https://www.asyncapi.com/docs/reference/specification/v3.0.0#securitySchemeObject

func (*SecurityScheme) Build

func (ss *SecurityScheme) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

Build extracts the SecurityScheme object from the supplied root node.

func (*SecurityScheme) FindExtension

func (ss *SecurityScheme) FindExtension(ext string) *low.ValueReference[*yaml.Node]

FindExtension attempts to locate an extension with the supplied key.

func (*SecurityScheme) GetContext

func (ss *SecurityScheme) GetContext() context.Context

GetContext returns the context.Context instance used when building the SecurityScheme object.

func (*SecurityScheme) GetExtensions

GetExtensions returns all extensions for SecurityScheme.

func (*SecurityScheme) GetIndex

func (ss *SecurityScheme) GetIndex() *index.SpecIndex

GetIndex returns the index.SpecIndex instance attached to the SecurityScheme object.

func (*SecurityScheme) GetKeyNode

func (ss *SecurityScheme) GetKeyNode() *yaml.Node

GetKeyNode returns the key yaml node of the SecurityScheme object.

func (*SecurityScheme) GetRootNode

func (ss *SecurityScheme) GetRootNode() *yaml.Node

GetRootNode returns the root yaml node of the SecurityScheme object.

func (*SecurityScheme) Hash

func (ss *SecurityScheme) Hash() [32]byte

Hash returns a consistent SHA256 Hash of the SecurityScheme object.

type Server

Server represents a low-level AsyncAPI 3.0 Server object.

An object representing a message broker, a server or any other kind of computer program capable of sending and/or receiving data.

https://www.asyncapi.com/docs/reference/specification/v3.0.0#serverObject

func (*Server) Build

func (s *Server) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

Build extracts the Server object from the supplied root node.

func (*Server) FindExtension

func (s *Server) FindExtension(ext string) *low.ValueReference[*yaml.Node]

FindExtension attempts to locate an extension with the supplied key.

func (*Server) GetContext

func (s *Server) GetContext() context.Context

GetContext returns the context.Context instance used when building the Server object.

func (*Server) GetExtensions

GetExtensions returns all extensions for Server.

func (*Server) GetIndex

func (s *Server) GetIndex() *index.SpecIndex

GetIndex returns the index.SpecIndex instance attached to the Server object.

func (*Server) GetKeyNode

func (s *Server) GetKeyNode() *yaml.Node

GetKeyNode returns the key yaml node of the Server object.

func (*Server) GetRootNode

func (s *Server) GetRootNode() *yaml.Node

GetRootNode returns the root yaml node of the Server object.

func (*Server) Hash

func (s *Server) Hash() [32]byte

Hash returns a consistent SHA256 Hash of the Server object.

type ServerBindings

type ServerBindings struct {
	HTTP       low.NodeReference[*HTTPServerBinding]
	Kafka      low.NodeReference[*KafkaServerBinding]
	MQTT       low.NodeReference[*MQTTServerBinding]
	Extensions *orderedmap.Map[low.KeyReference[string], low.ValueReference[*yaml.Node]]
	KeyNode    *yaml.Node
	RootNode   *yaml.Node

	*low.Reference
	low.NodeMap
	// contains filtered or unexported fields
}

ServerBindings represents a low-level AsyncAPI 3.0 Server Bindings object.

Map of server binding objects where the keys are protocol names.

https://www.asyncapi.com/docs/reference/specification/v3.0.0#serverBindingsObject

func (*ServerBindings) Build

func (sb *ServerBindings) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

Build extracts the ServerBindings object from the supplied root node.

func (*ServerBindings) GetContext

func (sb *ServerBindings) GetContext() context.Context

GetContext returns the context.Context instance.

func (*ServerBindings) GetExtensions

GetExtensions returns all extensions.

func (*ServerBindings) GetIndex

func (sb *ServerBindings) GetIndex() *index.SpecIndex

GetIndex returns the index.SpecIndex instance.

func (*ServerBindings) GetKeyNode

func (sb *ServerBindings) GetKeyNode() *yaml.Node

GetKeyNode returns the key yaml node.

func (*ServerBindings) GetRootNode

func (sb *ServerBindings) GetRootNode() *yaml.Node

GetRootNode returns the root yaml node.

func (*ServerBindings) Hash

func (sb *ServerBindings) Hash() [32]byte

Hash returns a consistent SHA256 Hash.

type ServerVariable

type ServerVariable struct {
	Enum        low.NodeReference[[]low.ValueReference[string]]
	Default     low.NodeReference[string]
	Description low.NodeReference[string]
	Examples    low.NodeReference[[]low.ValueReference[string]]
	Extensions  *orderedmap.Map[low.KeyReference[string], low.ValueReference[*yaml.Node]]
	KeyNode     *yaml.Node
	RootNode    *yaml.Node

	*low.Reference
	low.NodeMap
	// contains filtered or unexported fields
}

ServerVariable represents a low-level AsyncAPI 3.0 Server Variable object.

An object representing a Server Variable for server URL template substitution.

https://www.asyncapi.com/docs/reference/specification/v3.0.0#serverVariableObject

func (*ServerVariable) Build

func (sv *ServerVariable) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

Build extracts the ServerVariable object from the supplied root node.

func (*ServerVariable) GetContext

func (sv *ServerVariable) GetContext() context.Context

GetContext returns the context.Context instance used when building the ServerVariable object.

func (*ServerVariable) GetExtensions

GetExtensions returns all extensions for ServerVariable.

func (*ServerVariable) GetIndex

func (sv *ServerVariable) GetIndex() *index.SpecIndex

GetIndex returns the index.SpecIndex instance attached to the ServerVariable object.

func (*ServerVariable) GetKeyNode

func (sv *ServerVariable) GetKeyNode() *yaml.Node

GetKeyNode returns the key yaml node of the ServerVariable object.

func (*ServerVariable) GetRootNode

func (sv *ServerVariable) GetRootNode() *yaml.Node

GetRootNode returns the root yaml node of the ServerVariable object.

func (*ServerVariable) Hash

func (sv *ServerVariable) Hash() [32]byte

Hash returns a consistent SHA256 Hash of the ServerVariable object.

type Tag

type Tag struct {
	Name         low.NodeReference[string]
	Description  low.NodeReference[string]
	ExternalDocs low.NodeReference[*ExternalDoc]
	Extensions   *orderedmap.Map[low.KeyReference[string], low.ValueReference[*yaml.Node]]
	KeyNode      *yaml.Node
	RootNode     *yaml.Node

	*low.Reference
	low.NodeMap
	// contains filtered or unexported fields
}

Tag represents a low-level AsyncAPI 3.0 Tag object.

Allows adding metadata to a single tag.

https://www.asyncapi.com/docs/reference/specification/v3.0.0#tagObject

func (*Tag) Build

func (t *Tag) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

Build extracts the Tag object from the supplied root node.

func (*Tag) FindExtension

func (t *Tag) FindExtension(ext string) *low.ValueReference[*yaml.Node]

FindExtension attempts to locate an extension with the supplied key.

func (*Tag) GetContext

func (t *Tag) GetContext() context.Context

GetContext returns the context.Context instance used when building the Tag object.

func (*Tag) GetExtensions

func (t *Tag) GetExtensions() *orderedmap.Map[low.KeyReference[string], low.ValueReference[*yaml.Node]]

GetExtensions returns all extensions for Tag.

func (*Tag) GetIndex

func (t *Tag) GetIndex() *index.SpecIndex

GetIndex returns the index.SpecIndex instance attached to the Tag object.

func (*Tag) GetKeyNode

func (t *Tag) GetKeyNode() *yaml.Node

GetKeyNode returns the key yaml node of the Tag object.

func (*Tag) GetRootNode

func (t *Tag) GetRootNode() *yaml.Node

GetRootNode returns the root yaml node of the Tag object.

func (*Tag) Hash

func (t *Tag) Hash() [32]byte

Hash returns a consistent SHA256 Hash of the Tag object.

type WebSocketChannelBinding

type WebSocketChannelBinding struct {
	BaseBinding
	Method         low.NodeReference[string]
	Query          low.NodeReference[*base.SchemaProxy]
	Headers        low.NodeReference[*base.SchemaProxy]
	BindingVersion low.NodeReference[string]
}

WebSocketChannelBinding represents a low-level AsyncAPI 3.0 WebSocket Channel Binding object.

https://github.com/asyncapi/bindings/blob/master/websockets/README.md#channel

func (*WebSocketChannelBinding) Build

func (w *WebSocketChannelBinding) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.SpecIndex) error

func (*WebSocketChannelBinding) Hash

func (w *WebSocketChannelBinding) Hash() [32]byte

Jump to

Keyboard shortcuts

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