Documentation ¶
Index ¶
- func Column2(rows *sql.Rows, row int) [][]byte
- func Column3(rows *sql.Rows, row int) [][]byte
- func DurationToString(d time.Duration) string
- func GetPath(url *url.URL) (result string)
- func HandleGet(rows *sql.Rows, err error, closure func(*sql.Rows, int) [][]byte) ([][][]byte, myerror.Code)
- func HttpContentEncodingDecode(header http.Header, body io.ReadCloser, len int64, typ string) (string, error)
- func JsonResponse(rw http.ResponseWriter, reply interface{})
- func JsonResponseWS(rw *websocket.Conn, reply interface{})
- func SaveReport(uId string, report Report) error
- func WasmForfeit(wasmFileName string)
- func WasmReplace(targets []string, slave []byte) error
- func WasmUnforfeit(wasmFileName string)
- type CurlCommand
- type DB_Op
- type Expectation
- type Hit
- type Mock
- type Report
- type ReportLen
- type SafeHitMap
- type SafeIndexDb
- type SafeInstance
- type SafeInstanceMap
- type SafeReportLen
- type SafeReports
- func (c *SafeReports) AppendEnd(uid string, backgroundMock []Mock, hit []Hit)
- func (c *SafeReports) AppendExpectation(uid string, ex Expectation)
- func (c *SafeReports) AppendMock(uid string, mock Mock)
- func (c *SafeReports) AppendPostmanItem(uid string, s postman.Item)
- func (c *SafeReports) AppendRequest(uid string, req string) int64
- func (c *SafeReports) AppendResponse(uid string, res string)
- func (c *SafeReports) AppendStep(uid string, s Step)
- func (c *SafeReports) AppendToLastStep(uid string, s Step)
- func (c *SafeReports) AppendUnitTest(uid string, index int64)
- func (c *SafeReports) ClearUnitTest(uid string)
- func (c *SafeReports) Len(uid string) int
- func (c *SafeReports) ReportGen(uid string)
- func (c *SafeReports) Save(uid string)
- func (c *SafeReports) SetExpectation(uid string, ex Expectation, index int)
- func (c *SafeReports) SetMock(uid string, mock Mock, index int)
- func (c *SafeReports) SetRequest(uid string, req string, index int64) bool
- func (c *SafeReports) SetResponse(uid string, res string, index int)
- func (c *SafeReports) SetStep(uid string, s Step, index int)
- type SafeStringMap
- type SafeWsConn
- func (c *SafeWsConn) Close()
- func (c *SafeWsConn) HostCall() bool
- func (c *SafeWsConn) Lock()
- func (c *SafeWsConn) ReadJSON(v interface{}) error
- func (c *SafeWsConn) ReadMessage() (int, []byte, error)
- func (c *SafeWsConn) SetHostCall(v bool)
- func (c *SafeWsConn) UnLock()
- func (c *SafeWsConn) WriteJSON(v interface{}) error
- func (c *SafeWsConn) WriteMessage(m int, b []byte) error
- type SafeWsConnMap
- type Step
- type Trace
- type TraceRequest
- type TraceResponse
- type UnitTest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DurationToString ¶
func HandleGet ¶
func HandleGet(rows *sql.Rows, err error, closure func(*sql.Rows, int) [][]byte) ([][][]byte, myerror.Code)
handleGet used for Database get row
func JsonResponse ¶
func JsonResponse(rw http.ResponseWriter, reply interface{})
func JsonResponseWS ¶
func SaveReport ¶
func WasmForfeit ¶
func WasmForfeit(wasmFileName string)
func WasmReplace ¶
func WasmUnforfeit ¶
func WasmUnforfeit(wasmFileName string)
Types ¶
type CurlCommand ¶
type CurlCommand struct {
// contains filtered or unexported fields
}
CurlCommand contains exec.Command compatible slice + helpers
func GetCurlCommand ¶
func GetCurlCommand(req *http.Request, body []byte) (*CurlCommand, error)
GetCurlCommand returns a CurlCommand corresponding to an http.Request
func (*CurlCommand) String ¶
func (c *CurlCommand) String() string
String returns a ready to copy/paste command
type Expectation ¶
type Mock ¶
type Mock struct { Command string `json:"command"` Request string `json:"request"` Response string `json:"response"` Pass bool `json:"pass"` Index int64 `json:"index"` Duration string `json:"duration"` EndTime string `json:"end_time"` Source string `json:"source"` TraceId string `json:"trace_id"` Time time.Time }
type Report ¶
type Report struct { Tests []UnitTest `json:"tests"` StartTime time.Time StartTimeFormatted string `json:"start_time_formatted"` EndTimeFormatted string `json:"end_time_formatted"` Date string `json:"date"` Duration string `json:"duration"` TestEndPoint string `json:"test_end_point"` Passes int32 `json:"passes"` Skips int32 `json:"skips"` TotalTests int32 `json:"total_tests"` BackgroundMock []Mock `json:"background_mock"` Hits []Hit `json:"hits"` Postman string `json:"postman"` PostmanItem []postman.Item }
type SafeHitMap ¶
type SafeHitMap struct {
// contains filtered or unexported fields
}
func NewSafeHitMap ¶
func NewSafeHitMap() SafeHitMap
func (*SafeHitMap) Clone ¶
func (c *SafeHitMap) Clone() []Hit
func (*SafeHitMap) Range ¶
func (c *SafeHitMap) Range(fn func(hit Hit) bool)
func (*SafeHitMap) Store ¶
func (c *SafeHitMap) Store(hit Hit)
type SafeIndexDb ¶
type SafeIndexDb struct {
// contains filtered or unexported fields
}
func NewSafeIndexDb ¶
func NewSafeIndexDb() SafeIndexDb
func (*SafeIndexDb) Delete ¶
func (c *SafeIndexDb) Delete(key string)
func (*SafeIndexDb) Store ¶
func (c *SafeIndexDb) Store(key string, b []byte)
type SafeInstance ¶
type SafeInstance struct {
// contains filtered or unexported fields
}
func NewSafeInstance ¶
func NewSafeInstance(i wapc.Instance) SafeInstance
func (*SafeInstance) Close ¶
func (c *SafeInstance) Close()
type SafeInstanceMap ¶
type SafeInstanceMap struct {
// contains filtered or unexported fields
}
func NewSafeInstanceMap ¶
func NewSafeInstanceMap() SafeInstanceMap
func (*SafeInstanceMap) Delete ¶
func (c *SafeInstanceMap) Delete(key string)
func (*SafeInstanceMap) Get ¶
func (c *SafeInstanceMap) Get(key string) (*SafeInstance, bool)
func (*SafeInstanceMap) GetAll ¶
func (c *SafeInstanceMap) GetAll() map[string]*SafeInstance
func (*SafeInstanceMap) Set ¶
func (c *SafeInstanceMap) Set(key string, instance *SafeInstance)
type SafeReportLen ¶
type SafeReportLen struct {
// contains filtered or unexported fields
}
func SafeReportLenNew ¶
func SafeReportLenNew() SafeReportLen
func (*SafeReportLen) CreateReport ¶
func (c *SafeReportLen) CreateReport(uid string)
func (*SafeReportLen) DeleteReport ¶
func (c *SafeReportLen) DeleteReport(uid string)
func (*SafeReportLen) Get ¶
func (c *SafeReportLen) Get(uid string) int64
func (*SafeReportLen) Increment ¶
func (c *SafeReportLen) Increment(uid string)
type SafeReports ¶
func (*SafeReports) AppendEnd ¶
func (c *SafeReports) AppendEnd(uid string, backgroundMock []Mock, hit []Hit)
func (*SafeReports) AppendExpectation ¶
func (c *SafeReports) AppendExpectation(uid string, ex Expectation)
func (*SafeReports) AppendMock ¶
func (c *SafeReports) AppendMock(uid string, mock Mock)
func (*SafeReports) AppendPostmanItem ¶
func (c *SafeReports) AppendPostmanItem(uid string, s postman.Item)
func (*SafeReports) AppendRequest ¶
func (c *SafeReports) AppendRequest(uid string, req string) int64
func (*SafeReports) AppendResponse ¶
func (c *SafeReports) AppendResponse(uid string, res string)
func (*SafeReports) AppendStep ¶
func (c *SafeReports) AppendStep(uid string, s Step)
func (*SafeReports) AppendToLastStep ¶
func (c *SafeReports) AppendToLastStep(uid string, s Step)
func (*SafeReports) AppendUnitTest ¶
func (c *SafeReports) AppendUnitTest(uid string, index int64)
func (*SafeReports) ClearUnitTest ¶
func (c *SafeReports) ClearUnitTest(uid string)
func (*SafeReports) Len ¶
func (c *SafeReports) Len(uid string) int
func (*SafeReports) ReportGen ¶
func (c *SafeReports) ReportGen(uid string)
func (*SafeReports) Save ¶
func (c *SafeReports) Save(uid string)
func (*SafeReports) SetExpectation ¶
func (c *SafeReports) SetExpectation(uid string, ex Expectation, index int)
func (*SafeReports) SetRequest ¶
func (c *SafeReports) SetRequest(uid string, req string, index int64) bool
func (*SafeReports) SetResponse ¶
func (c *SafeReports) SetResponse(uid string, res string, index int)
type SafeStringMap ¶
type SafeStringMap struct {
// contains filtered or unexported fields
}
func NewSafeStringMap ¶
func NewSafeStringMap() SafeStringMap
func (*SafeStringMap) Delete ¶
func (c *SafeStringMap) Delete(key string)
func (*SafeStringMap) Store ¶
func (c *SafeStringMap) Store(key string, value string)
type SafeWsConn ¶
type SafeWsConn struct {
// contains filtered or unexported fields
}
func NewSafeWsConn ¶
func NewSafeWsConn(i *websocket.Conn) SafeWsConn
func (*SafeWsConn) Close ¶
func (c *SafeWsConn) Close()
func (*SafeWsConn) HostCall ¶
func (c *SafeWsConn) HostCall() bool
func (*SafeWsConn) Lock ¶
func (c *SafeWsConn) Lock()
func (*SafeWsConn) ReadJSON ¶
func (c *SafeWsConn) ReadJSON(v interface{}) error
func (*SafeWsConn) ReadMessage ¶
func (c *SafeWsConn) ReadMessage() (int, []byte, error)
func (*SafeWsConn) SetHostCall ¶
func (c *SafeWsConn) SetHostCall(v bool)
func (*SafeWsConn) UnLock ¶
func (c *SafeWsConn) UnLock()
func (*SafeWsConn) WriteJSON ¶
func (c *SafeWsConn) WriteJSON(v interface{}) error
func (*SafeWsConn) WriteMessage ¶
func (c *SafeWsConn) WriteMessage(m int, b []byte) error
type SafeWsConnMap ¶
type SafeWsConnMap struct {
// contains filtered or unexported fields
}
func NewSafeWsConnMap ¶
func NewSafeWsConnMap() SafeWsConnMap
func (*SafeWsConnMap) Delete ¶
func (c *SafeWsConnMap) Delete(key string)
func (*SafeWsConnMap) Get ¶
func (c *SafeWsConnMap) Get(key string) (*SafeWsConn, bool)
func (*SafeWsConnMap) GetAll ¶
func (c *SafeWsConnMap) GetAll() map[string]*SafeWsConn
func (*SafeWsConnMap) Set ¶
func (c *SafeWsConnMap) Set(key string, conn *SafeWsConn)
func (*SafeWsConnMap) SizeHint ¶
func (c *SafeWsConnMap) SizeHint() int
type Trace ¶
type Trace struct { Request TraceRequest `json:"request"` Response TraceResponse `json:"response"` }
type TraceRequest ¶
type TraceResponse ¶
type UnitTest ¶
type UnitTest struct { Index int64 `json:"index"` Expectations []Expectation `json:"expectations"` MockData []Mock `json:"MockData"` Request string `json:"request"` Response string `json:"response"` Steps []Step `json:"Step"` StartTime time.Time StartTimeFormatted string `json:"start_time_formatted"` EndTimeFormatted string `json:"end_time_formatted"` Duration string `json:"duration"` }
func UnitTestGen ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.