Skip to content

Latest commit

 

History

History

common

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

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