mirror

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package mirror is a generated protocol buffer package.

It is generated from these files:

request.proto

It has these top-level messages:

HeaderValue
MetaValue
Request

Index

Constants

This section is empty.

Variables

View Source
var HTTPVersion_name = map[int32]string{
	0: "HTTP1_0",
	1: "HTTP1_1",
	2: "HTTP2",
}
View Source
var HTTPVersion_value = map[string]int32{
	"HTTP1_0": 0,
	"HTTP1_1": 1,
	"HTTP2":   2,
}
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",
}
View Source
var Method_value = map[string]int32{
	"GET":     0,
	"HEAD":    1,
	"POST":    2,
	"PUT":     3,
	"PATCH":   4,
	"DELETE":  5,
	"CONNECT": 6,
	"OPTIONS": 7,
	"TRACE":   8,
}
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) EnumDescriptor

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

func (HTTPVersion) String

func (x HTTPVersion) String() string

type HeaderValue

type HeaderValue struct {
	Values []string `protobuf:"bytes,2,rep,name=values" json:"values,omitempty"`
}

func (*HeaderValue) Descriptor

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

func (*HeaderValue) GetValues

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

func (*HeaderValue) ProtoMessage

func (*HeaderValue) ProtoMessage()

func (*HeaderValue) Reset

func (m *HeaderValue) Reset()

func (*HeaderValue) String

func (m *HeaderValue) String() string

type MetaValue

type MetaValue struct {
	// Types that are valid to be assigned to Value:
	//	*MetaValue_String_
	//	*MetaValue_Int
	//	*MetaValue_Bool
	Value isMetaValue_Value `protobuf_oneof:"value"`
}

func (*MetaValue) Descriptor

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

func (*MetaValue) GetBool

func (m *MetaValue) GetBool() bool

func (*MetaValue) GetInt

func (m *MetaValue) GetInt() int64

func (*MetaValue) GetString_

func (m *MetaValue) GetString_() string

func (*MetaValue) GetValue

func (m *MetaValue) GetValue() isMetaValue_Value

func (*MetaValue) ProtoMessage

func (*MetaValue) ProtoMessage()

func (*MetaValue) Reset

func (m *MetaValue) Reset()

func (*MetaValue) String

func (m *MetaValue) String() string

func (*MetaValue) XXX_OneofFuncs

func (*MetaValue) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

XXX_OneofFuncs is for the internal use of the proto package.

type MetaValue_Bool

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

type MetaValue_Int

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

type MetaValue_String_

type MetaValue_String_ struct {
	String_ string `protobuf:"bytes,1,opt,name=string,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) EnumDescriptor

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

func (Method) String

func (x Method) String() string

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        *google_protobuf.Timestamp `protobuf:"bytes,1,opt,name=time" json:"time,omitempty"`
	Method      Method                     `protobuf:"varint,2,opt,name=method,enum=mirror.Method" json:"method,omitempty"`
	Path        string                     `protobuf:"bytes,3,opt,name=path" json:"path,omitempty"`
	HttpVersion HTTPVersion                `protobuf:"varint,4,opt,name=http_version,json=httpVersion,enum=mirror.HTTPVersion" json:"http_version,omitempty"`
	Headers     map[string]*HeaderValue    `` /* 134-byte string literal not displayed */
	Body        []byte                     `protobuf:"bytes,6,opt,name=body,proto3" json:"body,omitempty"`
	Meta        map[string]*MetaValue      `` /* 128-byte string literal not displayed */
}

func (*Request) Descriptor

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

func (*Request) GetBody

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

func (*Request) GetHeaders

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

func (*Request) GetHttpVersion

func (m *Request) GetHttpVersion() HTTPVersion

func (*Request) GetMeta

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

func (*Request) GetMethod

func (m *Request) GetMethod() Method

func (*Request) GetPath

func (m *Request) GetPath() string

func (*Request) GetTime

func (m *Request) GetTime() *google_protobuf.Timestamp

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) Reset

func (m *Request) Reset()

func (*Request) String

func (m *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