Skip to main content

options.go

options.go - Overview

  1. Overview Defines the configuration options for connecting to a Redis server and provides a function to create default options.

  2. Detailed Documentation

Constants

  • defaultHost: The default Redis host (localhost).
  • defaultPort: The default Redis port (6379).
  • defaultPassword: The default Redis password (empty string).
  • defaultDB: The default Redis database (0).

type Options struct

  • Purpose: Represents the configuration options for connecting to a Redis server.
  • Members:
    • Host: string - The Redis host address.
    • Port: int - The Redis port number.
    • Password: string - The Redis password.
    • DB: int - The Redis database number.

func defaultOptions() *Options

  • Purpose: Creates and returns a pointer to an Options struct with default values.
  • Parameters: None
  • Returns: *Options - A pointer to an Options struct initialized with default values.

Include in Getting Started: NO