eventlog

package
v0.0.0-...-572c485 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
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"
)
View Source
const (
	EventLogService_Listen_FullMethodName = "/milvus.proto.eventlog.EventLogService/Listen"
)

Variables

View Source
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.

View Source
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)

View Source
var File_event_log_proto protoreflect.FileDescriptor

Functions

func Flush

func Flush() error

Flush is the global helper function to `globalLogger.Flush`.

func Handler

func Handler() http.Handler

func Record

func Record(evt Evt)

Record is the global helper function to `globalLogger.Record`.

func RecordFunc

func RecordFunc(lvl Level, fn func() Evt)

RecordFunc is the global helper function to `globalLogger.RecordFunc`.

func Register

func Register(key string, logger Logger)

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) Descriptor() ([]byte, []int)

Deprecated: Use Event.ProtoReflect.Descriptor instead.

func (*Event) GetData

func (x *Event) GetData() []byte

func (*Event) GetLevel

func (x *Event) GetLevel() Level

func (*Event) GetTs

func (x *Event) GetTs() int64

func (*Event) GetType

func (x *Event) GetType() int32

func (*Event) ProtoMessage

func (*Event) ProtoMessage()

func (*Event) ProtoReflect

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

func (*Event) Reset

func (x *Event) Reset()

func (*Event) String

func (x *Event) String() string

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.

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 Evt

type Evt interface {
	Level() Level
	Type() int32
	Raw() []byte
}

Evt is event log interface.

func NewRawEvt

func NewRawEvt(level Level, data string) Evt

type Level

type Level int32
const (
	Level_Undefined Level = 0
	Level_Debug     Level = 1
	Level_Info      Level = 2
	Level_Warn      Level = 3
	Level_Error     Level = 4
)

func (Level) Descriptor

func (Level) Descriptor() protoreflect.EnumDescriptor

func (Level) Enum

func (x Level) Enum() *Level

func (Level) EnumDescriptor deprecated

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

Deprecated: Use Level.Descriptor instead.

func (Level) Number

func (x Level) Number() protoreflect.EnumNumber

func (Level) String

func (x Level) String() string

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

type MockLogger struct {
	mock.Mock
}

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

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

type MockLogger_Flush_Call struct {
	*mock.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 (*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

type MockLogger_RecordFunc_Call struct {
	*mock.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 (*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

type MockLogger_Record_Call struct {
	*mock.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 (*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

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.

Jump to

Keyboard shortcuts

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