mirror of
https://dev.azure.com/schwarzit/schwarzit.stackit-public/_git/audit-go
synced 2026-02-08 00:57:24 +00:00
28 lines
981 B
Go
28 lines
981 B
Go
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
|
|
}
|