mirror of
https://github.com/buger/goreplay.git
synced 2024-04-21 12:32:02 +00:00
27 lines
383 B
Go
27 lines
383 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
)
|
|
|
|
type HTTPMethods []string
|
|
|
|
func (h *HTTPMethods) String() string {
|
|
return fmt.Sprint(*h)
|
|
}
|
|
|
|
func (h *HTTPMethods) Set(value string) error {
|
|
*h = append(*h, strings.ToUpper(value))
|
|
return nil
|
|
}
|
|
|
|
func (h *HTTPMethods) Contains(value string) bool {
|
|
for _, method := range *h {
|
|
if value == method {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|