Documentation
¶
Index ¶
- Constants
- Variables
- func ConnectViaGorm(config *Config) (db *gorm.DB, err error)
- func DisableMongoHook() error
- func EnableMongoHook() error
- func GetTimeValAndInc() time.Time
- func HookGrpcInvoke() error
- func HookHttpFunc() error
- func HookHttpServerHandler() error
- func HookKafkaProducer() error
- func HookMysqlDriver() error
- func HookRedisFunc() error
- func HookTimeNow() error
- func InitRegressionEngine() int
- func NewAsyncProducerHook(addrs []string, conf *sarama.Config) (sarama.AsyncProducer, error)
- func NewAsyncProducerTramp(addrs []string, conf *sarama.Config) (sarama.AsyncProducer, error)
- func NewSyncProducerHook(addrs []string, config *sarama.Config) (sarama.SyncProducer, error)
- func RecordData(uri, outDir, name string, req []byte, t1 int, rsp []byte, t2 int, desc string, ...) (string, error)
- func RecordGrpc(outDir, desc string, req proto.Message, rsp proto.Message, db []string) (string, error)
- func RecordHttp(outDir, desc string, req *http.Request, rsp *http.Response, db []string) (string, error)
- func RecordHttpExt(uri, desc, name string, head http.Header, req, rsp []byte, t1, t2 int) (string, error)
- func RegisterHttpRecorder(pattern string, handler HttpRecorderHandler, fix HttpRequestFixer)
- func RunTestCaseUploader()
- func SetTimeIncDelta(d time.Duration)
- func SetUnixTime(val time.Time)
- func UnHookGrpcInvoke() error
- func UnHookHttpFunc() error
- func UnHookHttpServerHandler() error
- func UnHookKafkaProducer() error
- func UnHookMysqlDriver() error
- func UnHookRedisFunc() error
- type AsyncProducerHook
- func (ap *AsyncProducerHook) AsyncClose()
- func (ap *AsyncProducerHook) Close() error
- func (ap *AsyncProducerHook) Errors() <-chan *sarama.ProducerError
- func (ap *AsyncProducerHook) GetOriginProducer() sarama.AsyncProducer
- func (ap *AsyncProducerHook) Input() chan<- *sarama.ProducerMessage
- func (ap *AsyncProducerHook) Successes() <-chan *sarama.ProducerMessage
- type BoltStorage
- type CmdValue
- type Config
- type CursorData
- type DbStorage
- type GrpcHookRequest
- func (*GrpcHookRequest) Descriptor() ([]byte, []int)
- func (m *GrpcHookRequest) GetReqData() string
- func (m *GrpcHookRequest) GetReqId() int32
- func (m *GrpcHookRequest) GetReqName() string
- func (*GrpcHookRequest) ProtoMessage()
- func (m *GrpcHookRequest) Reset()
- func (m *GrpcHookRequest) String() string
- func (m *GrpcHookRequest) XXX_DiscardUnknown()
- func (m *GrpcHookRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GrpcHookRequest) XXX_Merge(src proto.Message)
- func (m *GrpcHookRequest) XXX_Size() int
- func (m *GrpcHookRequest) XXX_Unmarshal(b []byte) error
- type GrpcHookResponse
- func (*GrpcHookResponse) Descriptor() ([]byte, []int)
- func (m *GrpcHookResponse) GetReqId() int32
- func (m *GrpcHookResponse) GetRspData() string
- func (m *GrpcHookResponse) GetRspId() int32
- func (m *GrpcHookResponse) GetRspName() string
- func (*GrpcHookResponse) ProtoMessage()
- func (m *GrpcHookResponse) Reset()
- func (m *GrpcHookResponse) String() string
- func (m *GrpcHookResponse) XXX_DiscardUnknown()
- func (m *GrpcHookResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GrpcHookResponse) XXX_Merge(src proto.Message)
- func (m *GrpcHookResponse) XXX_Size() int
- func (m *GrpcHookResponse) XXX_Unmarshal(b []byte) error
- type GrpcHookServiceClient
- type GrpcHookServiceServer
- type HttpData
- type HttpRecorderHandler
- type HttpRequestFixer
- type HttpResponseData
- type HttpSerializedData
- type MapStorage
- type MiddlewareRecordModel
- type MoveData
- type RegressionMgr
- func (r *RegressionMgr) ClearStorage()
- func (r *RegressionMgr) DisableHook()
- func (r *RegressionMgr) EnableGenKey()
- func (r *RegressionMgr) EnableHook() error
- func (r *RegressionMgr) GetCurTraceId() string
- func (r *RegressionMgr) GetCurrentTestSuitDir() string
- func (r *RegressionMgr) GetDbFiles() []string
- func (r *RegressionMgr) GetDebugInfo() string
- func (r *RegressionMgr) GetValue(key string) ([]byte, error)
- func (r *RegressionMgr) IsGenKeyEnabled() bool
- func (r *RegressionMgr) ResetTestSuitDir() string
- func (r *RegressionMgr) SetBoltStorage(path string) error
- func (r *RegressionMgr) SetBoltStorageFile(file string) error
- func (r *RegressionMgr) SetCurTraceId() error
- func (r *RegressionMgr) SetGenKey(fn func(int, context.Context, interface{}) string)
- func (r *RegressionMgr) SetNotify(fn func(string, string, []byte))
- func (r *RegressionMgr) SetReset(fn func(int))
- func (r *RegressionMgr) SetState(state int)
- func (r *RegressionMgr) SetStorage(s Storage)
- func (r *RegressionMgr) ShouldRecord() bool
- func (r *RegressionMgr) StoreValue(key string, data []byte) error
- type SingleResultData
- type Storage
- type SyncProducerHook
- func (sp *SyncProducerHook) Close() error
- func (sp *SyncProducerHook) GetAsyncProducer() sarama.AsyncProducer
- func (sp *SyncProducerHook) SendMessage(msg *sarama.ProducerMessage) (partition int32, offset int64, err error)
- func (sp *SyncProducerHook) SendMessages(msgs []*sarama.ProducerMessage) error
- type TestCase
- type TestItem
- type UnimplementedGrpcHookServiceServer
Constants ¶
View Source
const ( RegressionNone = 0 RegressionRecord = 1 RegressionReplay = 2 )
View Source
const ( RegressionResetNone = 0 RegressionResetStorage = 0 )
View Source
const ( RegressionHttpHook = 100 RegressionConnHook = 101 RegressionRedisHook = 102 RegressionGrpcHook = 103 RegressionSqlHook = 104 RegressionOutputReset = 105 )
View Source
const ( RecorderDataTypeUnknown = 23 RecorderDataTypeJson = 24 RecorderDataTypePbText = 25 RecorderDataTypePbBinary = 26 RecorderDataTypeHttpJson = 27 )
View Source
const ( SqlHookXxxDriver = "SqlHookXxxDriver" SqlHookMysqlDriver = "SqlHookMysqlDriver" )
Variables ¶
View Source
var ( GlobalMgr *RegressionMgr RegressionRunType = flag.Int("gorr_run_type", 0, "turn on/off gorr(0 for off, 1 for record, 2 for replay)") RegressionDbFile = flag.String("gorr_db_file", "gorr.db", "file name gorr db") RegressionDbDirectory = flag.String("gorr_db_dir", "/var/data/gorr", "directory to get gorr db") RegressionOutputDir = flag.String("gorr_record_output_dir", "/var/data/conf/gorr", "dir to store auto generated test cases") RegressionOutDirRefreshInterval = flag.Int("gorr_output_dir_refresh_interval", 7200, "refresh interval in seconds") )
Functions ¶
func DisableMongoHook ¶
func DisableMongoHook() error
func EnableMongoHook ¶
func EnableMongoHook() error
func GetTimeValAndInc ¶
func HookGrpcInvoke ¶
func HookGrpcInvoke() error
func HookHttpFunc ¶
func HookHttpFunc() error
func HookHttpServerHandler ¶
func HookHttpServerHandler() error
func HookKafkaProducer ¶
func HookKafkaProducer() error
func HookMysqlDriver ¶
func HookMysqlDriver() error
func HookRedisFunc ¶
func HookRedisFunc() error
func HookTimeNow ¶
func HookTimeNow() error
func InitRegressionEngine ¶
func InitRegressionEngine() int
func NewAsyncProducerHook ¶
func NewAsyncProducerTramp ¶
func NewSyncProducerHook ¶
func RecordData ¶
func RecordGrpc ¶
func RecordHttp ¶
func RecordHttpExt ¶
func RegisterHttpRecorder ¶
func RegisterHttpRecorder(pattern string, handler HttpRecorderHandler, fix HttpRequestFixer)
func RunTestCaseUploader ¶
func RunTestCaseUploader()
func SetTimeIncDelta ¶
func SetUnixTime ¶
func UnHookGrpcInvoke ¶
func UnHookGrpcInvoke() error
func UnHookHttpFunc ¶
func UnHookHttpFunc() error
func UnHookHttpServerHandler ¶
func UnHookHttpServerHandler() error
func UnHookKafkaProducer ¶
func UnHookKafkaProducer() error
func UnHookMysqlDriver ¶
func UnHookMysqlDriver() error
func UnHookRedisFunc ¶
func UnHookRedisFunc() error
Types ¶
type AsyncProducerHook ¶
type AsyncProducerHook struct {
// contains filtered or unexported fields
}
func (*AsyncProducerHook) AsyncClose ¶
func (ap *AsyncProducerHook) AsyncClose()
func (*AsyncProducerHook) Close ¶
func (ap *AsyncProducerHook) Close() error
func (*AsyncProducerHook) Errors ¶
func (ap *AsyncProducerHook) Errors() <-chan *sarama.ProducerError
func (*AsyncProducerHook) GetOriginProducer ¶
func (ap *AsyncProducerHook) GetOriginProducer() sarama.AsyncProducer
func (*AsyncProducerHook) Input ¶
func (ap *AsyncProducerHook) Input() chan<- *sarama.ProducerMessage
func (*AsyncProducerHook) Successes ¶
func (ap *AsyncProducerHook) Successes() <-chan *sarama.ProducerMessage
type BoltStorage ¶
type BoltStorage struct {
// contains filtered or unexported fields
}
func (*BoltStorage) AllFiles ¶
func (s *BoltStorage) AllFiles() []string
func (*BoltStorage) Clear ¶
func (s *BoltStorage) Clear()
func (*BoltStorage) Close ¶
func (s *BoltStorage) Close()
func (*BoltStorage) GetBigValueFile ¶
func (s *BoltStorage) GetBigValueFile(key string) (string, error)
type DbStorage ¶
func NewDbStorage ¶
func NewDbStorage() *DbStorage
type GrpcHookRequest ¶
type GrpcHookRequest struct { ReqId int32 `protobuf:"varint,1,opt,name=req_id,json=reqId,proto3" json:"req_id,omitempty"` ReqName string `protobuf:"bytes,2,opt,name=req_name,json=reqName,proto3" json:"req_name,omitempty"` ReqData string `protobuf:"bytes,3,opt,name=req_data,json=reqData,proto3" json:"req_data,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*GrpcHookRequest) Descriptor ¶
func (*GrpcHookRequest) Descriptor() ([]byte, []int)
func (*GrpcHookRequest) GetReqData ¶
func (m *GrpcHookRequest) GetReqData() string
func (*GrpcHookRequest) GetReqId ¶
func (m *GrpcHookRequest) GetReqId() int32
func (*GrpcHookRequest) GetReqName ¶
func (m *GrpcHookRequest) GetReqName() string
func (*GrpcHookRequest) ProtoMessage ¶
func (*GrpcHookRequest) ProtoMessage()
func (*GrpcHookRequest) Reset ¶
func (m *GrpcHookRequest) Reset()
func (*GrpcHookRequest) String ¶
func (m *GrpcHookRequest) String() string
func (*GrpcHookRequest) XXX_DiscardUnknown ¶
func (m *GrpcHookRequest) XXX_DiscardUnknown()
func (*GrpcHookRequest) XXX_Marshal ¶
func (m *GrpcHookRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GrpcHookRequest) XXX_Merge ¶
func (m *GrpcHookRequest) XXX_Merge(src proto.Message)
func (*GrpcHookRequest) XXX_Size ¶
func (m *GrpcHookRequest) XXX_Size() int
func (*GrpcHookRequest) XXX_Unmarshal ¶
func (m *GrpcHookRequest) XXX_Unmarshal(b []byte) error
type GrpcHookResponse ¶
type GrpcHookResponse struct { RspId int32 `protobuf:"varint,1,opt,name=rsp_id,json=rspId,proto3" json:"rsp_id,omitempty"` ReqId int32 `protobuf:"varint,2,opt,name=req_id,json=reqId,proto3" json:"req_id,omitempty"` RspName string `protobuf:"bytes,3,opt,name=rsp_name,json=rspName,proto3" json:"rsp_name,omitempty"` RspData string `protobuf:"bytes,4,opt,name=rsp_data,json=rspData,proto3" json:"rsp_data,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*GrpcHookResponse) Descriptor ¶
func (*GrpcHookResponse) Descriptor() ([]byte, []int)
func (*GrpcHookResponse) GetReqId ¶
func (m *GrpcHookResponse) GetReqId() int32
func (*GrpcHookResponse) GetRspData ¶
func (m *GrpcHookResponse) GetRspData() string
func (*GrpcHookResponse) GetRspId ¶
func (m *GrpcHookResponse) GetRspId() int32
func (*GrpcHookResponse) GetRspName ¶
func (m *GrpcHookResponse) GetRspName() string
func (*GrpcHookResponse) ProtoMessage ¶
func (*GrpcHookResponse) ProtoMessage()
func (*GrpcHookResponse) Reset ¶
func (m *GrpcHookResponse) Reset()
func (*GrpcHookResponse) String ¶
func (m *GrpcHookResponse) String() string
func (*GrpcHookResponse) XXX_DiscardUnknown ¶
func (m *GrpcHookResponse) XXX_DiscardUnknown()
func (*GrpcHookResponse) XXX_Marshal ¶
func (m *GrpcHookResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GrpcHookResponse) XXX_Merge ¶
func (m *GrpcHookResponse) XXX_Merge(src proto.Message)
func (*GrpcHookResponse) XXX_Size ¶
func (m *GrpcHookResponse) XXX_Size() int
func (*GrpcHookResponse) XXX_Unmarshal ¶
func (m *GrpcHookResponse) XXX_Unmarshal(b []byte) error
type GrpcHookServiceClient ¶
type GrpcHookServiceClient interface {
SomeCall(ctx context.Context, in *GrpcHookRequest, opts ...grpc.CallOption) (*GrpcHookResponse, error)
}
GrpcHookServiceClient is the client API for GrpcHookService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewGrpcHookServiceClient ¶
func NewGrpcHookServiceClient(cc *grpc.ClientConn) GrpcHookServiceClient
type GrpcHookServiceServer ¶
type GrpcHookServiceServer interface {
SomeCall(context.Context, *GrpcHookRequest) (*GrpcHookResponse, error)
}
GrpcHookServiceServer is the server API for GrpcHookService service.
type HttpRecorderHandler ¶
type HttpRequestFixer ¶
type HttpResponseData ¶
type HttpSerializedData ¶
type MapStorage ¶
type MapStorage struct {
// contains filtered or unexported fields
}
func NewMapStorage ¶
func NewMapStorage(capacity int) *MapStorage
func (*MapStorage) AllFiles ¶
func (s *MapStorage) AllFiles() []string
func (*MapStorage) Clear ¶
func (s *MapStorage) Clear()
func (*MapStorage) Close ¶
func (s *MapStorage) Close()
type MiddlewareRecordModel ¶
type MiddlewareRecordModel struct { Key string `gorm:"column:key"` Value string `gorm:"column:value"` }
func (*MiddlewareRecordModel) TableName ¶
func (*MiddlewareRecordModel) TableName() string
type RegressionMgr ¶
type RegressionMgr struct {
// contains filtered or unexported fields
}
func (*RegressionMgr) ClearStorage ¶
func (r *RegressionMgr) ClearStorage()
func (*RegressionMgr) DisableHook ¶
func (r *RegressionMgr) DisableHook()
func (*RegressionMgr) EnableGenKey ¶
func (r *RegressionMgr) EnableGenKey()
func (*RegressionMgr) EnableHook ¶
func (r *RegressionMgr) EnableHook() error
func (*RegressionMgr) GetCurTraceId ¶
func (r *RegressionMgr) GetCurTraceId() string
func (*RegressionMgr) GetCurrentTestSuitDir ¶
func (r *RegressionMgr) GetCurrentTestSuitDir() string
func (*RegressionMgr) GetDbFiles ¶
func (r *RegressionMgr) GetDbFiles() []string
func (*RegressionMgr) GetDebugInfo ¶
func (r *RegressionMgr) GetDebugInfo() string
func (*RegressionMgr) IsGenKeyEnabled ¶
func (r *RegressionMgr) IsGenKeyEnabled() bool
func (*RegressionMgr) ResetTestSuitDir ¶
func (r *RegressionMgr) ResetTestSuitDir() string
func (*RegressionMgr) SetBoltStorage ¶
func (r *RegressionMgr) SetBoltStorage(path string) error
func (*RegressionMgr) SetBoltStorageFile ¶
func (r *RegressionMgr) SetBoltStorageFile(file string) error
func (*RegressionMgr) SetCurTraceId ¶
func (r *RegressionMgr) SetCurTraceId() error
func (*RegressionMgr) SetGenKey ¶
func (r *RegressionMgr) SetGenKey(fn func(int, context.Context, interface{}) string)
func (*RegressionMgr) SetNotify ¶
func (r *RegressionMgr) SetNotify(fn func(string, string, []byte))
func (*RegressionMgr) SetReset ¶
func (r *RegressionMgr) SetReset(fn func(int))
func (*RegressionMgr) SetState ¶
func (r *RegressionMgr) SetState(state int)
func (*RegressionMgr) SetStorage ¶
func (r *RegressionMgr) SetStorage(s Storage)
func (*RegressionMgr) ShouldRecord ¶
func (r *RegressionMgr) ShouldRecord() bool
func (*RegressionMgr) StoreValue ¶
func (r *RegressionMgr) StoreValue(key string, data []byte) error
type SingleResultData ¶
type SyncProducerHook ¶
type SyncProducerHook struct {
// contains filtered or unexported fields
}
/////////////////sync producer hook: copyed from sarama.SyncProducer ///////////////////////////
func (*SyncProducerHook) Close ¶
func (sp *SyncProducerHook) Close() error
func (*SyncProducerHook) GetAsyncProducer ¶
func (sp *SyncProducerHook) GetAsyncProducer() sarama.AsyncProducer
func (*SyncProducerHook) SendMessage ¶
func (sp *SyncProducerHook) SendMessage(msg *sarama.ProducerMessage) (partition int32, offset int64, err error)
func (*SyncProducerHook) SendMessages ¶
func (sp *SyncProducerHook) SendMessages(msgs []*sarama.ProducerMessage) error
type UnimplementedGrpcHookServiceServer ¶
type UnimplementedGrpcHookServiceServer struct { }
UnimplementedGrpcHookServiceServer can be embedded to have forward compatible implementations.
Source Files
¶
- grpc_hook.go
- grpc_hook.pb.go
- http_hook.go
- kafka_hook.go
- mgr.go
- mongo_hook.go
- mongo_object_hook.go
- native_http_recorder.go
- recorder.go
- redis_cmd_hook.go
- redis_hook.go
- redis_hook_util.go
- redis_pipeline_hook.go
- sql_driver_hook.go
- sql_type.go
- storage.go
- storage_logreplay.go
- storage_mysql.go
- time_hook.go
Click to show internal directories.
Click to hide internal directories.