disk

package
v3.24.0-beta.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name = "disk"

	Jitter = 0.1
)

Variables

View Source
var Connections = &Writer{
	openConnections:              make(map[string]Connection),
	closedConnections:            make(map[string]FailedConnection),
	cleanupDone:                  make(chan struct{}),
	closeAndRemoveFilesWithRetry: closeAndRemoveFilesWithRetry,
}

Functions

This section is empty.

Types

type Connection

type Connection struct {
	// path to store audit logs
	Path string `json:"path,omitempty"`
	// max number of audit results to store
	MaxAuditResults int `json:"maxAuditResults,omitempty"`
	// ClosedConnectionTTL specifies how long a failed connection remains
	// in the cleanup queue before being permanently removed (not retried).
	// This prevents memory leaks from accumulating failed connections.
	ClosedConnectionTTL time.Duration `json:"closedConnectionTTL,omitempty"`
	// File to write audit logs
	File *os.File
	// contains filtered or unexported fields
}

type FailedConnection

type FailedConnection struct {
	Connection
	FailedAt    time.Time
	RetryCount  int
	NextRetryAt time.Time
}

FailedConnection wraps a Connection with retry metadata.

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

func (*Writer) CloseConnection

func (r *Writer) CloseConnection(connectionName string) error

func (*Writer) CreateConnection

func (r *Writer) CreateConnection(_ context.Context, connectionName string, config interface{}) error

func (*Writer) Publish

func (r *Writer) Publish(ctx context.Context, connectionName string, data interface{}, topic string) error

func (*Writer) UpdateConnection

func (r *Writer) UpdateConnection(_ context.Context, connectionName string, config interface{}) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL