model

package
v1.0.0-alpha.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ID = iota
	Host
	Method
	Path
	Params
	Edit
	Status
	Length
	Ip
)

Variables

View Source
var DefaultFilter = &Filter{
	Search:     "",
	StatusCode: []int{100, 200, 300, 400, 500},
	Show:       false,
	Hide:       true,
	HideExt:    []string{"jpg", "png"},
	ShowExt:    []string{"asp", "php"},
	ScopeOnly:  false,
	Scope:      []string{},
}
View Source
var HashMapHistory = make(map[int64]int)

used to map id to actual rows in the table

View Source
var History []*Row

Functions

This section is empty.

Types

type CustomTableModel

type CustomTableModel struct {
	core.QAbstractTableModel
	// contains filtered or unexported fields
}

CustomTableModel represents a table model used to populate the history QtTableView

func (*CustomTableModel) AddEditedRequest

func (m *CustomTableModel) AddEditedRequest(r *Request, id int64)

AddEditedRequest adds an edited Request to the history

func (*CustomTableModel) AddEditedResponse

func (m *CustomTableModel) AddEditedResponse(r *Response, id int64)

AddEditedResponse adds an edited Response to the history

func (*CustomTableModel) AddRequest

func (m *CustomTableModel) AddRequest(r *Request, id int64)

AddRequest adds a Request to the history

func (*CustomTableModel) AddResponse

func (m *CustomTableModel) AddResponse(r *Response, id int64)

AddResponse adds a Response to the history

func (*CustomTableModel) GetReqResp

func (m *CustomTableModel) GetReqResp(i int64) (*Request, *Request, *Response, *Response)

GetReqResp retursn request, response, edited request and edited response for a given context.ID

type Filter

type Filter struct {
	Search     string
	StatusCode []int
	Show       bool
	Hide       bool
	ShowExt    []string
	HideExt    []string
	ScopeOnly  bool
	Scope      []string
}

Filter represents the filter of the history table

type HTTPItem

type HTTPItem struct {
	core.QObject
	ID         int
	Req        *Request
	Resp       *Response
	EditedReq  *Request
	EditedResp *Response
}

HTTPItem represent an item in the history table

type Request

type Request struct {
	ID            int64
	URL           *url.URL
	Proto         string
	Method        string
	Host          string
	Headers       http.Header
	ContentLength int64
	Body          []byte
	Extension     string
	Params        bool
	IP            string
}

Request represents an HTTP request logged in the history

func (*Request) ToString

func (r *Request) ToString() string

ToString returns a string representation of an HTTP request logged in the history

type Response

type Response struct {
	ID            int64
	Proto         string
	Status        string
	StatusCode    int
	Headers       http.Header
	ContentLength int64
	Body          []byte
}

Response represents an HTTP response logged in the history

func (*Response) ToString

func (r *Response) ToString() string

ToString returns a string representation of an HTTP response logged in the history

type Row

type Row struct {
	ID         int64
	Req        *Request
	Resp       *Response
	EditedReq  *Request
	EditedResp *Response
}

type SortFilterModel

type SortFilterModel struct {
	core.QSortFilterProxyModel

	Custom *CustomTableModel
	// contains filtered or unexported fields
}

SortFilterModel represent a sorted filter model to perform sorting and filtering of the history table

func (*SortFilterModel) GetRowId

func (m *SortFilterModel) GetRowId(r int) int64

func (*SortFilterModel) ResetFilters

func (m *SortFilterModel) ResetFilters()

ResetFilters remove all filters on the model

func (*SortFilterModel) SetFilter

func (m *SortFilterModel) SetFilter(f *Filter)

SetFilter sets a filter on the model

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL