models

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//RequestType ...
	RequestType = 1
	//ResponseType ...
	ResponseType = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GrpcState added in v1.0.1

type GrpcState struct {
	IsPartialRead bool
	Buf           []byte
}

type Http2Request

type Http2Request struct {
	SrcHost     string
	SrcPort     string
	DstHost     string
	DstPort     string
	GrpcPath    string
	Message     interface{}
	MetaHeaders map[string]string
}

Http2Request represents http request

func NewHttp2Request

func NewHttp2Request(packet *Packet, stream *Stream, grpcMessage interface{}) *Http2Request

NewHttp2Request creates new Http2Request

func (*Http2Request) GetBody

func (r *Http2Request) GetBody() interface{}

GetBody ...

func (*Http2Request) GetDstHost

func (r *Http2Request) GetDstHost() string

GetDstHost ...

func (*Http2Request) GetDstPort

func (r *Http2Request) GetDstPort() string

GetDstPort ...

func (*Http2Request) GetHeaders

func (r *Http2Request) GetHeaders() map[string]string

GetHeaders ...

func (*Http2Request) GetPath

func (r *Http2Request) GetPath() string

GetPath ...

func (*Http2Request) GetSrcHost

func (r *Http2Request) GetSrcHost() string

GetSrcHost ...

func (*Http2Request) GetSrcPort

func (r *Http2Request) GetSrcPort() string

GetSrcPort ...

type Http2Response

type Http2Response struct {
	SrcHost     string
	SrcPort     string
	DstHost     string
	DstPort     string
	Message     interface{}
	MetaHeaders map[string]string
}

Http2Response represents http2 response

func NewHttp2Response

func NewHttp2Response(packet *Packet, stream *Stream, grpcMessage interface{}) *Http2Response

NewHttp2Response creates new Http2Request

func (*Http2Response) GetBody

func (r *Http2Response) GetBody() interface{}

GetBody ...

func (*Http2Response) GetDstHost

func (r *Http2Response) GetDstHost() string

GetDstHost ...

func (*Http2Response) GetDstPort

func (r *Http2Response) GetDstPort() string

GetDstPort ...

func (*Http2Response) GetHeaders

func (r *Http2Response) GetHeaders() map[string]string

GetHeaders ...

func (*Http2Response) GetPath

func (r *Http2Response) GetPath() string

GetPath ...

func (*Http2Response) GetSrcHost

func (r *Http2Response) GetSrcHost() string

GetSrcHost ...

func (*Http2Response) GetSrcPort

func (r *Http2Response) GetSrcPort() string

GetSrcPort ...

type HttpRequest

type HttpRequest struct {
	SrcHost string
	SrcPort string
	DstHost string
	DstPort string
	Method  string
	URL     string
}

HttpRequest represents http request

func NewHttpRequest

func NewHttpRequest(packet *Packet) *HttpRequest

NewHttpRequest creates new HttpRequest model

func (*HttpRequest) GetBody

func (r *HttpRequest) GetBody() interface{}

GetBody ...

func (*HttpRequest) GetDstHost

func (r *HttpRequest) GetDstHost() string

GetDstHost ...

func (*HttpRequest) GetDstPort

func (r *HttpRequest) GetDstPort() string

GetDstPort ...

func (*HttpRequest) GetHeaders

func (r *HttpRequest) GetHeaders() map[string]string

GetHeaders ...

func (*HttpRequest) GetPath

func (r *HttpRequest) GetPath() string

GetPath ...

func (*HttpRequest) GetSrcHost

func (r *HttpRequest) GetSrcHost() string

GetSrcHost ...

func (*HttpRequest) GetSrcPort

func (r *HttpRequest) GetSrcPort() string

GetSrcPort ...

type HttpResponse

type HttpResponse struct {
	SrcHost string
	SrcPort string
	DstHost string
	DstPort string
	Body    string
}

HttpResponse represents http response

func NewHttpResponse

func NewHttpResponse(packet *Packet) *HttpResponse

NewHttpResponse creates new HttpResponse model

func (*HttpResponse) GetBody

func (r *HttpResponse) GetBody() interface{}

GetBody ...

func (*HttpResponse) GetDstHost

func (r *HttpResponse) GetDstHost() string

GetDstHost ...

func (*HttpResponse) GetDstPort

func (r *HttpResponse) GetDstPort() string

GetDstPort ...

func (*HttpResponse) GetHeaders

func (r *HttpResponse) GetHeaders() map[string]string

GetHeaders ...

func (*HttpResponse) GetPath

func (r *HttpResponse) GetPath() string

GetPath ...

func (*HttpResponse) GetSrcHost

func (r *HttpResponse) GetSrcHost() string

GetSrcHost ...

func (*HttpResponse) GetSrcPort

func (r *HttpResponse) GetSrcPort() string

GetSrcPort ...

type Packet

type Packet struct {
	NetSrc       string
	NetDst       string
	TransportSrc string
	TransportDst string
}

Packet represents entity net request for view

func NewPacket

func NewPacket(net, transport gopacket.Flow) *Packet

NewPacket creates new request view from gopacket.Flow

func (*Packet) GetConnectionKey

func (packet *Packet) GetConnectionKey() string

GetConnectionKey returns connection string

func (*Packet) GetRevConnectionKey

func (packet *Packet) GetRevConnectionKey() string

GetRevConnectionKey returns connection string

type RenderModel

type RenderModel interface {
	GetSrcHost() string
	GetSrcPort() string
	GetDstHost() string
	GetDstPort() string
	GetPath() string
	GetBody() interface{}
	GetHeaders() map[string]string
}

RenderModel ...

type Stream

type Stream struct {
	ID                  uint32
	MetaHeaders         map[string]string
	Path                string
	Type                int
	GrpcState           GrpcState
	ResponseGrpcMessage interface{}
}

Stream ...

Jump to

Keyboard shortcuts

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