asyncapi

package
v0.14.4 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdditionalProperties

type AdditionalProperties map[string]interface{}

func (*AdditionalProperties) UnmarshalJSON

func (ap *AdditionalProperties) UnmarshalJSON(b []byte) error

type Any

type Any struct {
	AllOf                []*Any               `json:"allOf"`
	AnyOf                []*Any               `json:"anyOf"`
	OneOf                []*Any               `json:"oneOf"`
	Type                 string               `json:"type"`
	Description          string               `json:"description"`
	Format               string               `json:"format"`
	Properties           map[string]*Any      `json:"properties"`
	AdditionalProperties AdditionalProperties `json:"additionalProperties"`
	Items                *Any                 `json:"items"`
	Reference            string               `json:"$ref"`
	Required             []string             `json:"required"`

	// Non AsyncAPI fields
	Name        string `json:"-"`
	ReferenceTo *Any   `json:"-"`
}

func NewAny

func NewAny() Any

func (Any) IsFieldRequired

func (a Any) IsFieldRequired(field string) bool

func (*Any) MergeWith

func (a *Any) MergeWith(spec Specification, a2 Any)

func (*Any) Process

func (a *Any) Process(name string, spec Specification)

type Channel

type Channel struct {
	Parameters map[string]*Parameter `json:"parameters"`

	Subscribe *Operation `json:"subscribe"`
	Publish   *Operation `json:"publish"`

	// Non AsyncAPI fields
	Name string `json:"-"`
	Path string `json:"-"`
}

func (Channel) GetChannelMessage

func (c Channel) GetChannelMessage() *Message

GetChannelMessage will return the channel message WARNING: if there is a reference, then it won't be followed.

func (*Channel) Process

func (c *Channel) Process(path string, spec Specification)

type Components

type Components struct {
	Messages   map[string]*Message   `json:"messages"`
	Schemas    map[string]*Any       `json:"schemas"`
	Parameters map[string]*Parameter `json:"parameters"`
}

func (*Components) Process

func (c *Components) Process(spec Specification)

type CorrelationID

type CorrelationID struct {
	Description string `json:"description"`
	Location    string `json:"location"`
}

type Info

type Info struct {
	Title       string `json:"title"`
	Version     string `json:"version"`
	Description string `json:"description"`
}

type Message

type Message struct {
	Description   string         `json:"description"`
	Headers       *Any           `json:"headers"`
	OneOf         []*Message     `json:"oneOf"`
	Payload       *Any           `json:"payload"`
	CorrelationID *CorrelationID `json:"correlationID"`
	Reference     string         `json:"$ref"`

	// --- Non AsyncAPI fields -------------------------------------------------
	Name        string   `json:"-"`
	ReferenceTo *Message `json:"-"`

	// CorrelationIDLocation will indicate where the correlation id is
	// According to: https://www.asyncapi.com/docs/reference/specification/v2.6.0#correlationIDObject
	CorrelationIDLocation string `json:"-"`
	CorrelationIDRequired bool   `json:"-"`
}

func (*Message) MergeWith

func (msg *Message) MergeWith(spec Specification, msg2 Message)

func (*Message) Process

func (msg *Message) Process(name string, spec Specification)

type Operation

type Operation struct {
	Message Message `json:"message"`
}

type Parameter

type Parameter struct {
	Description string `json:"description"`
	Schema      *Any   `json:"schema"`
	Location    string `json:"location"`
	Reference   string `json:"$ref"`

	// Non AsyncAPI fields
	Name        string     `json:"-"`
	ReferenceTo *Parameter `json:"-"`
}

func (*Parameter) Process

func (p *Parameter) Process(name string, spec Specification)

type Specification

type Specification struct {
	Version    string              `json:"asyncapi"`
	Info       Info                `json:"info"`
	Channels   map[string]*Channel `json:"channels"`
	Components Components          `json:"components"`
}

func (Specification) GetPublishSubscribeCount

func (s Specification) GetPublishSubscribeCount() (publishCount, subscribeCount uint)

func (*Specification) Process

func (s *Specification) Process()

func (Specification) ReferenceAny

func (s Specification) ReferenceAny(ref string) *Any

func (Specification) ReferenceMessage

func (s Specification) ReferenceMessage(ref string) *Message

func (Specification) ReferenceParameter

func (s Specification) ReferenceParameter(ref string) *Parameter

Jump to

Keyboard shortcuts

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