Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/marknown/oredis

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/marknown/oredis

  • v1.0.0
  • Source
  • Go
  • Socket score

Version published
Created
Source

oredis

oredis is a init for redigo with pool

Redis Config

type Config struct {
    Network        string // TCP
    Host           string
    Port           int
    Password       string
    DB             int
    Timeout        int
    MaxActive      int  // 最大连接数,即最多的tcp连接数
    MaxIdle        int  // 最大空闲连接数,即会有这么多个连接提前等待着
    MaxIdleTimeout int  // 空闲连接超时时间
    Wait           bool // 如果超过最大连接,是报错,还是等待。true 为等待,false为报错
}

example

config := &Config{
    Network       : "tcp",
    Host          : "127.0.0.1",
    Port          : 6379,
    Password      : "",
    DB            : 0,
    Timeout       : 5,
    MaxActive     : 100,
    MaxIdle       : 50,
    MaxIdleTimeout: 5,
    Wait          : true
}

GetInstance function

func GetInstance(config Config) redis.Conn {
}

Usage

    redis := oredis.GetInstance(config)

FAQs

Package last updated on 20 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc