config

package
v2.331.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package config provides cache configuration types for go-service.

This package contains configuration structs that are typically embedded into a larger service configuration and then consumed by the cache wiring in `github.com/alexfalkowski/go-service/v2/cache`.

Start with `Config`.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Options contains implementation-specific configuration for the selected Kind.
	//
	// The interpretation of this map depends on the cache backend implementation.
	Options map[string]any `yaml:"options,omitempty" json:"options,omitempty" toml:"options,omitempty"`

	// Kind selects the cache backend implementation (for example "redis", "valkey", or "noop"),
	// depending on which implementations are compiled/registered by the service.
	Kind string `yaml:"kind,omitempty" json:"kind,omitempty" toml:"kind,omitempty"`

	// Compressor selects the compression algorithm used for cached values (if supported by the implementation).
	Compressor string `yaml:"compressor,omitempty" json:"compressor,omitempty" toml:"compressor,omitempty"`

	// Encoder selects the value encoding used when storing objects in the cache (if applicable).
	Encoder string `yaml:"encoder,omitempty" json:"encoder,omitempty" toml:"encoder,omitempty"`
}

Config configures the cache subsystem.

func (*Config) IsEnabled added in v2.115.0

func (c *Config) IsEnabled() bool

IsEnabled reports whether caching is enabled.

Jump to

Keyboard shortcuts

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