entity

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AppInitSuccess             = true                                //app初始化成功结果
	ShowProxyLog               bool                                  //显示代理日志开关
	ShowStaticLog              bool                                  //显示普通日志开关
	EnableProxyDetail          bool                                  //启用代理详情开关 checkbox
	GlobalLogMessageChan       = make(chan *LogMessage)              //http-server for select: 全局日志输出通道
	ProxyDetailGridChan        = make(chan *ProxyDetail)             //gui 组件 for select: 代理列表和详情数据传输通道
	ProxyFlowInterceptChan     = make(chan *ProxyDetail)             //gui 组件 for select: 代理拦截流程数据传输通道 proxy-server > gui,请求同步到UI
	ProxyInterceptConfigChan   = make(chan *[]*ProxyInterceptConfig) //proxy server for select: 代理拦截配置数据传输通道 gui > proxy-server,拦截规则同步给proxy server处理
	ProxyInterceptConfigEnable = true                                //代理拦截启用开关 button
	ID                         = &id{}
)

Functions

func PutColorMessage

func PutColorMessage(color int32, message ...string)

带颜色的

func PutLogsProxyTime

func PutLogsProxyTime(message ...string)

代理日志

func PutLogsStaticTime

func PutLogsStaticTime(message ...string)

普通日志

func PutMessage

func PutMessage(message ...string)

普通消息

func PutTimeMessage

func PutTimeMessage(message ...string)

带日期的

Types

type FormDataGridList

type FormDataGridList struct {
	Type      string
	Key       string
	TextValue string
	FileValue string
}

type LogMessage

type LogMessage struct {
	Type    int
	Message []string
	Color   int32
}

消息日志

type ProxyDetail

type ProxyDetail struct {
	Error                error               `json:"-"`
	State                consts.ProxyFlow    `json:"-"`
	ID                   int32               `json:"-"`
	ProxyInterceptSignal chan int32          `json:"-"` //代理拦截产生的信号,数字标记状态 10:开始请求拦截 11:结束请求拦截, 20:开始响应拦截 21:结束响应拦截
	IsAddTaskQueue       bool                `json:"-"` //是否添加到任务队列 ,只有在初始请求时第一次添加 true 添加
	StateCode            int                 `json:"state_code"`
	Method               string              `json:"method"`
	SourceUrl            string              `json:"source_url"`
	TargetUrl            string              `json:"target_url"`
	Host                 string              `json:"host"`
	Request              ProxyRequestDetail  `json:"request"`
	Response             ProxyResponseDetail `json:"response"`
}

代理请求详情

func (*ProxyDetail) GetState

func (m *ProxyDetail) GetState() (string, types.TColor)

type ProxyInterceptConfig

type ProxyInterceptConfig struct {
	Index  int32
	Option consts.PIOption
	// contains filtered or unexported fields
}

代理拦截配置

func (*ProxyInterceptConfig) Enable

func (m *ProxyInterceptConfig) Enable() bool

func (*ProxyInterceptConfig) InterceptUrl

func (m *ProxyInterceptConfig) InterceptUrl() string

func (*ProxyInterceptConfig) SetEnable

func (m *ProxyInterceptConfig) SetEnable(enable bool)

func (*ProxyInterceptConfig) SetInterceptUrl

func (m *ProxyInterceptConfig) SetInterceptUrl(interceptUrl string)

type ProxyLogsGridColStyle

type ProxyLogsGridColStyle struct {
	// contains filtered or unexported fields
}

func NewColStyle

func NewColStyle(tColor types.TColor, font types.TFontStyle) *ProxyLogsGridColStyle

func (*ProxyLogsGridColStyle) FontStyle

func (m *ProxyLogsGridColStyle) FontStyle() types.TFontStyle

func (*ProxyLogsGridColStyle) IsColor

func (m *ProxyLogsGridColStyle) IsColor() bool

func (*ProxyLogsGridColStyle) IsFontStyle

func (m *ProxyLogsGridColStyle) IsFontStyle() bool

func (*ProxyLogsGridColStyle) SetFontStyle

func (m *ProxyLogsGridColStyle) SetFontStyle(fontStyle types.TFontStyle) *ProxyLogsGridColStyle

func (*ProxyLogsGridColStyle) SetTColor

func (*ProxyLogsGridColStyle) SetText

func (*ProxyLogsGridColStyle) TColor

func (m *ProxyLogsGridColStyle) TColor() types.TColor

func (*ProxyLogsGridColStyle) Text

func (m *ProxyLogsGridColStyle) Text() string

type ProxyLogsGridRowStyle

type ProxyLogsGridRowStyle struct {
	// contains filtered or unexported fields
}

func NewRowStyle

func NewRowStyle() *ProxyLogsGridRowStyle

func (*ProxyLogsGridRowStyle) GetColStyle

func (m *ProxyLogsGridRowStyle) GetColStyle(col int32) *ProxyLogsGridColStyle

func (*ProxyLogsGridRowStyle) GetCols

func (*ProxyLogsGridRowStyle) SetColStyle

func (m *ProxyLogsGridRowStyle) SetColStyle(col int32, style *ProxyLogsGridColStyle)

type ProxyRequestDetail

type ProxyRequestDetail struct {
	Header    map[string][]string `json:"header"`
	Body      string              `json:"body"`
	URLParams map[string][]string `json:"url_params"`
	PostForm  map[string][]string `json:"post_form"`
	//Form      map[string][]string `json:"form"`
	Size int64 `json:"size"`
}

type ProxyResponseDetail

type ProxyResponseDetail struct {
	Header map[string][]string `json:"header"`
	Body   string              `json:"body"`
	Size   int64               `json:"size"`
}

Jump to

Keyboard shortcuts

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