Documentation
¶
Index ¶
- Constants
- Variables
- func Flush() error
- func Handler() http.Handler
- func Record(evt Evt)
- func RecordFunc(lvl Level, fn func() Evt)
- func Register(key string, logger Logger)
- func RegisterEventLogServiceServer(s grpc.ServiceRegistrar, srv EventLogServiceServer)
- type Event
- func (*Event) Descriptor() ([]byte, []int)deprecated
- func (x *Event) GetData() []byte
- func (x *Event) GetLevel() Level
- func (x *Event) GetTs() int64
- func (x *Event) GetType() int32
- func (*Event) ProtoMessage()
- func (x *Event) ProtoReflect() protoreflect.Message
- func (x *Event) Reset()
- func (x *Event) String() string
- type EventLogServiceClient
- type EventLogServiceServer
- type EventLogService_ListenClient
- type EventLogService_ListenServer
- type Evt
- type Level
- type ListenRequest
- type Logger
- type MockLogger
- type MockLogger_Expecter
- type MockLogger_Flush_Call
- type MockLogger_RecordFunc_Call
- type MockLogger_Record_Call
- type UnimplementedEventLogServiceServer
- type UnsafeEventLogServiceServer
Constants ¶
const ( // ContentTypeHeader is the health check request type header. ContentTypeHeader = "Content-Type" // ContentTypeText is the health check request type text. ContentTypeText = "text/plain" // ContentTypeJSON is another health check request type text, which response contains more info. ContentTypeJSON = "application/json" )
const (
EventLogService_Listen_FullMethodName = "/milvus.proto.eventlog.EventLogService/Listen"
)
Variables ¶
var ( Level_name = map[int32]string{ 0: "Undefined", 1: "Debug", 2: "Info", 3: "Warn", 4: "Error", } Level_value = map[string]int32{ "Undefined": 0, "Debug": 1, "Info": 2, "Warn": 3, "Error": 4, } )
Enum value maps for Level.
var EventLogService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "milvus.proto.eventlog.EventLogService", HandlerType: (*EventLogServiceServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "Listen", Handler: _EventLogService_Listen_Handler, ServerStreams: true, }, }, Metadata: "event_log.proto", }
EventLogService_ServiceDesc is the grpc.ServiceDesc for EventLogService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_event_log_proto protoreflect.FileDescriptor
Functions ¶
func RecordFunc ¶
RecordFunc is the global helper function to `globalLogger.RecordFunc`.
func RegisterEventLogServiceServer ¶
func RegisterEventLogServiceServer(s grpc.ServiceRegistrar, srv EventLogServiceServer)
Types ¶
type Event ¶
type Event struct {
Level Level `protobuf:"varint,1,opt,name=level,proto3,enum=milvus.proto.eventlog.Level" json:"level,omitempty"`
Type int32 `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"`
Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
Ts int64 `protobuf:"varint,4,opt,name=ts,proto3" json:"ts,omitempty"`
// contains filtered or unexported fields
}
func (*Event) Descriptor
deprecated
func (*Event) ProtoMessage ¶
func (*Event) ProtoMessage()
func (*Event) ProtoReflect ¶
func (x *Event) ProtoReflect() protoreflect.Message
type EventLogServiceClient ¶
type EventLogServiceClient interface {
Listen(ctx context.Context, in *ListenRequest, opts ...grpc.CallOption) (EventLogService_ListenClient, error)
}
EventLogServiceClient is the client API for EventLogService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewEventLogServiceClient ¶
func NewEventLogServiceClient(cc grpc.ClientConnInterface) EventLogServiceClient
type EventLogServiceServer ¶
type EventLogServiceServer interface {
Listen(*ListenRequest, EventLogService_ListenServer) error
}
EventLogServiceServer is the server API for EventLogService service. All implementations should embed UnimplementedEventLogServiceServer for forward compatibility
type EventLogService_ListenClient ¶
type EventLogService_ListenClient interface {
Recv() (*Event, error)
grpc.ClientStream
}
type EventLogService_ListenServer ¶
type EventLogService_ListenServer interface {
Send(*Event) error
grpc.ServerStream
}
type Level ¶
type Level int32
func (Level) Descriptor ¶
func (Level) Descriptor() protoreflect.EnumDescriptor
func (Level) EnumDescriptor
deprecated
func (Level) Number ¶
func (x Level) Number() protoreflect.EnumNumber
func (Level) Type ¶
func (Level) Type() protoreflect.EnumType
type ListenRequest ¶
type ListenRequest struct {
// contains filtered or unexported fields
}
func (*ListenRequest) Descriptor
deprecated
func (*ListenRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListenRequest.ProtoReflect.Descriptor instead.
func (*ListenRequest) ProtoMessage ¶
func (*ListenRequest) ProtoMessage()
func (*ListenRequest) ProtoReflect ¶
func (x *ListenRequest) ProtoReflect() protoreflect.Message
func (*ListenRequest) Reset ¶
func (x *ListenRequest) Reset()
func (*ListenRequest) String ¶
func (x *ListenRequest) String() string
type Logger ¶
type Logger interface {
// Record append log into logger directly.
Record(Evt)
// RecordFunc performs log level check & other implementation related check before composing the log entity
// preferred to use this when in performance related path
RecordFunc(Level, func() Evt)
// Flush is the API to invoke flush operation for logger (if any).
Flush() error
}
Logger is the interface for event loggers.
type MockLogger ¶
MockLogger is an autogenerated mock type for the Logger type
func NewMockLogger ¶
func NewMockLogger(t interface {
mock.TestingT
Cleanup(func())
}) *MockLogger
NewMockLogger creates a new instance of MockLogger. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockLogger) EXPECT ¶
func (_m *MockLogger) EXPECT() *MockLogger_Expecter
func (*MockLogger) Flush ¶
func (_m *MockLogger) Flush() error
Flush provides a mock function with given fields:
func (*MockLogger) Record ¶
func (_m *MockLogger) Record(_a0 Evt)
Record provides a mock function with given fields: _a0
func (*MockLogger) RecordFunc ¶
func (_m *MockLogger) RecordFunc(_a0 Level, _a1 func() Evt)
RecordFunc provides a mock function with given fields: _a0, _a1
type MockLogger_Expecter ¶
type MockLogger_Expecter struct {
// contains filtered or unexported fields
}
func (*MockLogger_Expecter) Flush ¶
func (_e *MockLogger_Expecter) Flush() *MockLogger_Flush_Call
Flush is a helper method to define mock.On call
func (*MockLogger_Expecter) Record ¶
func (_e *MockLogger_Expecter) Record(_a0 interface{}) *MockLogger_Record_Call
Record is a helper method to define mock.On call
- _a0 Evt
func (*MockLogger_Expecter) RecordFunc ¶
func (_e *MockLogger_Expecter) RecordFunc(_a0 interface{}, _a1 interface{}) *MockLogger_RecordFunc_Call
RecordFunc is a helper method to define mock.On call
- _a0 Level
- _a1 func() Evt
type MockLogger_Flush_Call ¶
MockLogger_Flush_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Flush'
func (*MockLogger_Flush_Call) Return ¶
func (_c *MockLogger_Flush_Call) Return(_a0 error) *MockLogger_Flush_Call
func (*MockLogger_Flush_Call) Run ¶
func (_c *MockLogger_Flush_Call) Run(run func()) *MockLogger_Flush_Call
func (*MockLogger_Flush_Call) RunAndReturn ¶
func (_c *MockLogger_Flush_Call) RunAndReturn(run func() error) *MockLogger_Flush_Call
type MockLogger_RecordFunc_Call ¶
MockLogger_RecordFunc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RecordFunc'
func (*MockLogger_RecordFunc_Call) Return ¶
func (_c *MockLogger_RecordFunc_Call) Return() *MockLogger_RecordFunc_Call
func (*MockLogger_RecordFunc_Call) Run ¶
func (_c *MockLogger_RecordFunc_Call) Run(run func(_a0 Level, _a1 func() Evt)) *MockLogger_RecordFunc_Call
func (*MockLogger_RecordFunc_Call) RunAndReturn ¶
func (_c *MockLogger_RecordFunc_Call) RunAndReturn(run func(Level, func() Evt)) *MockLogger_RecordFunc_Call
type MockLogger_Record_Call ¶
MockLogger_Record_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Record'
func (*MockLogger_Record_Call) Return ¶
func (_c *MockLogger_Record_Call) Return() *MockLogger_Record_Call
func (*MockLogger_Record_Call) Run ¶
func (_c *MockLogger_Record_Call) Run(run func(_a0 Evt)) *MockLogger_Record_Call
func (*MockLogger_Record_Call) RunAndReturn ¶
func (_c *MockLogger_Record_Call) RunAndReturn(run func(Evt)) *MockLogger_Record_Call
type UnimplementedEventLogServiceServer ¶
type UnimplementedEventLogServiceServer struct {
}
UnimplementedEventLogServiceServer should be embedded to have forward compatible implementations.
func (UnimplementedEventLogServiceServer) Listen ¶
func (UnimplementedEventLogServiceServer) Listen(*ListenRequest, EventLogService_ListenServer) error
type UnsafeEventLogServiceServer ¶
type UnsafeEventLogServiceServer interface {
// contains filtered or unexported methods
}
UnsafeEventLogServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to EventLogServiceServer will result in compilation errors.