common

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2015 License: Apache-2.0 Imports: 7 Imported by: 0

README

common

-- import "github.com/Clever/sphinx/common"

Usage

func ConstructMockRequestWithHeaders
func ConstructMockRequestWithHeaders(headers map[string][]string) *http.Request

ConstructMockRequestWithHeaders constructs an http.Request with the given headers

func Hash
func Hash(str, salt string) string

Hash hashes a string based on the given salt

func InSlice
func InSlice(a string, list []string) bool

InSlice tests whether or not a string exists in a slice of strings

func ReMarshal
func ReMarshal(config interface{}, target interface{}) error

ReMarshal parses interface{} into concrete types

func SortedKeys
func SortedKeys(obj map[string]interface{}) []string

SortedKeys returns a sorted slice of map keys

type Request
type Request map[string]interface{}

Request contains any info necessary to ratelimit a request

func HTTPToSphinxRequest
func HTTPToSphinxRequest(r *http.Request) Request

HTTPToSphinxRequest converts an http.Request to a Request

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstructMockRequestWithHeaders

func ConstructMockRequestWithHeaders(headers map[string][]string) *http.Request

ConstructMockRequestWithHeaders constructs an http.Request with the given headers

func Hash

func Hash(str, salt string) string

Hash hashes a string based on the given salt

func InSlice

func InSlice(a string, list []string) bool

InSlice tests whether or not a string exists in a slice of strings

func ReMarshal

func ReMarshal(config interface{}, target interface{}) error

ReMarshal parses interface{} into concrete types

func SortedKeys

func SortedKeys(obj map[string]interface{}) []string

SortedKeys returns a sorted slice of map keys

Types

type Request

type Request map[string]interface{}

Request contains any info necessary to ratelimit a request

func HTTPToSphinxRequest

func HTTPToSphinxRequest(r *http.Request) Request

HTTPToSphinxRequest converts an http.Request to a Request

Jump to

Keyboard shortcuts

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