Documentation
¶
Index ¶
- func AssertTests(t *testing.T)
- func CaptureTestcase(k *Keploy, r *http.Request, reqBody []byte, resp models.HttpResp, ...)
- func Decode(bin []byte, obj interface{}) (interface{}, error)
- func Encode(obj interface{}, arr [][]byte, pos int) error
- func ProcessDep(ctx context.Context, log *zap.Logger, meta map[string]string, ...) (bool, []interface{})
- func SetMode(m Mode) error
- func SetTestMode()
- type AppConfig
- type BodyDumpResponseWriter
- type Config
- type Context
- type KError
- type KctxType
- type Keploy
- type Mode
- type ServerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertTests ¶ added in v0.2.0
func CaptureTestcase ¶ added in v0.2.0
func Encode ¶
Encode takes obj parameter and encodes its contents into arr parameter. If obj have no exported field then, it returns an error.
func ProcessDep ¶
func ProcessDep(ctx context.Context, log *zap.Logger, meta map[string]string, outputs ...interface{}) (bool, []interface{})
ProcessDep is a generic method to encode and decode the outputs of external dependecies. If request is on "test" mode, it returns (true, decoded outputs of stored binaries in keploy context). Else in "capture" mode, it encodes the outputs of external dependencies and stores in keploy context. Returns (false, nil).
func SetMode ¶ added in v0.2.0
SetMode sets the keploy SDK mode error is returned if the mode is invalid
func SetTestMode ¶ added in v0.2.0
func SetTestMode()
SetTestMode sets the keploy SDK mode to MODE_TEST
Types ¶
type BodyDumpResponseWriter ¶ added in v0.2.0
type BodyDumpResponseWriter struct {
io.Writer
http.ResponseWriter
Status int
}
func (*BodyDumpResponseWriter) Flush ¶ added in v0.2.0
func (w *BodyDumpResponseWriter) Flush()
func (*BodyDumpResponseWriter) Hijack ¶ added in v0.2.0
func (w *BodyDumpResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error)
func (*BodyDumpResponseWriter) Write ¶ added in v0.2.0
func (w *BodyDumpResponseWriter) Write(b []byte) (int, error)
func (*BodyDumpResponseWriter) WriteHeader ¶ added in v0.2.0
func (w *BodyDumpResponseWriter) WriteHeader(code int)
type Config ¶ added in v0.2.0
type Config struct {
App AppConfig
Server ServerConfig
}
type KError ¶
type KError struct {
Err error
}
KError stores the error for encoding and decoding as errorString has no exported fields due to gob wasn't able to encode the unexported fields.
type Keploy ¶ added in v0.2.0
func (*Keploy) Capture ¶ added in v0.2.0
func (k *Keploy) Capture(req regression.TestCaseReq)
Capture will capture request, response and output of external dependencies by making Call to keploy server.
func (*Keploy) GetDependencies ¶ added in v0.2.1
func (k *Keploy) GetDependencies(id string) []models.Dependency
type Mode ¶ added in v0.2.0
type Mode string
Mode represents the mode at which the SDK is operating MODE_RECORD is for recording API calls to generate testcases MODE_TEST is for testing the application on previous recorded testcases MODE_OFF disables keploy SDK automatically from the application
func GetModeFromContext ¶ added in v0.2.0
GetModeFromContext returns the mode on which SDK is configured by accessing environment variable.