Documentation ¶
Index ¶
- func CheckSetsEqual(setA, setB []int) bool
- func GenerateKey(path string) (string, error)
- func GetDefaultConfigMap() map[string]interface{}
- func GetUnitTestConfig() map[string]interface{}
- func Handler(resp *Response) func(http.ResponseWriter, *http.Request)
- func InitDatabaseFromEnv()
- func NewRegistryCtl(_ map[string]interface{}) (*httptest.Server, error)
- func NewServer(mappings ...*RequestHandlerMapping) *httptest.Server
- func TraceCfgMap(cfgs map[string]interface{})
- type GCResult
- type RequestHandlerMapping
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckSetsEqual ¶
CheckSetsEqual - check int set if they are equals
func GetDefaultConfigMap ¶
func GetDefaultConfigMap() map[string]interface{}
GetDefaultConfigMap returns the default config map for easier modification.
func Handler ¶
func Handler(resp *Response) func(http.ResponseWriter, *http.Request)
Handler returns a handler function which handle request according to the response provided
func InitDatabaseFromEnv ¶
func InitDatabaseFromEnv()
InitDatabaseFromEnv is used to initialize database for testing
func NewRegistryCtl ¶
NewRegistryCtl returns a mock registry server
func NewServer ¶
func NewServer(mappings ...*RequestHandlerMapping) *httptest.Server
NewServer creates an HTTP server for unit test
Types ¶
type GCResult ¶
type GCResult struct { Status bool `json:"status"` Msg string `json:"msg"` StartTime time.Time `json:"starttime"` EndTime time.Time `json:"endtime"` }
GCResult ...
type RequestHandlerMapping ¶
type RequestHandlerMapping struct { // Method is the method the request used Method string // Pattern is the pattern the request must match Pattern string // Handler is the handler which handles the request Handler func(http.ResponseWriter, *http.Request) }
RequestHandlerMapping is a mapping between request and its handler
func (*RequestHandlerMapping) ServeHTTP ¶
func (rhm *RequestHandlerMapping) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP ...
Click to show internal directories.
Click to hide internal directories.