redisutil

package module
v0.0.0-...-ec77967 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2016 License: MIT Imports: 6 Imported by: 2

README

Example usage of redisutil

package main

import "github.com/uccmen/redisutil"

var redisInstance *util.RedisInstance

func init() {
  redisInstance = redisutil.NewRedis()
}

func isThingieExists(thingie string) bool {
  conn := redisInstance.DB().Get()
  defer conn.Close()

  thingieKey := "thingie-hash:" + thingie

  out, err := conn.Do("GET", thingieKey)
  if err != nil {
    return false
  }

  if out != nil {
    return true
  }

  return false
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisInstance

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

func NewRedis

func NewRedis() *RedisInstance

func (*RedisInstance) DB

func (r *RedisInstance) DB() *redis.Pool

Jump to

Keyboard shortcuts

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