monitordrpc

package
v0.1.44 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_monitord_proto protoreflect.FileDescriptor
View Source
var Monitor_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "monitord.Monitor",
	HandlerType: (*MonitorServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "IsLogName",
			Handler:    _Monitor_IsLogName_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "ListLogNames",
			Handler:       _Monitor_ListLogNames_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "Stream",
			Handler:       _Monitor_Stream_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "monitord.proto",
}

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

Functions

func FromNameMatches

func FromNameMatches(n *NameMatches) monitor.NameMatches

FromNameMatches returns the monitor.NameMatches object corresponding to the NameMatches object n

func FromStreamMatches

func FromStreamMatches(m *StreamMatches) (name string, start *monitor.Time, finish *monitor.Time, match monitor.Matches, err error)

FromStreamMatches returns the log name, start time, finish time, and the monitor.Matches object match corresponding to the StreamMatches object m

func RegisterMonitorServer

func RegisterMonitorServer(s grpc.ServiceRegistrar, srv MonitorServer)

func Scan

func Scan(dest *monitor.Entry, e *Entry) error

Scan converts the Entry e, scanning the result into the monitor.Entry object "dest". Any previously set data in "dest" will be deleted or overwritten.

func ToTime

func ToTime(t *Time) (*monitor.Time, error)

ToTime return returns the monitor.Time object corresponding to the Time object t.

Types

type Entry

type Entry struct {
	Identifier string                 `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"`                   // The source identifier
	LogName    string                 `protobuf:"bytes,2,opt,name=log_name,json=logName,proto3" json:"log_name,omitempty"`          // The log name
	LogMessage string                 `protobuf:"bytes,3,opt,name=log_message,json=logMessage,proto3" json:"log_message,omitempty"` // The log message
	Data       string                 `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"`                               // A string of optional JSON-encoded data
	Time       *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=time,proto3" json:"time,omitempty"`                               // The timestamp
	// contains filtered or unexported fields
}

Entry represents an entry in a log

func FromEntry

func FromEntry(e monitor.Entry) (*Entry, error)

FromEntry returns the Entry corresponding to the monitor.Entry object e.

func (*Entry) Descriptor deprecated

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

Deprecated: Use Entry.ProtoReflect.Descriptor instead.

func (*Entry) GetData

func (x *Entry) GetData() string

func (*Entry) GetIdentifier

func (x *Entry) GetIdentifier() string

func (*Entry) GetLogMessage

func (x *Entry) GetLogMessage() string

func (*Entry) GetLogName

func (x *Entry) GetLogName() string

func (*Entry) GetTime

func (x *Entry) GetTime() *timestamppb.Timestamp

func (*Entry) ProtoMessage

func (*Entry) ProtoMessage()

func (*Entry) ProtoReflect added in v0.1.30

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

func (*Entry) Reset

func (x *Entry) Reset()

func (*Entry) String

func (x *Entry) String() string

type EntryMatches

type EntryMatches struct {
	MessageSubstring       string `protobuf:"bytes,1,opt,name=message_substring,json=messageSubstring,proto3" json:"message_substring,omitempty"`            // A substring all messages must contain
	MessageNotSubstring    string `protobuf:"bytes,2,opt,name=message_not_substring,json=messageNotSubstring,proto3" json:"message_not_substring,omitempty"` // A substring all messages must not contain
	MessageRegexp          string `protobuf:"bytes,3,opt,name=message_regexp,json=messageRegexp,proto3" json:"message_regexp,omitempty"`                     // A regular expression all messages must match
	MessageNotRegexp       string `protobuf:"bytes,4,opt,name=message_not_regexp,json=messageNotRegexp,proto3" json:"message_not_regexp,omitempty"`          // A regular expression all messages must not match
	IdentifierSubstring    string `protobuf:"bytes,5,opt,name=identifier_substring,json=identifierSubstring,proto3" json:"identifier_substring,omitempty"`   // A substring all identifiers must contain
	IdentifierNotSubstring string ``                                                                                                                         // A substring all identifiers must not contain
	/* 129-byte string literal not displayed */
	IdentifierRegexp    string `protobuf:"bytes,7,opt,name=identifier_regexp,json=identifierRegexp,proto3" json:"identifier_regexp,omitempty"`            // A regular expression all identifiers must match
	IdentifierNotRegexp string `protobuf:"bytes,8,opt,name=identifier_not_regexp,json=identifierNotRegexp,proto3" json:"identifier_not_regexp,omitempty"` // A regular expression all identifiers must not match
	// contains filtered or unexported fields
}

EntryMatches represents a match condition on entries

func (*EntryMatches) Descriptor deprecated

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

Deprecated: Use EntryMatches.ProtoReflect.Descriptor instead.

func (*EntryMatches) GetIdentifierNotRegexp

func (x *EntryMatches) GetIdentifierNotRegexp() string

func (*EntryMatches) GetIdentifierNotSubstring

func (x *EntryMatches) GetIdentifierNotSubstring() string

func (*EntryMatches) GetIdentifierRegexp

func (x *EntryMatches) GetIdentifierRegexp() string

func (*EntryMatches) GetIdentifierSubstring

func (x *EntryMatches) GetIdentifierSubstring() string

func (*EntryMatches) GetMessageNotRegexp

func (x *EntryMatches) GetMessageNotRegexp() string

func (*EntryMatches) GetMessageNotSubstring

func (x *EntryMatches) GetMessageNotSubstring() string

func (*EntryMatches) GetMessageRegexp

func (x *EntryMatches) GetMessageRegexp() string

func (*EntryMatches) GetMessageSubstring

func (x *EntryMatches) GetMessageSubstring() string

func (*EntryMatches) ProtoMessage

func (*EntryMatches) ProtoMessage()

func (*EntryMatches) ProtoReflect added in v0.1.30

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

func (*EntryMatches) Reset

func (x *EntryMatches) Reset()

func (*EntryMatches) String

func (x *EntryMatches) String() string

type LogName

type LogName struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // The log name
	// contains filtered or unexported fields
}

LogName represents a log name

func ToLogName

func ToLogName(n string) *LogName

ToLogName returns the LogName object corresponding to the string n

func (*LogName) Descriptor deprecated

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

Deprecated: Use LogName.ProtoReflect.Descriptor instead.

func (*LogName) GetName

func (x *LogName) GetName() string

func (*LogName) ProtoMessage

func (*LogName) ProtoMessage()

func (*LogName) ProtoReflect added in v0.1.30

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

func (*LogName) Reset

func (x *LogName) Reset()

func (*LogName) String

func (x *LogName) String() string

type MonitorClient

type MonitorClient interface {
	// IsLogName returns true iff the given string is a log name.
	IsLogName(ctx context.Context, in *LogName, opts ...grpc.CallOption) (*wrapperspb.BoolValue, error)
	// ListLogNames returns the log names filtered by NameMatches.
	ListLogNames(ctx context.Context, in *NameMatches, opts ...grpc.CallOption) (Monitor_ListLogNamesClient, error)
	// Stream returns a stream down which entries from the "log_name" are
	// passed. Only entries falling into the range determined by "from" and
	// "to" will be returned. If "from" is unassigned then the start of the
	// log will be used; if "to" is unassigned then no end is used. Returned
	// entries will be filtered by EntryMatches.
	Stream(ctx context.Context, in *StreamMatches, opts ...grpc.CallOption) (Monitor_StreamClient, error)
}

MonitorClient is the client API for Monitor 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 NewMonitorClient

func NewMonitorClient(cc grpc.ClientConnInterface) MonitorClient

type MonitorServer

type MonitorServer interface {
	// IsLogName returns true iff the given string is a log name.
	IsLogName(context.Context, *LogName) (*wrapperspb.BoolValue, error)
	// ListLogNames returns the log names filtered by NameMatches.
	ListLogNames(*NameMatches, Monitor_ListLogNamesServer) error
	// Stream returns a stream down which entries from the "log_name" are
	// passed. Only entries falling into the range determined by "from" and
	// "to" will be returned. If "from" is unassigned then the start of the
	// log will be used; if "to" is unassigned then no end is used. Returned
	// entries will be filtered by EntryMatches.
	Stream(*StreamMatches, Monitor_StreamServer) error
	// contains filtered or unexported methods
}

MonitorServer is the server API for Monitor service. All implementations must embed UnimplementedMonitorServer for forward compatibility

type Monitor_ListLogNamesClient

type Monitor_ListLogNamesClient interface {
	Recv() (*LogName, error)
	grpc.ClientStream
}

type Monitor_ListLogNamesServer

type Monitor_ListLogNamesServer interface {
	Send(*LogName) error
	grpc.ServerStream
}

type Monitor_StreamClient

type Monitor_StreamClient interface {
	Recv() (*Entry, error)
	grpc.ClientStream
}

type Monitor_StreamServer

type Monitor_StreamServer interface {
	Send(*Entry) error
	grpc.ServerStream
}

type NameMatches

type NameMatches struct {
	Substring    string `protobuf:"bytes,1,opt,name=substring,proto3" json:"substring,omitempty"`                           // A substring all log names must contain
	NotSubstring string `protobuf:"bytes,2,opt,name=not_substring,json=notSubstring,proto3" json:"not_substring,omitempty"` // A substring all log names must not contain
	Regexp       string `protobuf:"bytes,3,opt,name=regexp,proto3" json:"regexp,omitempty"`                                 // A regular expression all log names must match
	NotRegexp    string `protobuf:"bytes,4,opt,name=not_regexp,json=notRegexp,proto3" json:"not_regexp,omitempty"`          // A regular expression all log names must not match
	// contains filtered or unexported fields
}

NameMatches represents a match condition on log names

func ToNameMatches

func ToNameMatches(n monitor.NameMatches) *NameMatches

ToNameMatches returns the NameMatches object corresponding to the monitor.NameMatches object n

func (*NameMatches) Descriptor deprecated

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

Deprecated: Use NameMatches.ProtoReflect.Descriptor instead.

func (*NameMatches) GetNotRegexp

func (x *NameMatches) GetNotRegexp() string

func (*NameMatches) GetNotSubstring

func (x *NameMatches) GetNotSubstring() string

func (*NameMatches) GetRegexp

func (x *NameMatches) GetRegexp() string

func (*NameMatches) GetSubstring

func (x *NameMatches) GetSubstring() string

func (*NameMatches) ProtoMessage

func (*NameMatches) ProtoMessage()

func (*NameMatches) ProtoReflect added in v0.1.30

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

func (*NameMatches) Reset

func (x *NameMatches) Reset()

func (*NameMatches) String

func (x *NameMatches) String() string

type StreamMatches

type StreamMatches struct {
	LogName *LogName      `protobuf:"bytes,1,opt,name=log_name,json=logName,proto3" json:"log_name,omitempty"` // The log name
	From    *Time         `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"`                      // The time to start streaming from
	To      *Time         `protobuf:"bytes,3,opt,name=to,proto3" json:"to,omitempty"`                          // The time to stream up until
	Match   *EntryMatches `protobuf:"bytes,4,opt,name=match,proto3" json:"match,omitempty"`                    // The match condition on entries
	// contains filtered or unexported fields
}

StreamMatches describes the search conditions on a log

func ToStreamMatches

func ToStreamMatches(name string, start *monitor.Time, finish *monitor.Time, m monitor.Matches) (*StreamMatches, error)

ToStreamMatches returns the StreamMatches object corresponding to the given log name, start time,finish time, and the monitor.Matches object m

func (*StreamMatches) Descriptor deprecated

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

Deprecated: Use StreamMatches.ProtoReflect.Descriptor instead.

func (*StreamMatches) GetFrom

func (x *StreamMatches) GetFrom() *Time

func (*StreamMatches) GetLogName

func (x *StreamMatches) GetLogName() *LogName

func (*StreamMatches) GetMatch

func (x *StreamMatches) GetMatch() *EntryMatches

func (*StreamMatches) GetTo

func (x *StreamMatches) GetTo() *Time

func (*StreamMatches) ProtoMessage

func (*StreamMatches) ProtoMessage()

func (*StreamMatches) ProtoReflect added in v0.1.30

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

func (*StreamMatches) Reset

func (x *StreamMatches) Reset()

func (*StreamMatches) String

func (x *StreamMatches) String() string

type Time

type Time struct {

	// Types that are assignable to Type:
	//	*Time_Unassigned
	//	*Time_Offset
	//	*Time_Time
	Type isTime_Type `protobuf_oneof:"type"`
	// contains filtered or unexported fields
}

Time represents a point in time, which can be either unassigned, a time, or as an offset from the most recent entry in the log. A positive offset represents an offset into the past; a negative offset represents an offset into the future. That is, Time may take one of three possible values:

  • unassigned -- representing no time specified
  • an int64 offset, counting the last log message received as 0
  • a timestamp

func FromTime

func FromTime(t *monitor.Time) (*Time, error)

FromTime returns the Time object corresponding to the monitor.Time object t.

func (*Time) Descriptor deprecated

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

Deprecated: Use Time.ProtoReflect.Descriptor instead.

func (*Time) GetOffset

func (x *Time) GetOffset() int64

func (*Time) GetTime

func (x *Time) GetTime() *timestamppb.Timestamp

func (*Time) GetType

func (m *Time) GetType() isTime_Type

func (*Time) GetUnassigned

func (x *Time) GetUnassigned() bool

func (*Time) ProtoMessage

func (*Time) ProtoMessage()

func (*Time) ProtoReflect added in v0.1.30

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

func (*Time) Reset

func (x *Time) Reset()

func (*Time) String

func (x *Time) String() string

type Time_Offset

type Time_Offset struct {
	Offset int64 `protobuf:"varint,2,opt,name=offset,proto3,oneof"` // An integer offset, counting the last log message received as 0
}

type Time_Time

type Time_Time struct {
	Time *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=time,proto3,oneof"` // The timestamp
}

type Time_Unassigned

type Time_Unassigned struct {
	Unassigned bool `protobuf:"varint,1,opt,name=unassigned,proto3,oneof"` // True iff no value is assigned
}

type UnimplementedMonitorServer

type UnimplementedMonitorServer struct {
}

UnimplementedMonitorServer must be embedded to have forward compatible implementations.

func (UnimplementedMonitorServer) IsLogName

func (UnimplementedMonitorServer) ListLogNames

func (UnimplementedMonitorServer) Stream

type UnsafeMonitorServer added in v0.1.30

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

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

Jump to

Keyboard shortcuts

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