This directory contains samples for most CloudEvents sdk-go features. You can grab them and copy-paste in your project to start using sdk-go.
- AMQP
- AMQP Sender: Send events using the CloudEvents Client. To run the tests look at AMQP samples README.
- AMQP Receiver: Receive events using the CloudEvents Client. To run the tests look at AMQP samples README.
- Go channels
- Go channels example: Send and receive events using the CloudEvents Client. Useful for mocking purpose.
- HTTP:
- Receiver: Receive events using the CloudEvents Client.
- Direct receiver: Create an
http.Handler
to receive events without the CloudEvents Client. - Gin Gonic receiver: Receive events using Gin Gonic.
- Gorilla receiver: Receive events using Gorilla.
- Sleepy receiver: Receive events for 5 seconds, then stop the receiver.
- Traced receiver: Receive events enabling tracing.
- Requester: Request/Response events using the CloudEvents Client, creating them with different data content types and different encodings.
- Requester with custom client: Request/Response events with a custom
http.Transport
with TLS configured. - Responder: Receive and reply to events using the CloudEvents Client.
- Sender: Send events using the CloudEvents Client.
- Sender with retries: Send events, retrying in case of a failure.
- Receiver & Requester with metrics enabled: Request events and handle events with metrics enabled.
- Kafka
- Receiver: Receive events using the CloudEvents Client. To run the tests look at Kafka samples README.
- Sender: Receive events using the CloudEvents Client. To run the tests look at Kafka samples README.
- Sender & Receiver: Send and receive events using the same Kafka client. To run the tests look at Kafka samples README.
- Message
- Message interoperability: Pipe a message from an HTTP receiver directly to NATS using directly the
Protocol
s implementations. - Handle non CloudEvents: Pipe messages from one Kafka topic to another and transform non CloudEvents to valid CloudEvents.
- Message interoperability: Pipe a message from an HTTP receiver directly to NATS using directly the
- NATS
- STAN
- Receiver: Receive events using the CloudEvents Client.
- Sender: Receive events using the CloudEvents Client.
- Sender & Receiver: Send and receive events using the same NATS client.
- WebSockets
- Client: Sends and receive events, from client side, using the CloudEvents Client.