Documentation ¶
Index ¶
Constants ¶
View Source
const (
DefaultPingBackStatusCode = http.StatusCreated
)
Variables ¶
This section is empty.
Functions ¶
func PingBackHandler ¶
func PingBackHandler(retCode int) http.HandlerFunc
PingBackHandler is an http.Handler that pings back the request info as JSON.
Types ¶
type MutexReadWriter ¶
MutexReadWriter is a io.ReadWriter that can be read and worked on from multiple go routines.
func NewMutexReadWriter ¶
func NewMutexReadWriter(rw io.ReadWriter) *MutexReadWriter
NewMutexReadWriter creates a new thread-safe io.ReadWriter.
type PingBackResponse ¶
type PingBackResponse struct { ProtoMajor int `json:"protoMajor"` Method string `json:"method"` UrlHost string `json:"urlHost"` UrlPath string `json:"urlPath"` HdHost string `json:"hdHost"` Headers map[string]string `json:"headers"` }
PingBackResponse is a JSON struct that encodes the inbound request.
func DecodePingBack ¶
func DecodePingBack(resp *http.Response) (*PingBackResponse, error)
DecodePingBack returns a parsed PingBackResponse for assertion purposes.
type WaresTestSuite ¶
type WaresTestSuite struct { suite.Suite ClientInLegacyHttp1Mode bool ServerInLegacyHttp1Mode bool ServerMiddleware []httpwares.Middleware ClientTripperware []httpwares.Tripperware Handler http.Handler ServerListener net.Listener Server *http.Server }
WaresTestSuite is a testify/Suite that starts a gRPC PingService server and a client.
func (*WaresTestSuite) NewClient ¶
func (s *WaresTestSuite) NewClient() *http.Client
NewClient returns a client that dials the server for *any* address provided. It's up to you to validate that the scheme is right.
func (*WaresTestSuite) ServerAddr ¶
func (s *WaresTestSuite) ServerAddr() string
func (*WaresTestSuite) SetupSuite ¶
func (s *WaresTestSuite) SetupSuite()
func (*WaresTestSuite) SimpleCtx ¶
func (s *WaresTestSuite) SimpleCtx() context.Context
func (*WaresTestSuite) TearDownSuite ¶
func (s *WaresTestSuite) TearDownSuite()
Click to show internal directories.
Click to hide internal directories.