mirror

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Method_name = map[int32]string{
		0: "GET",
		1: "HEAD",
		2: "POST",
		3: "PUT",
		4: "PATCH",
		5: "DELETE",
		6: "CONNECT",
		7: "OPTIONS",
		8: "TRACE",
	}
	Method_value = map[string]int32{
		"GET":     0,
		"HEAD":    1,
		"POST":    2,
		"PUT":     3,
		"PATCH":   4,
		"DELETE":  5,
		"CONNECT": 6,
		"OPTIONS": 7,
		"TRACE":   8,
	}
)

Enum value maps for Method.

View Source
var (
	HTTPVersion_name = map[int32]string{
		0: "HTTP1_0",
		1: "HTTP1_1",
		2: "HTTP2",
	}
	HTTPVersion_value = map[string]int32{
		"HTTP1_0": 0,
		"HTTP1_1": 1,
		"HTTP2":   2,
	}
)

Enum value maps for HTTPVersion.

View Source
var File_request_proto protoreflect.FileDescriptor
View Source
var (
	RequestsTotal = promauto.NewCounterVec(prometheus.CounterOpts{
		Name: "requets_total",
		Help: "The total number of requets handled by the module",
	}, []string{"module"})
)

Functions

This section is empty.

Types

type HTTPVersion

type HTTPVersion int32
const (
	HTTPVersion_HTTP1_0 HTTPVersion = 0
	HTTPVersion_HTTP1_1 HTTPVersion = 1
	HTTPVersion_HTTP2   HTTPVersion = 2
)

func (HTTPVersion) Descriptor added in v1.0.12

func (HTTPVersion) Enum added in v1.0.12

func (x HTTPVersion) Enum() *HTTPVersion

func (HTTPVersion) EnumDescriptor deprecated

func (HTTPVersion) EnumDescriptor() ([]byte, []int)

Deprecated: Use HTTPVersion.Descriptor instead.

func (HTTPVersion) Number added in v1.0.12

func (x HTTPVersion) Number() protoreflect.EnumNumber

func (HTTPVersion) String

func (x HTTPVersion) String() string

func (HTTPVersion) Type added in v1.0.12

type HeaderValue

type HeaderValue struct {
	Values []string `protobuf:"bytes,2,rep,name=values,proto3" json:"values,omitempty"`
	// contains filtered or unexported fields
}

func (*HeaderValue) Descriptor deprecated

func (*HeaderValue) Descriptor() ([]byte, []int)

Deprecated: Use HeaderValue.ProtoReflect.Descriptor instead.

func (*HeaderValue) GetValues

func (x *HeaderValue) GetValues() []string

func (*HeaderValue) ProtoMessage

func (*HeaderValue) ProtoMessage()

func (*HeaderValue) ProtoReflect added in v1.0.12

func (x *HeaderValue) ProtoReflect() protoreflect.Message

func (*HeaderValue) Reset

func (x *HeaderValue) Reset()

func (*HeaderValue) String

func (x *HeaderValue) String() string

type MetaValue

type MetaValue struct {

	// Types that are assignable to Value:
	//	*MetaValue_String_
	//	*MetaValue_Int
	//	*MetaValue_Bool
	Value isMetaValue_Value `protobuf_oneof:"value"`
	// contains filtered or unexported fields
}

func (*MetaValue) Descriptor deprecated

func (*MetaValue) Descriptor() ([]byte, []int)

Deprecated: Use MetaValue.ProtoReflect.Descriptor instead.

func (*MetaValue) GetBool

func (x *MetaValue) GetBool() bool

func (*MetaValue) GetInt

func (x *MetaValue) GetInt() int64

func (*MetaValue) GetString_

func (x *MetaValue) GetString_() string

func (*MetaValue) GetValue

func (m *MetaValue) GetValue() isMetaValue_Value

func (*MetaValue) ProtoMessage

func (*MetaValue) ProtoMessage()

func (*MetaValue) ProtoReflect added in v1.0.12

func (x *MetaValue) ProtoReflect() protoreflect.Message

func (*MetaValue) Reset

func (x *MetaValue) Reset()

func (*MetaValue) String

func (x *MetaValue) String() string

type MetaValue_Bool

type MetaValue_Bool struct {
	Bool bool `protobuf:"varint,3,opt,name=bool,proto3,oneof"`
}

type MetaValue_Int

type MetaValue_Int struct {
	Int int64 `protobuf:"varint,2,opt,name=int,proto3,oneof"`
}

type MetaValue_String_

type MetaValue_String_ struct {
	String_ string `protobuf:"bytes,1,opt,name=string,proto3,oneof"`
}

type Method

type Method int32
const (
	Method_GET     Method = 0
	Method_HEAD    Method = 1
	Method_POST    Method = 2
	Method_PUT     Method = 3
	Method_PATCH   Method = 4
	Method_DELETE  Method = 5
	Method_CONNECT Method = 6
	Method_OPTIONS Method = 7
	Method_TRACE   Method = 8
)

func (Method) Descriptor added in v1.0.12

func (Method) Descriptor() protoreflect.EnumDescriptor

func (Method) Enum added in v1.0.12

func (x Method) Enum() *Method

func (Method) EnumDescriptor deprecated

func (Method) EnumDescriptor() ([]byte, []int)

Deprecated: Use Method.Descriptor instead.

func (Method) Number added in v1.0.12

func (x Method) Number() protoreflect.EnumNumber

func (Method) String

func (x Method) String() string

func (Method) Type added in v1.0.12

func (Method) Type() protoreflect.EnumType

type Module

type Module interface {
	Context() *ModuleContext
	SetInput(<-chan Request)
	Output() <-chan Request
	Children() [][]Module
}

type ModuleContext

type ModuleContext struct {
	Type string
	Name string
	RPS  int
	// contains filtered or unexported fields
}

func (*ModuleContext) HandledRequest

func (c *ModuleContext) HandledRequest()

func (*ModuleContext) Role

func (c *ModuleContext) Role() string

func (*ModuleContext) Run

func (c *ModuleContext) Run()

type Request

type Request struct {
	Time        *timestamppb.Timestamp  `protobuf:"bytes,1,opt,name=time,proto3" json:"time,omitempty"`
	Method      Method                  `protobuf:"varint,2,opt,name=method,proto3,enum=mirror.Method" json:"method,omitempty"`
	Path        string                  `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"`
	HttpVersion HTTPVersion             `protobuf:"varint,4,opt,name=http_version,json=httpVersion,proto3,enum=mirror.HTTPVersion" json:"http_version,omitempty"`
	Headers     map[string]*HeaderValue `` /* 155-byte string literal not displayed */
	Body        []byte                  `protobuf:"bytes,6,opt,name=body,proto3" json:"body,omitempty"`
	Meta        map[string]*MetaValue   `` /* 149-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*Request) Descriptor deprecated

func (*Request) Descriptor() ([]byte, []int)

Deprecated: Use Request.ProtoReflect.Descriptor instead.

func (*Request) GetBody

func (x *Request) GetBody() []byte

func (*Request) GetHeaders

func (x *Request) GetHeaders() map[string]*HeaderValue

func (*Request) GetHttpVersion

func (x *Request) GetHttpVersion() HTTPVersion

func (*Request) GetMeta

func (x *Request) GetMeta() map[string]*MetaValue

func (*Request) GetMethod

func (x *Request) GetMethod() Method

func (*Request) GetPath

func (x *Request) GetPath() string

func (*Request) GetTime

func (x *Request) GetTime() *timestamppb.Timestamp

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) ProtoReflect added in v1.0.12

func (x *Request) ProtoReflect() protoreflect.Message

func (*Request) Reset

func (x *Request) Reset()

func (*Request) String

func (x *Request) String() string

Directories

Path Synopsis
modules

Jump to

Keyboard shortcuts

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