Documentation ¶
Index ¶
- Constants
- func Decode(b []byte, dst interface{}) error
- type Channel
- type ChannelParameter
- type Describable
- type Document
- func (d Document) ApplicationPublishOperations() []asyncapi.Operation
- func (d Document) ApplicationPublishableChannels() []asyncapi.Channel
- func (d Document) ApplicationPublishableMessages() []asyncapi.Message
- func (d Document) ApplicationSubscribableChannels() []asyncapi.Channel
- func (d Document) ApplicationSubscribableMessages() []asyncapi.Message
- func (d Document) ApplicationSubscribeOperations() []asyncapi.Operation
- func (d Document) Channels() []asyncapi.Channel
- func (d Document) ClientPublishOperations() []asyncapi.Operation
- func (d Document) ClientPublishableChannels() []asyncapi.Channel
- func (d Document) ClientPublishableMessages() []asyncapi.Message
- func (d Document) ClientSubscribableChannels() []asyncapi.Channel
- func (d Document) ClientSubscribableMessages() []asyncapi.Message
- func (d Document) ClientSubscribeOperations() []asyncapi.Operation
- func (d Document) HasChannels() bool
- func (d Document) HasServers() bool
- func (d Document) Info() asyncapi.Info
- func (d Document) Messages() []asyncapi.Message
- func (d Document) Server(name string) (asyncapi.Server, bool)
- func (d Document) Servers() []asyncapi.Server
- type Extendable
- type FalsifiableSchema
- type Info
- type MapStructureDefaultsProvider
- type Message
- type Messages
- type Operation
- func (o Operation) HasSummary() bool
- func (o Operation) ID() string
- func (o Operation) IsApplicationPublishing() bool
- func (o Operation) IsApplicationSubscribing() bool
- func (o Operation) IsClientPublishing() bool
- func (o Operation) IsClientSubscribing() bool
- func (o Operation) Messages() []asyncapi.Message
- func (o Operation) Summary() string
- func (o Operation) Type() asyncapi.OperationType
- type PublishOperation
- type Schema
- func (s *Schema) AdditionalItems() asyncapi.FalsifiableSchema
- func (s *Schema) AdditionalProperties() asyncapi.FalsifiableSchema
- func (s *Schema) AllOf() []asyncapi.Schema
- func (s *Schema) AnyOf() []asyncapi.Schema
- func (s *Schema) CircularProps() []string
- func (s *Schema) Const() interface{}
- func (s *Schema) Contains() asyncapi.Schema
- func (s *Schema) ContentEncoding() string
- func (s *Schema) ContentMediaType() string
- func (s *Schema) Default() interface{}
- func (s *Schema) Definitions() map[string]asyncapi.Schema
- func (s *Schema) Dependencies() map[string]asyncapi.Schema
- func (s *Schema) Deprecated() bool
- func (s *Schema) Description() string
- func (s *Schema) Discriminator() string
- func (s *Schema) Else() asyncapi.Schema
- func (s *Schema) Enum() []interface{}
- func (s *Schema) Examples() []interface{}
- func (s *Schema) ExclusiveMaximum() *float64
- func (s *Schema) ExclusiveMinimum() *float64
- func (s *Schema) Format() string
- func (s *Schema) HasCircularProps() bool
- func (s *Schema) ID() string
- func (s *Schema) If() asyncapi.Schema
- func (s *Schema) IsCircular() bool
- func (s *Schema) Items() []asyncapi.Schema
- func (s *Schema) MaxItems() *float64
- func (s *Schema) MaxLength() *float64
- func (s *Schema) MaxProperties() *float64
- func (s *Schema) Maximum() *float64
- func (s *Schema) MinItems() *float64
- func (s *Schema) MinLength() *float64
- func (s *Schema) MinProperties() *float64
- func (s *Schema) Minimum() *float64
- func (s *Schema) MultipleOf() *float64
- func (s *Schema) Not() asyncapi.Schema
- func (s *Schema) OneOf() []asyncapi.Schema
- func (s *Schema) Pattern() string
- func (s *Schema) PatternProperties() map[string]asyncapi.Schema
- func (s *Schema) Properties() map[string]asyncapi.Schema
- func (s *Schema) Property(name string) asyncapi.Schema
- func (s *Schema) PropertyNames() asyncapi.Schema
- func (s *Schema) ReadOnly() bool
- func (s *Schema) Required() []string
- func (s *Schema) Then() asyncapi.Schema
- func (s *Schema) Title() string
- func (s *Schema) Type() []string
- func (s *Schema) UID() string
- func (s *Schema) UniqueItems() bool
- func (s *Schema) WriteOnly() bool
- type Schemas
- type Server
- func (s Server) HasName() bool
- func (s Server) HasProtocol() bool
- func (s Server) HasURL() bool
- func (s Server) ID() string
- func (s Server) IDField() string
- func (s Server) Name() string
- func (s Server) Protocol() string
- func (s Server) URL() string
- func (s Server) Variables() []asyncapi.ServerVariable
- type ServerVariable
- type SubscribeOperation
Constants ¶
View Source
const ( OperationTypePublish asyncapi.OperationType = "publish" OperationTypeSubscribe asyncapi.OperationType = "subscribe" )
Constants for Operation Types.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Channel ¶
type Channel struct { Extendable Describable `mapstructure:",squash"` PathField string `mapstructure:"path" json:"path"` ParametersField map[string]ChannelParameter `mapstructure:"parameters" json:"parameters"` Subscribe *SubscribeOperation `mapstructure:"subscribe" json:"subscribe"` Publish *PublishOperation `mapstructure:"publish" json:"publish"` }
func NewChannel ¶
NewChannel creates a new Channel. Useful for testing.
func (Channel) HasParameters ¶
func (Channel) Operations ¶
func (Channel) Parameters ¶
func (c Channel) Parameters() []asyncapi.ChannelParameter
type ChannelParameter ¶
type ChannelParameter struct { Extendable Describable NameField string `mapstructure:"name"` SchemaField *Schema `mapstructure:"schema"` }
func (ChannelParameter) ID ¶
func (c ChannelParameter) ID() string
func (ChannelParameter) IDField ¶
func (c ChannelParameter) IDField() string
func (ChannelParameter) Name ¶
func (c ChannelParameter) Name() string
func (ChannelParameter) Schema ¶
func (c ChannelParameter) Schema() asyncapi.Schema
type Describable ¶
type Describable struct {
DescriptionField string `mapstructure:"description" json:"description"`
}
func (Describable) Description ¶
func (d Describable) Description() string
func (Describable) HasDescription ¶
func (d Describable) HasDescription() bool
type Document ¶
type Document struct { Extendable InfoField Info `mapstructure:"info" json:"info"` ServersField map[string]Server `mapstructure:"servers" json:"servers"` ChannelsField map[string]Channel `mapstructure:"channels" json:"channels"` }
func (Document) ApplicationPublishOperations ¶
func (Document) ApplicationPublishableChannels ¶
func (Document) ApplicationPublishableMessages ¶
func (Document) ApplicationSubscribableChannels ¶
func (Document) ApplicationSubscribableMessages ¶
func (Document) ApplicationSubscribeOperations ¶
func (Document) ClientPublishOperations ¶
func (Document) ClientPublishableChannels ¶
func (Document) ClientPublishableMessages ¶
func (Document) ClientSubscribableChannels ¶
func (Document) ClientSubscribableMessages ¶
func (Document) ClientSubscribeOperations ¶
func (Document) HasChannels ¶
func (Document) HasServers ¶
type Extendable ¶
type Extendable struct {
Raw map[string]interface{} `mapstructure:",remain" json:"-"`
}
func (Extendable) Extension ¶
func (e Extendable) Extension(name string) interface{}
func (Extendable) HasExtension ¶
func (e Extendable) HasExtension(name string) bool
type FalsifiableSchema ¶
type FalsifiableSchema struct {
// contains filtered or unexported fields
}
func NewFalsifiableSchema ¶
func NewFalsifiableSchema(val interface{}) *FalsifiableSchema
NewFalsifiableSchema creates a new FalsifiableSchema.
func (FalsifiableSchema) IsFalse ¶
func (f FalsifiableSchema) IsFalse() bool
func (FalsifiableSchema) IsSchema ¶
func (f FalsifiableSchema) IsSchema() bool
func (FalsifiableSchema) Schema ¶
func (f FalsifiableSchema) Schema() asyncapi.Schema
type Info ¶
type MapStructureDefaultsProvider ¶
type MapStructureDefaultsProvider interface {
MapStructureDefaults() map[string]interface{}
}
MapStructureDefaultsProvider tells to mapstructure setDefaultsHook the defaults value for that type.
type Message ¶
type Message struct { Extendable Describable `mapstructure:",squash"` NameField string `mapstructure:"name" json:"name"` TitleField string `mapstructure:"title" json:"title"` SummaryField string `mapstructure:"summary" json:"summary"` ContentTypeField string `mapstructure:"contentType" json:"contentType"` PayloadField *Schema `mapstructure:"payload" json:"payload"` }
func (Message) ContentType ¶
func (Message) HasSummary ¶
type Messages ¶
type Messages struct { Message `mapstructure:",squash"` OneOfField []*Message `mapstructure:"oneOf" json:"oneOf"` }
Messages is a variadic type for Message object, which can be either one message or oneOf. See https://www.asyncapi.com/docs/specifications/v2.0.0#operationObject.
type Operation ¶
type Operation struct { Extendable Describable `mapstructure:",squash"` OperationIDField string `mapstructure:"operationId" json:"operationId"` MessageField Messages `mapstructure:"message" json:"message"` OperationType asyncapi.OperationType `mapstructure:"operationType" json:"operationType"` // set by hook SummaryField string `mapstructure:"summary" json:"summary"` }
func NewOperation ¶
func NewOperation(operationType asyncapi.OperationType, msgs ...*Message) *Operation
NewOperation creates a new Operation. Useful for testing.
func (Operation) HasSummary ¶
func (Operation) IsApplicationPublishing ¶
func (Operation) IsApplicationSubscribing ¶
func (Operation) IsClientPublishing ¶
func (Operation) IsClientSubscribing ¶
func (Operation) Type ¶
func (o Operation) Type() asyncapi.OperationType
type PublishOperation ¶
type PublishOperation struct {
Operation
}
func NewPublishOperation ¶
func NewPublishOperation(msgs ...*Message) *PublishOperation
NewPublishOperation creates a new PublishOperation. Useful for testing.
func (PublishOperation) MapStructureDefaults ¶
func (o PublishOperation) MapStructureDefaults() map[string]interface{}
type Schema ¶
type Schema struct { Extendable AdditionalItemsField interface{} `mapstructure:"additionalItems" json:"additionalItems,omitempty"` AdditionalPropertiesField interface{} `mapstructure:"additionalProperties" json:"additionalProperties,omitempty"` // Schema || false AllOfField []asyncapi.Schema `mapstructure:"allOf" json:"allOf,omitempty"` AnyOfField []asyncapi.Schema `mapstructure:"anyOf" json:"anyOf,omitempty"` ConstField interface{} `mapstructure:"const" json:"const,omitempty"` ContainsField *Schema `mapstructure:"contains" json:"contains,omitempty"` ContentEncodingField string `mapstructure:"contentEncoding" json:"contentEncoding,omitempty"` ContentMediaTypeField string `mapstructure:"contentMediaType" json:"contentMediaType,omitempty"` DefaultField interface{} `mapstructure:"default" json:"default,omitempty"` DefinitionsField Schemas `mapstructure:"definitions" json:"definitions,omitempty"` DependenciesField Schemas `mapstructure:"dependencies" json:"dependencies,omitempty"` DeprecatedField bool `mapstructure:"deprecated" json:"deprecated,omitempty"` DescriptionField string `mapstructure:"description" json:"description,omitempty"` DiscriminatorField string `mapstructure:"discriminator" json:"discriminator,omitempty"` ElseField *Schema `mapstructure:"else" json:"else,omitempty"` EnumField []interface{} `mapstructure:"enum" json:"enum,omitempty"` ExamplesField []interface{} `mapstructure:"examples" json:"examples,omitempty"` ExclusiveMaximumField *float64 `mapstructure:"exclusiveMaximum" json:"exclusiveMaximum,omitempty"` ExclusiveMinimumField *float64 `mapstructure:"exclusiveMinimum" json:"exclusiveMinimum,omitempty"` FormatField string `mapstructure:"format" json:"format,omitempty"` IDField string `mapstructure:"$id" json:"$id,omitempty"` IfField *Schema `mapstructure:"if" json:"if,omitempty"` ItemsField []asyncapi.Schema `mapstructure:"items" json:"items,omitempty"` MaximumField *float64 `mapstructure:"maximum" json:"maximum,omitempty"` MaxItemsField *float64 `mapstructure:"maxItems" json:"maxItems,omitempty"` MaxLengthField *float64 `mapstructure:"maxLength" json:"maxLength,omitempty"` MaxPropertiesField *float64 `mapstructure:"maxProperties" json:"maxProperties,omitempty"` MinimumField *float64 `mapstructure:"minimum" json:"minimum,omitempty"` MinItemsField *float64 `mapstructure:"minItems" json:"minItems,omitempty"` MinLengthField *float64 `mapstructure:"minLength" json:"minLength,omitempty"` MinPropertiesField *float64 `mapstructure:"minProperties" json:"minProperties,omitempty"` MultipleOfField *float64 `mapstructure:"multipleOf" json:"multipleOf,omitempty"` NotField *Schema `mapstructure:"not" json:"not,omitempty"` OneOfField []asyncapi.Schema `mapstructure:"oneOf" json:"oneOf,omitempty"` PatternField string `mapstructure:"pattern" json:"pattern,omitempty"` PatternPropertiesField Schemas `mapstructure:"patternProperties" json:"patternProperties,omitempty"` PropertiesField Schemas `mapstructure:"properties" json:"properties,omitempty"` PropertyNamesField *Schema `mapstructure:"propertyNames" json:"propertyNames,omitempty"` ReadOnlyField bool `mapstructure:"readOnly" json:"readOnly,omitempty"` RequiredField []string `mapstructure:"required" json:"required,omitempty"` ThenField *Schema `mapstructure:"then" json:"then,omitempty"` TitleField string `mapstructure:"title" json:"title,omitempty"` TypeField interface{} `mapstructure:"type" json:"type,omitempty"` // string | []string UniqueItemsField bool `mapstructure:"uniqueItems" json:"uniqueItems,omitempty"` WriteOnlyField bool `mapstructure:"writeOnly" json:"writeOnly,omitempty"` // contains filtered or unexported fields }
func (*Schema) AdditionalItems ¶
func (s *Schema) AdditionalItems() asyncapi.FalsifiableSchema
func (*Schema) AdditionalProperties ¶
func (s *Schema) AdditionalProperties() asyncapi.FalsifiableSchema
func (*Schema) CircularProps ¶
func (*Schema) ContentEncoding ¶
func (*Schema) ContentMediaType ¶
func (*Schema) Deprecated ¶
func (*Schema) Description ¶
func (*Schema) Discriminator ¶
func (*Schema) ExclusiveMaximum ¶
func (*Schema) ExclusiveMinimum ¶
func (*Schema) HasCircularProps ¶
func (*Schema) IsCircular ¶
func (*Schema) MaxProperties ¶
func (*Schema) MinProperties ¶
func (*Schema) MultipleOf ¶
func (*Schema) PropertyNames ¶
func (*Schema) UniqueItems ¶
type Server ¶
type Server struct { Extendable Describable `mapstructure:",squash"` NameField string `mapstructure:"name" json:"name"` ProtocolField string `mapstructure:"protocol" json:"protocol"` URLField string `mapstructure:"url" json:"url"` VariablesField map[string]ServerVariable `mapstructure:"variables" json:"variables"` }
func (Server) HasProtocol ¶
func (Server) Variables ¶
func (s Server) Variables() []asyncapi.ServerVariable
type ServerVariable ¶
type ServerVariable struct { Extendable NameField string `mapstructure:"name" json:"name"` Default string `mapstructure:"default" json:"default"` Enum []string `mapstructure:"enum" json:"enum"` }
func (ServerVariable) AllowedValues ¶
func (s ServerVariable) AllowedValues() []string
func (ServerVariable) DefaultValue ¶
func (s ServerVariable) DefaultValue() string
func (ServerVariable) HasName ¶
func (s ServerVariable) HasName() bool
func (ServerVariable) ID ¶
func (s ServerVariable) ID() string
func (ServerVariable) IDField ¶
func (s ServerVariable) IDField() string
func (ServerVariable) Name ¶
func (s ServerVariable) Name() string
type SubscribeOperation ¶
type SubscribeOperation struct {
Operation
}
func NewSubscribeOperation ¶
func NewSubscribeOperation(msgs ...*Message) *SubscribeOperation
NewSubscribeOperation creates a new SubscribeOperation. Useful for testing.
func (SubscribeOperation) MapStructureDefaults ¶
func (o SubscribeOperation) MapStructureDefaults() map[string]interface{}
Click to show internal directories.
Click to hide internal directories.