cache

package
v0.0.0-...-32e545c Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Get(ctx context.Context, key string) (string, error)
	Set(ctx context.Context, key string, value string) error
}

Cache is an interface that defines cache operations

func New

func New(ctx context.Context, conf *Config) (Cache, error)
New is a factory function that returns Cache interface

it returns Cache interface if success it returns error if failed

type Config

type Config struct {
	DriverName string `json:"driver_name" yaml:"driver_name"`
	Host       string `json:"host" yaml:"host"`
	Port       int    `json:"port" yaml:"port"`
	Username   string `json:"username" yaml:"username"`
	Password   string `json:"password" yaml:"password"`
	DB         int    `json:"db" yaml:"db"`
}

Config is a struct that defines cache config

Jump to

Keyboard shortcuts

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