Skip to content

pranjal5215/norse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

norse

See config file in gist here

####Code:

package main

import (
	"fmt"
	"github.com/goibibo/norse/backends"
	"github.com/goibibo/norse/config"
)

// Increment decrement functions
func incrFun(iKey string)error{return nil}
func decrFun(iKey string)error{return nil}

func main(){
	// See gist for sample config
	// Save config.json and set path to that path
	config.Configure(path)
	backends.Configure()

	// How to use redis,
	redisClient, _ := norse.GetRedisClient(incrFun, decrFun)
	value, _ := redisClient.Get("redisConfig", "key"))
	fmt.Println(value)


	// How to use memcache,
	memcacheClient, _ := norse.GetMemcacheClient(incrFun, decrFun)
	value, _ := memcacheClient.Get("configType", "key"))
	fmt.Println(value)


	// How to use MySQL,
	mysqlClient :=norse.GetMysqlClient(incrFunc,decrFunc,"mysql")
	// "mysql" database name;
	mysqlmap := mysqlClient.Select("select * from mytable")	
	fmt.Println(mysqlmap)

}

About

A light go wrapper over data stores

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages