redis

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigToken = gioc.NewToken("RedisConfig")
View Source
var Module = gioc.NewModule("RedisModule").
	Global().
	Provide(
		gioc.FactoryProvider(
			ServiceToken,
			gioc.NewFactory(
				ServiceInjections,
				gioc.Singleton,
				NewService,
			),
			true,
		),
	)
View Source
var ServiceInjections = react.InjectFromBase(ConfigToken)
View Source
var ServiceToken = gioc.NewToken("RedisService")

Functions

This section is empty.

Types

type Config

type Config struct {
	URL string `env:"REDIS_URL"`
}

type Service

type Service struct {
	react.BaseConfigurableService[*Config]
	// contains filtered or unexported fields
}

func NewService

func NewService(injections gioc.Injections) (*Service, error)

func (*Service) Add

func (service *Service) Add(key string, members ...any) (int64, error)

func (*Service) Delete

func (service *Service) Delete(keys ...string) error

func (*Service) Drop

func (service *Service) Drop(key string, members ...any) (int64, error)

func (*Service) Get

func (service *Service) Get(key string) (string, bool, error)

func (*Service) GetBool

func (service *Service) GetBool(key string) (bool, bool, error)

func (*Service) IncludesMany

func (service *Service) IncludesMany(key string, members ...string) ([]bool, error)

func (*Service) IncludesOne

func (service *Service) IncludesOne(key string, member any) (bool, error)

func (*Service) Keys

func (service *Service) Keys(template string) ([]string, error)

func (*Service) Scan

func (service *Service) Scan(template string, count int64) ([]string, error)

func (*Service) Set

func (service *Service) Set(key string, value any, ttl time.Duration) error

func (*Service) SetIfNotExists

func (service *Service) SetIfNotExists(key string, value any, ttl time.Duration) (bool, error)

func (*Service) Size

func (service *Service) Size(key string) (int64, error)

Jump to

Keyboard shortcuts

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