redis

package
v0.0.0-...-b5fa026 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Copyright 2024 Robert Cronin

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init()

Init creates a new global Redis client

func New

func New(cfg Config) (*redis.Client, error)

New creates a new Redis client

Types

type Config

type Config struct {
	Host     string
	Port     int
	Password string
	DB       int
}

Config holds the configuration for Redis

type FiberClient

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

Implements fiber.Storage

func NewFiberClient

func NewFiberClient(keyPrefix string) *FiberClient

NewFiberClient creates a new FiberClient

func (*FiberClient) Close

func (f *FiberClient) Close() error

Close implements fiber.Storage::Close

func (*FiberClient) Delete

func (f *FiberClient) Delete(key string) error

Delete implements fiber.Storage::Delete

func (*FiberClient) Get

func (f *FiberClient) Get(key string) ([]byte, error)

Get implements fiber.Storage::Get

func (*FiberClient) Reset

func (f *FiberClient) Reset() error

Reset implements fiber.Storage::Reset

func (*FiberClient) Set

func (f *FiberClient) Set(key string, val []byte, exp time.Duration) error

Set implements fiber.Storage::Set

Jump to

Keyboard shortcuts

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