Versions in this module Expand all Collapse all v1 v1.0.1 Apr 27, 2023 v1.0.0 Apr 26, 2023 Changes in this version + const MODE_OFF + const MODE_RECORD + const MODE_TEST + var RespChannels = map[string]chan bool + func AssertTests(t *testing.T) + func CaptureGrpcTC(k *Keploy, grpcCtx context.Context, req models.GrpcReq, resp models.GrpcResp) + func CaptureHttpTC(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 GetMode() keploy.Mode + func GrpCurl(grpcReq string, id string, port string, method string) error + func Middleware(k *Keploy, router Router) error + func NewCustomHandler(c *grpcurl.DefaultEventHandler) grpcurl.InvocationEventHandler + func ProcessDep(ctx context.Context, log *zap.Logger, meta map[string]string, ...) (bool, []interface{}) + func SetTestMode() + type AppConfig struct + Delay time.Duration + Filter Filter + Host string + MockPath string + Name string + Port string + TestPath string + Timeout time.Duration + type BodyDumpResponseWriter struct + Status int + func ProcessRequest(rw http.ResponseWriter, r *http.Request, k *Keploy) (*BodyDumpResponseWriter, *http.Request, *bytes.Buffer, []byte, error) + func (w *BodyDumpResponseWriter) Flush() + func (w *BodyDumpResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) + func (w *BodyDumpResponseWriter) Write(b []byte) (int, error) + func (w *BodyDumpResponseWriter) WriteHeader(code int) + type Config struct + App AppConfig + Server ServerConfig + type CustomHandler struct + func (h *CustomHandler) OnReceiveResponse(protoiface.MessageV1) + type Filter struct + AcceptUrlRegex string + HeaderRegex []string + RejectUrlRegex []string + Remove []string + Replace map[string]string + type GrpcResp struct + L *sync.Mutex + Resp models.GrpcResp + type HttpResp struct + L *sync.Mutex + Resp models.HttpResp + type KError struct + Err error + func (e *KError) Error() string + func (e *KError) GobDecode(b []byte) error + func (e *KError) GobEncode() ([]byte, error) + type Keploy struct + Ctx context.Context + Log *zap.Logger + func New(cfg Config) *Keploy + func (k *Keploy) Capture(req models.TestCaseReq) + func (k *Keploy) Get(id string) *models.TestCase + func (k *Keploy) GetClock(id string) int64 + func (k *Keploy) GetDependencies(id string) []models.Dependency + func (k *Keploy) GetMocks(id string) []*proto.Mock + func (k *Keploy) GetResp(id string) HttpResp + func (k *Keploy) GetRespGrpc(id string) GrpcResp + func (k *Keploy) PutResp(id string, resp HttpResp) + func (k *Keploy) PutRespGrpc(id string, resp GrpcResp) + func (k *Keploy) Test() + type Router interface + Context func() context.Context + GetRequest func() *http.Request + GetResponseWriter func() http.ResponseWriter + GetURLParams func() map[string]string + Next func() error + SetRequest func(*http.Request) + SetResponseWriter func(http.ResponseWriter) + type ServerConfig struct + AsyncCalls bool + LicenseKey string + URL string