func WriteStructured(ctx context.Context, m binding.Message, writer io.Writer, transformers ...binding.Transformer) error {
	_, err := binding.Write(
		ctx,
		m,
		wsMessageWriter{writer},
		nil,
		transformers...,
	)
	return err
}
WriteStructured fills the provided io.Writer with the binding.Message m in structured mode.
Using context you can tweak the encoding processing (more details on binding.Write documentation).
package utils
import (
	"context"
	"io"
	"github.com/cloudevents/sdk-go/v2/binding"
	"github.com/cloudevents/sdk-go/v2/binding/format"
)