userlogger

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2025 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_app_userlogger_config_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type ErrorMessage

type ErrorMessage struct {
	Message   string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	Timestamp int64  `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// contains filtered or unexported fields
}

func (*ErrorMessage) Descriptor deprecated

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

Deprecated: Use ErrorMessage.ProtoReflect.Descriptor instead.

func (*ErrorMessage) GetMessage

func (x *ErrorMessage) GetMessage() string

func (*ErrorMessage) GetTimestamp

func (x *ErrorMessage) GetTimestamp() int64

func (*ErrorMessage) ProtoMessage

func (*ErrorMessage) ProtoMessage()

func (*ErrorMessage) ProtoReflect

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

func (*ErrorMessage) Reset

func (x *ErrorMessage) Reset()

func (*ErrorMessage) String

func (x *ErrorMessage) String() string

type Fallback

type Fallback struct {
	Sid uint32 `protobuf:"varint,1,opt,name=sid,proto3" json:"sid,omitempty"`
	// the handler that eventually handle this session
	Tag string `protobuf:"bytes,2,opt,name=tag,proto3" json:"tag,omitempty"`
	// contains filtered or unexported fields
}

func (*Fallback) Descriptor deprecated

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

Deprecated: Use Fallback.ProtoReflect.Descriptor instead.

func (*Fallback) GetSid

func (x *Fallback) GetSid() uint32

func (*Fallback) GetTag

func (x *Fallback) GetTag() string

func (*Fallback) ProtoMessage

func (*Fallback) ProtoMessage()

func (*Fallback) ProtoReflect

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

func (*Fallback) Reset

func (x *Fallback) Reset()

func (*Fallback) String

func (x *Fallback) String() string

type RejectMessage

type RejectMessage struct {
	Dst       string `protobuf:"bytes,1,opt,name=dst,proto3" json:"dst,omitempty"`
	Timestamp int64  `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	Domain    string `protobuf:"bytes,3,opt,name=domain,proto3" json:"domain,omitempty"`
	Reason    string `protobuf:"bytes,4,opt,name=reason,proto3" json:"reason,omitempty"`
	AppId     string `protobuf:"bytes,5,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"`
	// contains filtered or unexported fields
}

func (*RejectMessage) Descriptor deprecated

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

Deprecated: Use RejectMessage.ProtoReflect.Descriptor instead.

func (*RejectMessage) GetAppId

func (x *RejectMessage) GetAppId() string

func (*RejectMessage) GetDomain

func (x *RejectMessage) GetDomain() string

func (*RejectMessage) GetDst

func (x *RejectMessage) GetDst() string

func (*RejectMessage) GetReason

func (x *RejectMessage) GetReason() string

func (*RejectMessage) GetTimestamp

func (x *RejectMessage) GetTimestamp() int64

func (*RejectMessage) ProtoMessage

func (*RejectMessage) ProtoMessage()

func (*RejectMessage) ProtoReflect

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

func (*RejectMessage) Reset

func (x *RejectMessage) Reset()

func (*RejectMessage) String

func (x *RejectMessage) String() string

type RouteMessage

type RouteMessage struct {
	Dst       string `protobuf:"bytes,1,opt,name=dst,proto3" json:"dst,omitempty"`
	Tag       string `protobuf:"bytes,2,opt,name=tag,proto3" json:"tag,omitempty"`
	Timestamp int64  `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	AppId     string `protobuf:"bytes,4,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"`
	// when dst is ip, this field contains
	// sniffed domain
	SniffDomain   string `protobuf:"bytes,5,opt,name=sniff_domain,json=sniffDomain,proto3" json:"sniff_domain,omitempty"`
	Sid           uint32 `protobuf:"varint,6,opt,name=sid,proto3" json:"sid,omitempty"`
	IpToDomain    string `protobuf:"bytes,7,opt,name=ip_to_domain,json=ipToDomain,proto3" json:"ip_to_domain,omitempty"`
	SelectorTag   string `protobuf:"bytes,8,opt,name=selector_tag,json=selectorTag,proto3" json:"selector_tag,omitempty"`
	MatchedRule   string `protobuf:"bytes,9,opt,name=matched_rule,json=matchedRule,proto3" json:"matched_rule,omitempty"`
	InboundTag    string `protobuf:"bytes,10,opt,name=inbound_tag,json=inboundTag,proto3" json:"inbound_tag,omitempty"`
	Network       string `protobuf:"bytes,11,opt,name=network,proto3" json:"network,omitempty"`
	SniffProtofol string `protobuf:"bytes,12,opt,name=sniff_protofol,json=sniffProtofol,proto3" json:"sniff_protofol,omitempty"`
	Source        string `protobuf:"bytes,13,opt,name=source,proto3" json:"source,omitempty"`
	// contains filtered or unexported fields
}

func (*RouteMessage) Descriptor deprecated

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

Deprecated: Use RouteMessage.ProtoReflect.Descriptor instead.

func (*RouteMessage) GetAppId

func (x *RouteMessage) GetAppId() string

func (*RouteMessage) GetDst

func (x *RouteMessage) GetDst() string

func (*RouteMessage) GetInboundTag

func (x *RouteMessage) GetInboundTag() string

func (*RouteMessage) GetIpToDomain

func (x *RouteMessage) GetIpToDomain() string

func (*RouteMessage) GetMatchedRule

func (x *RouteMessage) GetMatchedRule() string

func (*RouteMessage) GetNetwork

func (x *RouteMessage) GetNetwork() string

func (*RouteMessage) GetSelectorTag

func (x *RouteMessage) GetSelectorTag() string

func (*RouteMessage) GetSid

func (x *RouteMessage) GetSid() uint32

func (*RouteMessage) GetSniffDomain

func (x *RouteMessage) GetSniffDomain() string

func (*RouteMessage) GetSniffProtofol

func (x *RouteMessage) GetSniffProtofol() string

func (*RouteMessage) GetSource

func (x *RouteMessage) GetSource() string

func (*RouteMessage) GetTag

func (x *RouteMessage) GetTag() string

func (*RouteMessage) GetTimestamp

func (x *RouteMessage) GetTimestamp() int64

func (*RouteMessage) ProtoMessage

func (*RouteMessage) ProtoMessage()

func (*RouteMessage) ProtoReflect

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

func (*RouteMessage) Reset

func (x *RouteMessage) Reset()

func (*RouteMessage) String

func (x *RouteMessage) String() string

type SessionError

type SessionError struct {
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	// int64 timestamp = 2;
	Sid  uint32 `protobuf:"varint,3,opt,name=sid,proto3" json:"sid,omitempty"`
	Up   uint32 `protobuf:"varint,4,opt,name=up,proto3" json:"up,omitempty"`
	Down uint32 `protobuf:"varint,5,opt,name=down,proto3" json:"down,omitempty"`
	// if the session dst is ip, this is the dns server
	// handles the dns query that resolves to the ip
	Dns string `protobuf:"bytes,6,opt,name=dns,proto3" json:"dns,omitempty"`
	// contains filtered or unexported fields
}

func (*SessionError) Descriptor deprecated

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

Deprecated: Use SessionError.ProtoReflect.Descriptor instead.

func (*SessionError) GetDns

func (x *SessionError) GetDns() string

func (*SessionError) GetDown

func (x *SessionError) GetDown() uint32

func (*SessionError) GetMessage

func (x *SessionError) GetMessage() string

func (*SessionError) GetSid

func (x *SessionError) GetSid() uint32

func (*SessionError) GetUp

func (x *SessionError) GetUp() uint32

func (*SessionError) ProtoMessage

func (*SessionError) ProtoMessage()

func (*SessionError) ProtoReflect

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

func (*SessionError) Reset

func (x *SessionError) Reset()

func (*SessionError) String

func (x *SessionError) String() string

type UserLogMessage

type UserLogMessage struct {

	// Types that are valid to be assigned to Message:
	//
	//	*UserLogMessage_RouteMessage
	//	*UserLogMessage_ErrorMessage
	//	*UserLogMessage_SessionError
	//	*UserLogMessage_RejectMessage
	//	*UserLogMessage_Fallback
	Message isUserLogMessage_Message `protobuf_oneof:"message"`
	// contains filtered or unexported fields
}

func (*UserLogMessage) Descriptor deprecated

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

Deprecated: Use UserLogMessage.ProtoReflect.Descriptor instead.

func (*UserLogMessage) GetErrorMessage

func (x *UserLogMessage) GetErrorMessage() *ErrorMessage

func (*UserLogMessage) GetFallback

func (x *UserLogMessage) GetFallback() *Fallback

func (*UserLogMessage) GetMessage

func (x *UserLogMessage) GetMessage() isUserLogMessage_Message

func (*UserLogMessage) GetRejectMessage

func (x *UserLogMessage) GetRejectMessage() *RejectMessage

func (*UserLogMessage) GetRouteMessage

func (x *UserLogMessage) GetRouteMessage() *RouteMessage

func (*UserLogMessage) GetSessionError

func (x *UserLogMessage) GetSessionError() *SessionError

func (*UserLogMessage) ProtoMessage

func (*UserLogMessage) ProtoMessage()

func (*UserLogMessage) ProtoReflect

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

func (*UserLogMessage) Reset

func (x *UserLogMessage) Reset()

func (*UserLogMessage) String

func (x *UserLogMessage) String() string

type UserLogMessage_ErrorMessage

type UserLogMessage_ErrorMessage struct {
	ErrorMessage *ErrorMessage `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3,oneof"`
}

type UserLogMessage_Fallback

type UserLogMessage_Fallback struct {
	Fallback *Fallback `protobuf:"bytes,5,opt,name=fallback,proto3,oneof"`
}

type UserLogMessage_RejectMessage

type UserLogMessage_RejectMessage struct {
	RejectMessage *RejectMessage `protobuf:"bytes,4,opt,name=reject_message,json=rejectMessage,proto3,oneof"`
}

type UserLogMessage_RouteMessage

type UserLogMessage_RouteMessage struct {
	RouteMessage *RouteMessage `protobuf:"bytes,1,opt,name=route_message,json=routeMessage,proto3,oneof"`
}

type UserLogMessage_SessionError

type UserLogMessage_SessionError struct {
	SessionError *SessionError `protobuf:"bytes,3,opt,name=session_error,json=sessionError,proto3,oneof"`
}

type UserLogger

type UserLogger struct {
	LogAppId atomic.Bool
	// contains filtered or unexported fields
}

func NewUserLogger

func NewUserLogger(enabled bool, logAppId bool, size int) *UserLogger

func (*UserLogger) Close

func (s *UserLogger) Close() error

func (*UserLogger) LogError

func (s *UserLogger) LogError(err error)

func (*UserLogger) LogFallback

func (s *UserLogger) LogFallback(info *session.Info, tag string)

func (*UserLogger) LogReject

func (s *UserLogger) LogReject(info *session.Info, reason string)

func (*UserLogger) LogRoute

func (s *UserLogger) LogRoute(info *session.Info, tag string)

func (*UserLogger) LogSessionError

func (s *UserLogger) LogSessionError(info *session.Info, err error)

when down link is 0, this is called. err might be nil

func (*UserLogger) ReadLog

func (s *UserLogger) ReadLog(ctx context.Context, slice []*UserLogMessage) (int, error)

func (*UserLogger) SetDns

func (s *UserLogger) SetDns(dnsConn ipToDomain)

func (*UserLogger) SetEnabled

func (s *UserLogger) SetEnabled(enabled bool)

Jump to

Keyboard shortcuts

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