tempredis

package module
v0.0.0-...-8a695b6 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: MIT Imports: 10 Imported by: 66

README

tempredis

tempredis is a Go package that makes it easy to start and stop temporary redis-server processes.

API documentation

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config map[string]string

Config is a key-value map of Redis config settings.

func (Config) Socket

func (c Config) Socket() string

type Server

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

Server encapsulates the configuration, starting, and stopping of a single redis-server process that is reachable via a local Unix socket.

func Start

func Start(config Config) (server *Server, err error)

Start initiates a new redis-server process configured with the given configuration. redis-server will listen on a temporary local Unix socket. An error is returned if redis-server is unable to successfully start for any reason.

func (*Server) Kill

func (s *Server) Kill() (err error)

Kill forcefully shuts down redis-server. It returns an error if redis-server fails to die.

func (*Server) Socket

func (s *Server) Socket() string

Socket returns the full path to the local redis-server Unix socket.

func (*Server) Stderr

func (s *Server) Stderr() string

Stderr blocks until redis-server returns and then returns the full stdout output.

func (*Server) Stdout

func (s *Server) Stdout() string

Stdout blocks until redis-server returns and then returns the full stdout output.

func (*Server) Term

func (s *Server) Term() (err error)

Term gracefully shuts down redis-server. It returns an error if redis-server fails to terminate.

Jump to

Keyboard shortcuts

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