Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bucket ¶
Bucket holds key value pairs to log, it can hold other Bucket's to implement groups.
type BucketConfig ¶
type BucketConfig struct {
// Logger used to log with context
Logger *slog.Logger
// Allocated Capacity for a new bucket, this is sent to 'make' as
// the Capacity for internal maps. i.e. make(map[string]any, Capacity)
Capacity int
}
BucketConfig stores the configuration options used to create a new internal map where key / values will be stored.
func DefaultBucketConfig ¶
func DefaultBucketConfig() *BucketConfig
Generate default values for a BucketConfig.
type BucketConfigurator ¶
type BucketConfigurator = func(c *BucketConfig)
BucketConfigurator mutates the configuration to create a new internal map where key / values will be stored.
func WithCapacity ¶
func WithCapacity(capacity int) BucketConfigurator
WithCapacity modifies the default capacity for a bucket. Returns a BucketConfigurator with the given capacity.
func WithLogger ¶
func WithLogger(logger *slog.Logger) BucketConfigurator
WithLogger modifies the default logger for a bucket. Returns a BucketConfigurator with the given logger.
Click to show internal directories.
Click to hide internal directories.