Documentation
¶
Overview ¶
Package "issue97" provides primitives to interact with the AsyncAPI specification.
Code generated by github.com/lerenn/asyncapi-codegen version (devel) DO NOT EDIT.
Index ¶
- Constants
- Variables
- func CheckGeneration()
- type AppController
- func (c *AppController) Close(ctx context.Context)
- func (c *AppController) PublishV2Issue97ReferencePayloadArray(ctx context.Context, msg ReferencePayloadArrayMessage) error
- func (c *AppController) PublishV2Issue97ReferencePayloadObject(ctx context.Context, msg ReferencePayloadObjectMessage) error
- func (c *AppController) PublishV2Issue97ReferencePayloadString(ctx context.Context, msg ReferencePayloadStringMessage) error
- type ArraySchema
- type ControllerOption
- type Error
- type MessageWithCorrelationID
- type ObjectSchema
- type ReferencePayloadArrayMessage
- type ReferencePayloadObjectMessage
- type ReferencePayloadStringMessage
- type StringSchema
- type UserController
- func (c *UserController) Close(ctx context.Context)
- func (c *UserController) SubscribeAll(ctx context.Context, as UserSubscriber) error
- func (c *UserController) SubscribeV2Issue97ReferencePayloadArray(ctx context.Context, ...) error
- func (c *UserController) SubscribeV2Issue97ReferencePayloadObject(ctx context.Context, ...) error
- func (c *UserController) SubscribeV2Issue97ReferencePayloadString(ctx context.Context, ...) error
- func (c *UserController) UnsubscribeAll(ctx context.Context)
- func (c *UserController) UnsubscribeV2Issue97ReferencePayloadArray(ctx context.Context)
- func (c *UserController) UnsubscribeV2Issue97ReferencePayloadObject(ctx context.Context)
- func (c *UserController) UnsubscribeV2Issue97ReferencePayloadString(ctx context.Context)
- type UserSubscriber
Constants ¶
const ( // V2Issue97ReferencePayloadArrayPath is the constant representing the 'V2Issue97ReferencePayloadArray' channel path. V2Issue97ReferencePayloadArrayPath = "v2.issue97.referencePayloadArray" // V2Issue97ReferencePayloadObjectPath is the constant representing the 'V2Issue97ReferencePayloadObject' channel path. V2Issue97ReferencePayloadObjectPath = "v2.issue97.referencePayloadObject" // V2Issue97ReferencePayloadStringPath is the constant representing the 'V2Issue97ReferencePayloadString' channel path. V2Issue97ReferencePayloadStringPath = "v2.issue97.referencePayloadString" )
const AsyncAPIVersion = "1.0.0"
AsyncAPIVersion is the version of the used AsyncAPI document
Variables ¶
var ChannelsPaths = []string{ V2Issue97ReferencePayloadArrayPath, V2Issue97ReferencePayloadObjectPath, V2Issue97ReferencePayloadStringPath, }
ChannelsPaths is an array of all channels paths
Functions ¶
func CheckGeneration ¶ added in v0.35.3
func CheckGeneration()
CheckGeneration is just to test that the generation is correct.
Types ¶
type AppController ¶
type AppController struct {
// contains filtered or unexported fields
}
AppController is the structure that provides publishing capabilities to the developer and and connect the broker with the App
func NewAppController ¶
func NewAppController(bc extensions.BrokerController, options ...ControllerOption) (*AppController, error)
NewAppController links the App to the broker
func (*AppController) Close ¶
func (c *AppController) Close(ctx context.Context)
Close will clean up any existing resources on the controller
func (*AppController) PublishV2Issue97ReferencePayloadArray ¶ added in v0.35.2
func (c *AppController) PublishV2Issue97ReferencePayloadArray( ctx context.Context, msg ReferencePayloadArrayMessage, ) error
PublishV2Issue97ReferencePayloadArray will publish messages to 'v2.issue97.referencePayloadArray' channel
func (*AppController) PublishV2Issue97ReferencePayloadObject ¶ added in v0.35.2
func (c *AppController) PublishV2Issue97ReferencePayloadObject( ctx context.Context, msg ReferencePayloadObjectMessage, ) error
PublishV2Issue97ReferencePayloadObject will publish messages to 'v2.issue97.referencePayloadObject' channel
func (*AppController) PublishV2Issue97ReferencePayloadString ¶ added in v0.35.2
func (c *AppController) PublishV2Issue97ReferencePayloadString( ctx context.Context, msg ReferencePayloadStringMessage, ) error
PublishV2Issue97ReferencePayloadString will publish messages to 'v2.issue97.referencePayloadString' channel
type ArraySchema ¶
type ArraySchema []string
ArraySchema is a schema from the AsyncAPI specification required in messages
type ControllerOption ¶
type ControllerOption func(controller *controller)
ControllerOption is the type of the options that can be passed when creating a new Controller
func WithErrorHandler ¶ added in v0.35.0
func WithErrorHandler(handler extensions.ErrorHandler) ControllerOption
WithErrorHandler attaches a errorhandler to handle errors from subscriber functions
func WithLogger ¶
func WithLogger(logger extensions.Logger) ControllerOption
WithLogger attaches a logger to the controller
func WithMiddlewares ¶
func WithMiddlewares(middlewares ...extensions.Middleware) ControllerOption
WithMiddlewares attaches middlewares that will be executed when sending or receiving messages
type ObjectSchema ¶
type ObjectSchema struct {
Text *string `json:"text"`
}
ObjectSchema is a schema from the AsyncAPI specification required in messages
type ReferencePayloadArrayMessage ¶
type ReferencePayloadArrayMessage struct { // Payload will be inserted in the message payload Payload ArraySchema }
ReferencePayloadArrayMessage is the message expected for 'ReferencePayloadArrayMessage' channel.
func NewReferencePayloadArrayMessage ¶
func NewReferencePayloadArrayMessage() ReferencePayloadArrayMessage
type ReferencePayloadObjectMessage ¶
type ReferencePayloadObjectMessage struct { // Payload will be inserted in the message payload Payload ObjectSchema }
ReferencePayloadObjectMessage is the message expected for 'ReferencePayloadObjectMessage' channel.
func NewReferencePayloadObjectMessage ¶
func NewReferencePayloadObjectMessage() ReferencePayloadObjectMessage
type ReferencePayloadStringMessage ¶
type ReferencePayloadStringMessage struct { // Payload will be inserted in the message payload Payload StringSchema }
ReferencePayloadStringMessage is the message expected for 'ReferencePayloadStringMessage' channel.
func NewReferencePayloadStringMessage ¶
func NewReferencePayloadStringMessage() ReferencePayloadStringMessage
type StringSchema ¶
type StringSchema string
StringSchema is a schema from the AsyncAPI specification required in messages
type UserController ¶
type UserController struct {
// contains filtered or unexported fields
}
UserController is the structure that provides publishing capabilities to the developer and and connect the broker with the User
func NewUserController ¶
func NewUserController(bc extensions.BrokerController, options ...ControllerOption) (*UserController, error)
NewUserController links the User to the broker
func (*UserController) Close ¶
func (c *UserController) Close(ctx context.Context)
Close will clean up any existing resources on the controller
func (*UserController) SubscribeAll ¶
func (c *UserController) SubscribeAll(ctx context.Context, as UserSubscriber) error
SubscribeAll will subscribe to channels without parameters on which the app is expecting messages. For channels with parameters, they should be subscribed independently.
func (*UserController) SubscribeV2Issue97ReferencePayloadArray ¶ added in v0.35.2
func (c *UserController) SubscribeV2Issue97ReferencePayloadArray( ctx context.Context, fn func(ctx context.Context, msg ReferencePayloadArrayMessage) error, ) error
SubscribeV2Issue97ReferencePayloadArray will subscribe to new messages from 'v2.issue97.referencePayloadArray' channel.
Callback function 'fn' will be called each time a new message is received.
func (*UserController) SubscribeV2Issue97ReferencePayloadObject ¶ added in v0.35.2
func (c *UserController) SubscribeV2Issue97ReferencePayloadObject( ctx context.Context, fn func(ctx context.Context, msg ReferencePayloadObjectMessage) error, ) error
SubscribeV2Issue97ReferencePayloadObject will subscribe to new messages from 'v2.issue97.referencePayloadObject' channel.
Callback function 'fn' will be called each time a new message is received.
func (*UserController) SubscribeV2Issue97ReferencePayloadString ¶ added in v0.35.2
func (c *UserController) SubscribeV2Issue97ReferencePayloadString( ctx context.Context, fn func(ctx context.Context, msg ReferencePayloadStringMessage) error, ) error
SubscribeV2Issue97ReferencePayloadString will subscribe to new messages from 'v2.issue97.referencePayloadString' channel.
Callback function 'fn' will be called each time a new message is received.
func (*UserController) UnsubscribeAll ¶
func (c *UserController) UnsubscribeAll(ctx context.Context)
UnsubscribeAll will unsubscribe all remaining subscribed channels
func (*UserController) UnsubscribeV2Issue97ReferencePayloadArray ¶ added in v0.35.2
func (c *UserController) UnsubscribeV2Issue97ReferencePayloadArray(ctx context.Context)
UnsubscribeV2Issue97ReferencePayloadArray will unsubscribe messages from 'v2.issue97.referencePayloadArray' channel. A timeout can be set in context to avoid blocking operation, if needed.
func (*UserController) UnsubscribeV2Issue97ReferencePayloadObject ¶ added in v0.35.2
func (c *UserController) UnsubscribeV2Issue97ReferencePayloadObject(ctx context.Context)
UnsubscribeV2Issue97ReferencePayloadObject will unsubscribe messages from 'v2.issue97.referencePayloadObject' channel. A timeout can be set in context to avoid blocking operation, if needed.
func (*UserController) UnsubscribeV2Issue97ReferencePayloadString ¶ added in v0.35.2
func (c *UserController) UnsubscribeV2Issue97ReferencePayloadString(ctx context.Context)
UnsubscribeV2Issue97ReferencePayloadString will unsubscribe messages from 'v2.issue97.referencePayloadString' channel. A timeout can be set in context to avoid blocking operation, if needed.
type UserSubscriber ¶
type UserSubscriber interface { // V2Issue97ReferencePayloadArray subscribes to messages placed on the 'v2.issue97.referencePayloadArray' channel V2Issue97ReferencePayloadArray(ctx context.Context, msg ReferencePayloadArrayMessage) error // V2Issue97ReferencePayloadObject subscribes to messages placed on the 'v2.issue97.referencePayloadObject' channel V2Issue97ReferencePayloadObject(ctx context.Context, msg ReferencePayloadObjectMessage) error // V2Issue97ReferencePayloadString subscribes to messages placed on the 'v2.issue97.referencePayloadString' channel V2Issue97ReferencePayloadString(ctx context.Context, msg ReferencePayloadStringMessage) error }
UserSubscriber represents all handlers that are expecting messages for User