server

package
v0.0.169 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const Type = "redis-server"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Address string `yaml:"address" default:"redis://localhost:6379/0"`
	Prefix  string `yaml:"prefix" default:"xatu"`
}

func (*Config) Validate

func (c *Config) Validate() error

type Metrics

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

func NewMetrics

func NewMetrics(namespace string) *Metrics

func (*Metrics) AddDelete

func (m *Metrics) AddDelete(count int, cacheType, status string)

func (*Metrics) AddGet

func (m *Metrics) AddGet(count int, cacheType, status string)

func (*Metrics) AddSet

func (m *Metrics) AddSet(count int, cacheType, status string)

type Server

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

func New

func New(config *Config, log logrus.FieldLogger) (*Server, error)

func (*Server) Delete

func (s *Server) Delete(ctx context.Context, key string) error

func (*Server) Get

func (s *Server) Get(ctx context.Context, key string) (*string, error)

func (*Server) GetAndDelete

func (s *Server) GetAndDelete(ctx context.Context, key string) (deletedValue *string, exists bool, err error)

func (*Server) GetOrSet

func (s *Server) GetOrSet(ctx context.Context, key, value string, ttl time.Duration) (storedValue *string, retrieved bool, err error)

func (*Server) Set

func (s *Server) Set(ctx context.Context, key, value string, ttl time.Duration) error

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

func (*Server) Stop

func (s *Server) Stop(ctx context.Context) error

func (*Server) Type

func (s *Server) Type() string

Jump to

Keyboard shortcuts

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