logservice

package
v0.0.0-...-f219ead Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LogService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "logservice.LogService",
	HandlerType: (*LogServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ProcessLogs",
			Handler:    _LogService_ProcessLogs_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "log.proto",
}

LogService_ServiceDesc is the grpc.ServiceDesc for LogService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterLogServiceServer

func RegisterLogServiceServer(s grpc.ServiceRegistrar, srv LogServiceServer)

Types

type Grpc

type Grpc struct {
	UnimplementedLogServiceServer
	OutputService *LogOutputService
}

func (*Grpc) ProcessLogs

func (s *Grpc) ProcessLogs(_ context.Context, req *LogMessage) (*ReceivedMessage, error)

type HttpLogService

type HttpLogService struct {
	Mutex *sync.Mutex
}

func NewHttpLogService

func NewHttpLogService() *HttpLogService

type LogAuthService

type LogAuthService struct {
	Mutex              *sync.Mutex
	CollectorKeyCache  []string
	AgentKeyCache      []string
	ConnectionKeyCache string
}

func NewLogAuthService

func NewLogAuthService() *LogAuthService

func (*LogAuthService) GetConnectionKey

func (auth *LogAuthService) GetConnectionKey() string

func (*LogAuthService) IsConnectionKeyValid

func (auth *LogAuthService) IsConnectionKeyValid(connectionKey string) bool

func (*LogAuthService) IsKeyValid

func (auth *LogAuthService) IsKeyValid(key string, typ agent.ConnectorType) bool

func (*LogAuthService) SyncAuth

func (auth *LogAuthService) SyncAuth()

type LogData

type LogData struct {
	// contains filtered or unexported fields
}

type LogMessage

type LogMessage struct {
	Type    agent.ConnectorType `protobuf:"varint,1,opt,name=type,proto3,enum=agent.ConnectorType" json:"type,omitempty"`
	LogType string              `protobuf:"bytes,2,opt,name=log_type,json=logType,proto3" json:"log_type,omitempty"`
	Data    []string            `protobuf:"bytes,3,rep,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*LogMessage) Descriptor deprecated

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

Deprecated: Use LogMessage.ProtoReflect.Descriptor instead.

func (*LogMessage) GetData

func (x *LogMessage) GetData() []string

func (*LogMessage) GetLogType

func (x *LogMessage) GetLogType() string

func (*LogMessage) GetType

func (x *LogMessage) GetType() agent.ConnectorType

func (*LogMessage) ProtoMessage

func (*LogMessage) ProtoMessage()

func (*LogMessage) ProtoReflect

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

func (*LogMessage) Reset

func (x *LogMessage) Reset()

func (*LogMessage) String

func (x *LogMessage) String() string

type LogOutputService

type LogOutputService struct {
	Connections map[config.LogType]string
	Mutex       sync.Mutex
	Ticker      *time.Ticker
	Client      *http.Client
}

func NewLogOutputService

func NewLogOutputService() *LogOutputService

func (*LogOutputService) SendBulkLog

func (out *LogOutputService) SendBulkLog(logType config.LogType, logDataArray []string)

func (*LogOutputService) SendLog

func (out *LogOutputService) SendLog(logType config.LogType, logData string)

func (*LogOutputService) SyncOutputs

func (out *LogOutputService) SyncOutputs()

type LogService

type LogService struct {
	// contains filtered or unexported fields
}

func (*LogService) LogBulkData

func (l *LogService) LogBulkData(logType config.LogType, data []string)

func (*LogService) LogData

func (l *LogService) LogData(logType config.LogType, data string)

type LogServiceClient

type LogServiceClient interface {
	ProcessLogs(ctx context.Context, in *LogMessage, opts ...grpc.CallOption) (*ReceivedMessage, error)
}

LogServiceClient is the client API for LogService 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 NewLogServiceClient

func NewLogServiceClient(cc grpc.ClientConnInterface) LogServiceClient

type LogServiceServer

type LogServiceServer interface {
	ProcessLogs(context.Context, *LogMessage) (*ReceivedMessage, error)
	// contains filtered or unexported methods
}

LogServiceServer is the server API for LogService service. All implementations must embed UnimplementedLogServiceServer for forward compatibility

type ReceivedMessage

type ReceivedMessage struct {
	Received bool   `protobuf:"varint,1,opt,name=received,proto3" json:"received,omitempty"`
	Message  string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*ReceivedMessage) Descriptor deprecated

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

Deprecated: Use ReceivedMessage.ProtoReflect.Descriptor instead.

func (*ReceivedMessage) GetMessage

func (x *ReceivedMessage) GetMessage() string

func (*ReceivedMessage) GetReceived

func (x *ReceivedMessage) GetReceived() bool

func (*ReceivedMessage) ProtoMessage

func (*ReceivedMessage) ProtoMessage()

func (*ReceivedMessage) ProtoReflect

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

func (*ReceivedMessage) Reset

func (x *ReceivedMessage) Reset()

func (*ReceivedMessage) String

func (x *ReceivedMessage) String() string

type UnimplementedLogServiceServer

type UnimplementedLogServiceServer struct {
}

UnimplementedLogServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedLogServiceServer) ProcessLogs

type UnsafeLogServiceServer

type UnsafeLogServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeLogServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to LogServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

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