package api import ( "context" ) // Api is an abstraction for a messaging system that can be used to send // audit logs to the audit log system. type Api interface { // Send method will send the given data to the specified topic synchronously. // Parameters: // * ctx - the context object // * topic - the messaging topic where to send the data to // * data - the serialized data as byte array // * contentType - the contentType of the serialized data // * applicationProperties - properties to send with the message (i.e. cloud event headers) // // It returns technical errors for connection issues or sending problems. Send(ctx context.Context, topic string, data []byte, contentType string, applicationProperties map[string]any) error // Close the underlying connection to the messaging system. // Parameters: // * ctx - the context object // // It returns an error if the connection cannot be closed successfully Close(ctx context.Context) error }