nrradix

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

README

nrradix

Go Reference

A wrapper with New Relic instrumentation for mediocregopher/radix v3.

Getting Started

import "github.com/nobuyo/nrradix"
Run Simple Command
txn := ... // Your *newrelic.Transaction
pool, err := nrradix.NewPool("tcp", url, poolSize)
if nil != err {
    fmt.Println(err)
    os.Exit(1)
}

pool.Do(txn, nil, "SET", 1)
Run Pipeline
var commands []nrradix.CmdElement

commands = append(commands, nrradix.NewCmdElement(nil, "SET", "FOO"))
commands = append(commands, nrradix.NewCmdElement(nil, "SET", "BAR"))

pool.DoPipeline(txn, commands)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CmdElement added in v0.2.0

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

CmdElement ...

func NewCmdElement added in v0.2.0

func NewCmdElement(rcv interface{}, cmd string, args ...string) CmdElement

NewCmdElement creates CmdElement as like original Do() interface

type WrappedPool

type WrappedPool struct {
	*radix.Pool
	// contains filtered or unexported fields
}

WrappedPool ...

func NewPool

func NewPool(network, addr string, size int, opts ...radix.PoolOpt) (*WrappedPool, error)

NewPool wraps radix.NewPool

func (*WrappedPool) Do

func (p *WrappedPool) Do(txn *newrelic.Transaction, rcv interface{}, cmd string, args ...string) error

Do wraps radix.Pool.Do()

func (*WrappedPool) DoPipeline added in v0.2.0

func (p *WrappedPool) DoPipeline(txn *newrelic.Transaction, cmds []CmdElement) error

DoPipeline wraps radix.Pool.Do() with Pipeline

Jump to

Keyboard shortcuts

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