Documentation ¶
Index ¶
- Variables
- func DelParamOrHeader(httpReq *http.Request, keys ...string)
- func GenerateId() string
- func GetParamOrHeader(httpReq *http.Request, keys ...string) string
- func ReadBody(body io.ReadCloser, header http.Header, maxEventSize int64) ([]byte, error)
- type Category
- type Code
- type Component
- func (c *Component) BrokerSubject() string
- func (*Component) Descriptor() ([]byte, []int)deprecated
- func (lhs *Component) Equal(rhs *Component) bool
- func (x *Component) GetApp() string
- func (x *Component) GetBrokerId() string
- func (x *Component) GetHash() string
- func (x *Component) GetId() string
- func (x *Component) GetName() string
- func (x *Component) GetType() string
- func (c *Component) GroupKey() string
- func (c *Component) GroupSubject() string
- func (c *Component) IsComplete() bool
- func (c *Component) IsNameOnly() bool
- func (c *Component) Key() string
- func (*Component) ProtoMessage()
- func (x *Component) ProtoReflect() protoreflect.Message
- func (x *Component) Reset()
- func (c *Component) ShortHash() string
- func (x *Component) String() string
- func (c *Component) Subject() string
- type Err
- func ErrBrokerMismatch(cause ...error) *Err
- func ErrBrokerUnavailable(cause ...error) *Err
- func ErrComponentGone(cause ...error) *Err
- func ErrComponentMismatch(cause ...error) *Err
- func ErrContentTooLarge(cause ...error) *Err
- func ErrInvalid(cause ...error) *Err
- func ErrNotFound(cause ...error) *Err
- func ErrPortUnavailable(cause ...error) *Err
- func ErrRouteInvalid(cause ...error) *Err
- func ErrRouteNotFound(cause ...error) *Err
- func ErrTimeout(cause ...error) *Err
- func ErrUnauthorized(cause ...error) *Err
- func ErrUnexpected(cause ...error) *Err
- func ErrUnknownContentType(cause ...error) *Err
- func ErrUnsupportedAdapter(cause ...error) *Err
- func NewKubeFoxErr(msg string, code Code, grpcCode codes.Code, httpCode int, cause ...error) *Err
- func (e *Err) Code() Code
- func (e *Err) Error() string
- func (e *Err) Format(s fmt.State, verb rune)
- func (e *Err) GRPCCode() codes.Code
- func (e *Err) GRPCStatus() *status.Status
- func (e *Err) HTTPCode() int
- func (e *Err) Is(err error) bool
- func (e *Err) MarshalJSON() ([]byte, error)
- func (e *Err) String() string
- func (e *Err) UnmarshalJSON(value []byte) error
- func (e *Err) Unwrap() error
- type Event
- func (evt *Event) AddHeader(key, value string)
- func (evt *Event) Bind(v any) error
- func (evt *Event) BindStrict(v any) error
- func (evt *Event) Bytes() []byte
- func (evt *Event) DelHeader(key string)
- func (evt *Event) DelQuery(key string)
- func (evt *Event) DelValueMapKey(valKey, key string)
- func (*Event) Descriptor() ([]byte, []int)deprecated
- func (evt *Event) Err() error
- func (evt *Event) EventType() api.EventType
- func (x *Event) GetCategory() Category
- func (x *Event) GetContent() []byte
- func (x *Event) GetContentType() string
- func (x *Event) GetContext() *EventContext
- func (x *Event) GetCreateTime() int64
- func (x *Event) GetId() string
- func (x *Event) GetParams() map[string]*structpb.Value
- func (x *Event) GetParentId() string
- func (x *Event) GetParentSpan() *SpanContext
- func (x *Event) GetSource() *Component
- func (x *Event) GetTarget() *Component
- func (x *Event) GetTtl() int64
- func (x *Event) GetType() string
- func (x *Event) GetValues() map[string]*structpb.Value
- func (evt *Event) HTTPRequest(ctx context.Context) (*http.Request, error)
- func (evt *Event) HTTPResponse() *http.Response
- func (evt *Event) HasContext() bool
- func (evt *Event) Header(key string) string
- func (evt *Event) HeaderAll(key string) []string
- func (evt *Event) HeaderDef(key string, def string) string
- func (evt *Event) HeaderV(key string) *api.Val
- func (evt *Event) Param(key string) string
- func (evt *Event) ParamDef(key string, def string) string
- func (evt *Event) ParamProto(key string) *structpb.Value
- func (evt *Event) ParamV(key string) *api.Val
- func (evt *Event) PathSuffix() string
- func (*Event) ProtoMessage()
- func (x *Event) ProtoReflect() protoreflect.Message
- func (evt *Event) Query(key string) string
- func (evt *Event) QueryAll(key string) []string
- func (evt *Event) QueryDef(key string, def string) string
- func (evt *Event) QueryV(key string) *api.Val
- func (evt *Event) ReduceTTL(start time.Time) time.Duration
- func (x *Event) Reset()
- func (evt *Event) RewritePath(path string)
- func (evt *Event) SetContext(evtCtx *EventContext)
- func (evt *Event) SetHTTPRequest(httpReq *http.Request, maxEventSize int64) error
- func (evt *Event) SetHTTPResponse(httpResp *http.Response, maxEventSize int64) error
- func (evt *Event) SetHeader(key, value string)
- func (evt *Event) SetHeaderV(key string, value *api.Val)
- func (evt *Event) SetJSON(v any) error
- func (evt *Event) SetParam(key string, val string)
- func (evt *Event) SetParamProto(key string, val *structpb.Value)
- func (evt *Event) SetParamV(key string, val *api.Val)
- func (evt *Event) SetParent(parent *Event)
- func (evt *Event) SetQuery(key, value string)
- func (evt *Event) SetQueryV(key string, value *api.Val)
- func (evt *Event) SetRoute(route *Route)
- func (evt *Event) SetStatus(code int)
- func (evt *Event) SetStatusV(val *api.Val)
- func (evt *Event) SetTTL(t time.Duration)
- func (evt *Event) SetURL(u *url.URL)
- func (evt *Event) SetValue(key string, val string)
- func (evt *Event) SetValueMap(key string, m map[string][]string)
- func (evt *Event) SetValueMapKey(valKey, key, value string, overwrite bool)
- func (evt *Event) SetValueProto(key string, val *structpb.Value)
- func (evt *Event) SetValueV(key string, val *api.Val)
- func (evt *Event) SpanId() string
- func (evt *Event) Status() int
- func (evt *Event) StatusV() *api.Val
- func (evt *Event) Str() string
- func (x *Event) String() string
- func (evt *Event) TTL() time.Duration
- func (evt *Event) TraceId() string
- func (evt *Event) URL() (*url.URL, error)
- func (evt *Event) Value(key string) string
- func (evt *Event) ValueMap(key string) map[string][]string
- func (evt *Event) ValueMapKey(valKey, key string) string
- func (evt *Event) ValueMapKeyAll(valKey, key string) []string
- func (evt *Event) ValueProto(key string) *structpb.Value
- func (evt *Event) ValueV(key string) *api.Val
- type EventContext
- func (*EventContext) Descriptor() ([]byte, []int)deprecated
- func (x *EventContext) GetAppDeployment() string
- func (x *EventContext) GetPlatform() string
- func (x *EventContext) GetReleaseManifest() string
- func (x *EventContext) GetVirtualEnvironment() string
- func (*EventContext) ProtoMessage()
- func (x *EventContext) ProtoReflect() protoreflect.Message
- func (x *EventContext) Reset()
- func (x *EventContext) String() string
- type EventOpts
- type Frame
- type LimitedReader
- type MatchedEvent
- func (*MatchedEvent) Descriptor() ([]byte, []int)deprecated
- func (x *MatchedEvent) GetEnv() map[string]*structpb.Value
- func (x *MatchedEvent) GetEvent() *Event
- func (x *MatchedEvent) GetRouteId() int64
- func (*MatchedEvent) ProtoMessage()
- func (x *MatchedEvent) ProtoReflect() protoreflect.Message
- func (x *MatchedEvent) Reset()
- func (x *MatchedEvent) String() string
- type Route
- type SpanContext
- func (*SpanContext) Descriptor() ([]byte, []int)deprecated
- func (x *SpanContext) GetFlags() uint32
- func (x *SpanContext) GetSpanId() []byte
- func (x *SpanContext) GetTraceId() []byte
- func (x *SpanContext) GetTraceState() string
- func (*SpanContext) ProtoMessage()
- func (x *SpanContext) ProtoReflect() protoreflect.Message
- func (x *SpanContext) Reset()
- func (s *SpanContext) Sampled() bool
- func (x *SpanContext) String() string
- type Stack
- type StackTrace
- type Telemetry
- func (*Telemetry) Descriptor() ([]byte, []int)deprecated
- func (x *Telemetry) GetLogRecords() []*v1.LogRecord
- func (x *Telemetry) GetMetrics() []*v11.Metric
- func (x *Telemetry) GetSpans() []*v12.Span
- func (x *Telemetry) GetTraceId() []byte
- func (*Telemetry) ProtoMessage()
- func (x *Telemetry) ProtoReflect() protoreflect.Message
- func (x *Telemetry) Reset()
- func (x *Telemetry) String() string
Constants ¶
This section is empty.
Variables ¶
var ( Category_name = map[int32]string{ 0: "UNKNOWN", 1: "MESSAGE", 2: "REQUEST", 3: "RESPONSE", } Category_value = map[string]int32{ "UNKNOWN": 0, "MESSAGE": 1, "REQUEST": 2, "RESPONSE": 3, } )
Enum value maps for Category.
var File_protobuf_msgs_proto protoreflect.FileDescriptor
var RecordStackTraces bool
var (
RuleParamRegexp = regexp.MustCompile(`([^\\])({[^}]+})`)
)
Functions ¶
func DelParamOrHeader ¶
DelParamOrHeader deletes all query parameters and headers that match provided keys.
func GenerateId ¶
func GenerateId() string
func GetParamOrHeader ¶
GetParamOrHeader looks for query parameters and headers for the provided keys. Keys are checked in order. Query parameters take precedence over headers.
Types ¶
type Category ¶
type Category int32
func (Category) Descriptor ¶
func (Category) Descriptor() protoreflect.EnumDescriptor
func (Category) EnumDescriptor
deprecated
func (Category) Number ¶
func (x Category) Number() protoreflect.EnumNumber
func (Category) Type ¶
func (Category) Type() protoreflect.EnumType
type Component ¶
type Component struct { Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` App string `protobuf:"bytes,2,opt,name=app,proto3" json:"app,omitempty"` Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` Hash string `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"` Id string `protobuf:"bytes,5,opt,name=id,proto3" json:"id,omitempty"` BrokerId string `protobuf:"bytes,6,opt,name=broker_id,json=brokerId,proto3" json:"broker_id,omitempty"` // contains filtered or unexported fields }
func NewComponent ¶
func NewComponent(typ api.ComponentType, app, name, hash string) *Component
func NewPlatformComponent ¶
func NewPlatformComponent(typ api.ComponentType, name, hash string) *Component
func NewTargetComponent ¶
func NewTargetComponent(typ api.ComponentType, name string) *Component
func (*Component) BrokerSubject ¶
func (*Component) Descriptor
deprecated
func (*Component) GetBrokerId ¶
func (*Component) GroupSubject ¶
func (*Component) IsComplete ¶
func (*Component) IsNameOnly ¶
func (*Component) ProtoMessage ¶
func (*Component) ProtoMessage()
func (*Component) ProtoReflect ¶
func (x *Component) ProtoReflect() protoreflect.Message
type Err ¶
type Err struct {
// contains filtered or unexported fields
}
func ErrBrokerMismatch ¶
func ErrBrokerUnavailable ¶
func ErrComponentGone ¶
func ErrComponentMismatch ¶
func ErrContentTooLarge ¶
func ErrInvalid ¶
func ErrNotFound ¶
func ErrPortUnavailable ¶
func ErrRouteInvalid ¶
func ErrRouteNotFound ¶
func ErrTimeout ¶
func ErrUnauthorized ¶
func ErrUnexpected ¶
func ErrUnknownContentType ¶
func ErrUnsupportedAdapter ¶
func NewKubeFoxErr ¶
func (*Err) GRPCStatus ¶
func (*Err) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface.
func (*Err) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface.
type Event ¶
type Event struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` ParentId string `protobuf:"bytes,2,opt,name=parent_id,json=parentId,proto3" json:"parent_id,omitempty"` ParentSpan *SpanContext `protobuf:"bytes,3,opt,name=parent_span,json=parentSpan,proto3" json:"parent_span,omitempty"` Type string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"` Category Category `protobuf:"varint,5,opt,name=category,proto3,enum=kubefox.proto.v1.Category" json:"category,omitempty"` // Unix time in nanosecond CreateTime int64 `protobuf:"varint,6,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` // TTL in nanosecond Ttl int64 `protobuf:"varint,7,opt,name=ttl,proto3" json:"ttl,omitempty"` Context *EventContext `protobuf:"bytes,8,opt,name=context,proto3" json:"context,omitempty"` Source *Component `protobuf:"bytes,9,opt,name=source,proto3" json:"source,omitempty"` Target *Component `protobuf:"bytes,10,opt,name=target,proto3" json:"target,omitempty"` Params map[string]*structpb.Value `` /* 154-byte string literal not displayed */ Values map[string]*structpb.Value `` /* 154-byte string literal not displayed */ ContentType string `protobuf:"bytes,14,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"` Content []byte `protobuf:"bytes,15,opt,name=content,proto3" json:"content,omitempty"` // contains filtered or unexported fields }
func CloneToReq ¶
func CloneToResp ¶
func (*Event) BindStrict ¶
func (*Event) DelValueMapKey ¶
func (*Event) Descriptor
deprecated
func (*Event) GetCategory ¶
func (*Event) GetContent ¶
func (*Event) GetContentType ¶
func (*Event) GetContext ¶
func (x *Event) GetContext() *EventContext
func (*Event) GetCreateTime ¶
func (*Event) GetParentId ¶
func (*Event) GetParentSpan ¶ added in v0.7.0
func (x *Event) GetParentSpan() *SpanContext
func (*Event) HTTPRequest ¶
func (*Event) HTTPResponse ¶
func (*Event) HasContext ¶
func (*Event) PathSuffix ¶ added in v0.6.0
func (*Event) ProtoMessage ¶
func (*Event) ProtoMessage()
func (*Event) ProtoReflect ¶
func (x *Event) ProtoReflect() protoreflect.Message
func (*Event) RewritePath ¶ added in v0.6.0
func (*Event) SetContext ¶
func (evt *Event) SetContext(evtCtx *EventContext)
func (*Event) SetHTTPRequest ¶
func (*Event) SetHTTPResponse ¶
func (*Event) SetStatusV ¶
func (*Event) SetValueMapKey ¶
func (*Event) ValueMapKey ¶
func (*Event) ValueMapKeyAll ¶
type EventContext ¶
type EventContext struct { Platform string `protobuf:"bytes,1,opt,name=platform,proto3" json:"platform,omitempty"` VirtualEnvironment string `protobuf:"bytes,2,opt,name=virtual_environment,json=virtualEnvironment,proto3" json:"virtual_environment,omitempty"` AppDeployment string `protobuf:"bytes,3,opt,name=app_deployment,json=appDeployment,proto3" json:"app_deployment,omitempty"` ReleaseManifest string `protobuf:"bytes,4,opt,name=release_manifest,json=releaseManifest,proto3" json:"release_manifest,omitempty"` // contains filtered or unexported fields }
func (*EventContext) Descriptor
deprecated
func (*EventContext) Descriptor() ([]byte, []int)
Deprecated: Use EventContext.ProtoReflect.Descriptor instead.
func (*EventContext) GetAppDeployment ¶
func (x *EventContext) GetAppDeployment() string
func (*EventContext) GetPlatform ¶
func (x *EventContext) GetPlatform() string
func (*EventContext) GetReleaseManifest ¶
func (x *EventContext) GetReleaseManifest() string
func (*EventContext) GetVirtualEnvironment ¶
func (x *EventContext) GetVirtualEnvironment() string
func (*EventContext) ProtoMessage ¶
func (*EventContext) ProtoMessage()
func (*EventContext) ProtoReflect ¶
func (x *EventContext) ProtoReflect() protoreflect.Message
func (*EventContext) Reset ¶
func (x *EventContext) Reset()
func (*EventContext) String ¶
func (x *EventContext) String() string
type Frame ¶
type Frame uintptr
Frame represents a program counter inside a stack frame. For historical reasons if Frame is interpreted as a uintptr its value represents the program counter + 1.
func (Frame) Format ¶
Format formats the frame according to the fmt.Formatter interface.
%s source file %d source line %n function name %v equivalent to %s:%d
Format accepts flags that alter the printing of some verbs, as follows:
%+s function name and path of source file relative to the compile time GOPATH separated by \n\t (<funcname>\n\t<path>) %+v equivalent to %+s:%d
func (Frame) MarshalText ¶
MarshalText formats a stacktrace Frame as a text string. The output is the same as that of fmt.Sprintf("%+v", f), but without newlines or tabs.
type LimitedReader ¶
Copyright 2009 The Go Authors. All rights reserved. https://cs.opensource.google/go/go/+/refs/tags/go1.20:src/io/io.go;l=456 https://cs.opensource.google/go/go/+/refs/tags/go1.20:LICENSE
LimitedReader reads from R but limits the amount of data returned to just N bytes. Each call to Read updates N to reflect the new amount remaining. Read returns ErrContentTooLarge when N <= 0.
This is a variation of io.LimitedReader that returns a different err for exceeding limit and EOF.
type MatchedEvent ¶
type MatchedEvent struct { Event *Event `protobuf:"bytes,1,opt,name=event,proto3" json:"event,omitempty"` RouteId int64 `protobuf:"varint,2,opt,name=route_id,json=routeId,proto3" json:"route_id,omitempty"` Env map[string]*structpb.Value `` /* 147-byte string literal not displayed */ // contains filtered or unexported fields }
func (*MatchedEvent) Descriptor
deprecated
func (*MatchedEvent) Descriptor() ([]byte, []int)
Deprecated: Use MatchedEvent.ProtoReflect.Descriptor instead.
func (*MatchedEvent) GetEvent ¶
func (x *MatchedEvent) GetEvent() *Event
func (*MatchedEvent) GetRouteId ¶
func (x *MatchedEvent) GetRouteId() int64
func (*MatchedEvent) ProtoMessage ¶
func (*MatchedEvent) ProtoMessage()
func (*MatchedEvent) ProtoReflect ¶
func (x *MatchedEvent) ProtoReflect() protoreflect.Message
func (*MatchedEvent) Reset ¶
func (x *MatchedEvent) Reset()
func (*MatchedEvent) String ¶
func (x *MatchedEvent) String() string
type Route ¶
type Route struct { *api.EnvTemplate Id int ResolvedRule string Priority int Component *Component EventContext *EventContext }
type SpanContext ¶ added in v0.6.0
type SpanContext struct { TraceId []byte `protobuf:"bytes,1,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"` SpanId []byte `protobuf:"bytes,2,opt,name=span_id,json=spanId,proto3" json:"span_id,omitempty"` TraceState string `protobuf:"bytes,3,opt,name=trace_state,json=traceState,proto3" json:"trace_state,omitempty"` Flags uint32 `protobuf:"fixed32,4,opt,name=flags,proto3" json:"flags,omitempty"` // contains filtered or unexported fields }
func (*SpanContext) Descriptor
deprecated
added in
v0.6.0
func (*SpanContext) Descriptor() ([]byte, []int)
Deprecated: Use SpanContext.ProtoReflect.Descriptor instead.
func (*SpanContext) GetFlags ¶ added in v0.6.0
func (x *SpanContext) GetFlags() uint32
func (*SpanContext) GetSpanId ¶ added in v0.6.0
func (x *SpanContext) GetSpanId() []byte
func (*SpanContext) GetTraceId ¶ added in v0.6.0
func (x *SpanContext) GetTraceId() []byte
func (*SpanContext) GetTraceState ¶ added in v0.6.0
func (x *SpanContext) GetTraceState() string
func (*SpanContext) ProtoMessage ¶ added in v0.6.0
func (*SpanContext) ProtoMessage()
func (*SpanContext) ProtoReflect ¶ added in v0.6.0
func (x *SpanContext) ProtoReflect() protoreflect.Message
func (*SpanContext) Reset ¶ added in v0.6.0
func (x *SpanContext) Reset()
func (*SpanContext) Sampled ¶ added in v0.7.2
func (s *SpanContext) Sampled() bool
func (*SpanContext) String ¶ added in v0.6.0
func (x *SpanContext) String() string
type Stack ¶
type Stack []uintptr
Stack represents a Stack of program counters.
func (*Stack) StackTrace ¶
func (s *Stack) StackTrace() StackTrace
type StackTrace ¶
type StackTrace []Frame
StackTrace is stack of Frames from innermost (newest) to outermost (oldest).
func (StackTrace) Format ¶
func (st StackTrace) Format(s fmt.State, verb rune)
Format formats the stack of Frames according to the fmt.Formatter interface.
%s lists source files for each Frame in the stack %v lists the source file and line number for each Frame in the stack
Format accepts flags that alter the printing of some verbs, as follows:
%+v Prints filename, function, and line number for each Frame in the stack.
type Telemetry ¶ added in v0.7.0
type Telemetry struct { TraceId []byte `protobuf:"bytes,1,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"` LogRecords []*v1.LogRecord `protobuf:"bytes,13,rep,name=log_records,json=logRecords,proto3" json:"log_records,omitempty"` Metrics []*v11.Metric `protobuf:"bytes,14,rep,name=metrics,proto3" json:"metrics,omitempty"` Spans []*v12.Span `protobuf:"bytes,15,rep,name=spans,proto3" json:"spans,omitempty"` // contains filtered or unexported fields }
func (*Telemetry) Descriptor
deprecated
added in
v0.7.0
func (*Telemetry) GetLogRecords ¶ added in v0.7.0
func (*Telemetry) GetMetrics ¶ added in v0.7.0
func (*Telemetry) GetTraceId ¶ added in v0.7.0
func (*Telemetry) ProtoMessage ¶ added in v0.7.0
func (*Telemetry) ProtoMessage()
func (*Telemetry) ProtoReflect ¶ added in v0.7.0
func (x *Telemetry) ProtoReflect() protoreflect.Message