service

package
v0.0.0-...-77e4c42 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2016 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ErrorKey = "error"

Key to use when setting the error value.

Variables

This section is empty.

Functions

func ErrorHandler

func ErrorHandler(c *web.C, h http.Handler) http.Handler

ErrorHandler handles writing error responses to the client.

func Headers

func Headers(config *Config) web.MiddlewareType

Headers injects headers defined in the configuration into every request.

Types

type Config

type Config struct {
	Bind      string `toml:"bind"`
	RedisAddr string `toml:"redis"`
	Headers   []header
}

Config is the configuration for the Restdis web service.

type RequestError

type RequestError struct {
	Status int
	// contains filtered or unexported fields
}

RequestError is an error that occurred during a request.

func (*RequestError) Error

func (e *RequestError) Error() string

type RestdisResource

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

RestdisResource represents a Restdis web service resource handler.

func (*RestdisResource) Default

func (r *RestdisResource) Default(c web.C, w http.ResponseWriter, req *http.Request)

Default is the default request handler.

func (*RestdisResource) RedisCommand

func (r *RestdisResource) RedisCommand(c web.C, w http.ResponseWriter, req *http.Request)

RedisCommand handles all requests for Redis commands.

type RestdisService

type RestdisService struct {
	Version string
	Config  *Config
}

RestdisService represents the Restdis web service.

func (*RestdisService) Run

func (s *RestdisService) Run() error

Run starts the Restdis web service.

Jump to

Keyboard shortcuts

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