proto

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: AGPL-3.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EventType_name = map[int32]string{
		0: "Unspecified",
		1: "PeerAdd",
		2: "PeerRemove",
		3: "PeerUpdate",
		4: "PeerTraffic",
		5: "PeerFirstConnect",
	}
	EventType_value = map[string]int32{
		"Unspecified":      0,
		"PeerAdd":          1,
		"PeerRemove":       2,
		"PeerUpdate":       3,
		"PeerTraffic":      4,
		"PeerFirstConnect": 5,
	}
)

Enum value maps for EventType.

View Source
var EventLogService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "proto.EventLogService",
	HandlerType: (*EventLogServiceServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "FetchEvents",
			Handler:       _EventLogService_FetchEvents_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "EventFetched",
			Handler:       _EventLogService_EventFetched_Handler,
			ClientStreams: true,
		},
	},
	Metadata: "eventlog.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_eventlog_proto protoreflect.FileDescriptor
View Source
var File_events_proto protoreflect.FileDescriptor
View Source
var File_timestamp_proto protoreflect.FileDescriptor

Functions

func RegisterEventLogServiceServer

func RegisterEventLogServiceServer(s grpc.ServiceRegistrar, srv EventLogServiceServer)

Types

type EventFetchedRequest added in v0.3.5

type EventFetchedRequest struct {

	// position to ack the server about read event
	Position *EventLogPosition `protobuf:"bytes,1,opt,name=position,proto3" json:"position,omitempty"`
	// Delete event log position for given subscriber
	ResetEventlogPosition bool `` /* 127-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*EventFetchedRequest) Descriptor deprecated added in v0.3.5

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

Deprecated: Use EventFetchedRequest.ProtoReflect.Descriptor instead.

func (*EventFetchedRequest) GetPosition added in v0.3.5

func (x *EventFetchedRequest) GetPosition() *EventLogPosition

func (*EventFetchedRequest) GetResetEventlogPosition added in v0.3.5

func (x *EventFetchedRequest) GetResetEventlogPosition() bool

func (*EventFetchedRequest) ProtoMessage added in v0.3.5

func (*EventFetchedRequest) ProtoMessage()

func (*EventFetchedRequest) ProtoReflect added in v0.3.5

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

func (*EventFetchedRequest) Reset added in v0.3.5

func (x *EventFetchedRequest) Reset()

func (*EventFetchedRequest) String added in v0.3.5

func (x *EventFetchedRequest) String() string

type EventFetchedResponse added in v0.3.5

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

func (*EventFetchedResponse) Descriptor deprecated added in v0.3.5

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

Deprecated: Use EventFetchedResponse.ProtoReflect.Descriptor instead.

func (*EventFetchedResponse) ProtoMessage added in v0.3.5

func (*EventFetchedResponse) ProtoMessage()

func (*EventFetchedResponse) ProtoReflect added in v0.3.5

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

func (*EventFetchedResponse) Reset added in v0.3.5

func (x *EventFetchedResponse) Reset()

func (*EventFetchedResponse) String added in v0.3.5

func (x *EventFetchedResponse) String() string

type EventLogPosition added in v0.3.5

type EventLogPosition struct {
	LogId  string `protobuf:"bytes,1,opt,name=log_id,json=logId,proto3" json:"log_id,omitempty"`
	Offset int64  `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"`
	// contains filtered or unexported fields
}

Position in the evenlog to start/resume the events

func (*EventLogPosition) Descriptor deprecated added in v0.3.5

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

Deprecated: Use EventLogPosition.ProtoReflect.Descriptor instead.

func (*EventLogPosition) GetLogId added in v0.3.5

func (x *EventLogPosition) GetLogId() string

func (*EventLogPosition) GetOffset added in v0.3.5

func (x *EventLogPosition) GetOffset() int64

func (*EventLogPosition) ProtoMessage added in v0.3.5

func (*EventLogPosition) ProtoMessage()

func (*EventLogPosition) ProtoReflect added in v0.3.5

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

func (*EventLogPosition) Reset added in v0.3.5

func (x *EventLogPosition) Reset()

func (*EventLogPosition) String added in v0.3.5

func (x *EventLogPosition) String() string

type EventLogServiceClient

type EventLogServiceClient interface {
	// FetchEvents streams back events to a caller
	FetchEvents(ctx context.Context, in *FetchEventsRequest, opts ...grpc.CallOption) (EventLogService_FetchEventsClient, error)
	// [Optional] EventFetched steams up the notifiactions about fetched events
	EventFetched(ctx context.Context, opts ...grpc.CallOption) (EventLogService_EventFetchedClient, 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 {
	// FetchEvents streams back events to a caller
	FetchEvents(*FetchEventsRequest, EventLogService_FetchEventsServer) error
	// [Optional] EventFetched steams up the notifiactions about fetched events
	EventFetched(EventLogService_EventFetchedServer) error
	// contains filtered or unexported methods
}

EventLogServiceServer is the server API for EventLogService service. All implementations must embed UnimplementedEventLogServiceServer for forward compatibility

type EventLogService_EventFetchedClient added in v0.3.5

type EventLogService_EventFetchedClient interface {
	Send(*EventFetchedRequest) error
	CloseAndRecv() (*EventFetchedResponse, error)
	grpc.ClientStream
}

type EventLogService_EventFetchedServer added in v0.3.5

type EventLogService_EventFetchedServer interface {
	SendAndClose(*EventFetchedResponse) error
	Recv() (*EventFetchedRequest, error)
	grpc.ServerStream
}

type EventLogService_FetchEventsClient

type EventLogService_FetchEventsClient interface {
	Recv() (*FetchEventsResponse, error)
	grpc.ClientStream
}

type EventLogService_FetchEventsServer

type EventLogService_FetchEventsServer interface {
	Send(*FetchEventsResponse) error
	grpc.ServerStream
}

type EventType

type EventType int32

EventType defines types to use with the eventlog package

const (
	EventType_Unspecified EventType = 0
	EventType_PeerAdd     EventType = 1
	EventType_PeerRemove  EventType = 2
	EventType_PeerUpdate  EventType = 3
	// PeerTraffic is for the periodic traffic updates
	EventType_PeerTraffic      EventType = 4
	EventType_PeerFirstConnect EventType = 5
)

func (EventType) Descriptor

func (EventType) Descriptor() protoreflect.EnumDescriptor

func (EventType) Enum

func (x EventType) Enum() *EventType

func (EventType) EnumDescriptor deprecated

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

Deprecated: Use EventType.Descriptor instead.

func (EventType) Number

func (x EventType) Number() protoreflect.EnumNumber

func (EventType) String

func (x EventType) String() string

func (EventType) Type

type FetchEventsRequest

type FetchEventsRequest struct {

	// Position to start event streaming
	// Empty data treats to stream out the events from the beginning
	// In case position is not supplied, the events is streamed from the active (current log)
	Position *EventLogPosition `protobuf:"bytes,1,opt,name=position,proto3" json:"position,omitempty"`
	// Skip event at given position to implement non inclusive start reading from the given position
	SkipEventAtPosition bool `protobuf:"varint,2,opt,name=skip_event_at_position,json=skipEventAtPosition,proto3" json:"skip_event_at_position,omitempty"`
	// event_types contains the list of even types client interested in.
	// Empty list means all events. Optional.
	EventTypes []EventType `protobuf:"varint,3,rep,packed,name=event_types,json=eventTypes,proto3,enum=proto.EventType" json:"event_types,omitempty"`
	// contains filtered or unexported fields
}

func (*FetchEventsRequest) Descriptor deprecated

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

Deprecated: Use FetchEventsRequest.ProtoReflect.Descriptor instead.

func (*FetchEventsRequest) GetEventTypes

func (x *FetchEventsRequest) GetEventTypes() []EventType

func (*FetchEventsRequest) GetPosition added in v0.3.5

func (x *FetchEventsRequest) GetPosition() *EventLogPosition

func (*FetchEventsRequest) GetSkipEventAtPosition added in v0.3.5

func (x *FetchEventsRequest) GetSkipEventAtPosition() bool

func (*FetchEventsRequest) ProtoMessage

func (*FetchEventsRequest) ProtoMessage()

func (*FetchEventsRequest) ProtoReflect

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

func (*FetchEventsRequest) Reset

func (x *FetchEventsRequest) Reset()

func (*FetchEventsRequest) String

func (x *FetchEventsRequest) String() string

type FetchEventsResponse

type FetchEventsResponse struct {
	EventType EventType         `protobuf:"varint,1,opt,name=event_type,json=eventType,proto3,enum=proto.EventType" json:"event_type,omitempty"`
	Timestamp *Timestamp        `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	Position  *EventLogPosition `protobuf:"bytes,3,opt,name=position,proto3" json:"position,omitempty"`
	Data      []byte            `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

FetchEventsResponse is a mirror of eventlog.Event struct.

func (*FetchEventsResponse) Descriptor deprecated

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

Deprecated: Use FetchEventsResponse.ProtoReflect.Descriptor instead.

func (*FetchEventsResponse) GetData

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

func (*FetchEventsResponse) GetEventType

func (x *FetchEventsResponse) GetEventType() EventType

func (*FetchEventsResponse) GetPosition added in v0.3.5

func (x *FetchEventsResponse) GetPosition() *EventLogPosition

func (*FetchEventsResponse) GetTimestamp

func (x *FetchEventsResponse) GetTimestamp() *Timestamp

func (*FetchEventsResponse) ProtoMessage

func (*FetchEventsResponse) ProtoMessage()

func (*FetchEventsResponse) ProtoReflect

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

func (*FetchEventsResponse) Reset

func (x *FetchEventsResponse) Reset()

func (*FetchEventsResponse) String

func (x *FetchEventsResponse) String() string

type PeerInfo

type PeerInfo struct {
	UserID         string     `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID,omitempty"`
	InstallationID string     `protobuf:"bytes,2,opt,name=installationID,proto3" json:"installationID,omitempty"`
	SessionID      string     `protobuf:"bytes,3,opt,name=sessionID,proto3" json:"sessionID,omitempty"`
	Created        *Timestamp `protobuf:"bytes,5,opt,name=created,proto3" json:"created,omitempty"`
	Updated        *Timestamp `protobuf:"bytes,6,opt,name=updated,proto3" json:"updated,omitempty"`
	Expires        *Timestamp `protobuf:"bytes,7,opt,name=expires,proto3" json:"expires,omitempty"`
	BytesTx        uint64     `protobuf:"varint,8,opt,name=bytesTx,proto3" json:"bytesTx,omitempty"`
	BytesRx        uint64     `protobuf:"varint,9,opt,name=bytesRx,proto3" json:"bytesRx,omitempty"`
	Activity       *Timestamp `protobuf:"bytes,10,opt,name=activity,proto3" json:"activity,omitempty"`
	Label          string     `protobuf:"bytes,11,opt,name=label,proto3" json:"label,omitempty"`
	BytesDeltaTx   uint64     `protobuf:"varint,12,opt,name=bytesDeltaTx,proto3" json:"bytesDeltaTx,omitempty"`
	BytesDeltaRx   uint64     `protobuf:"varint,13,opt,name=bytesDeltaRx,proto3" json:"bytesDeltaRx,omitempty"`
	Seconds        uint64     `protobuf:"varint,14,opt,name=seconds,proto3" json:"seconds,omitempty"`
	ActivityID     string     `protobuf:"bytes,15,opt,name=activityID,proto3" json:"activityID,omitempty"`
	Country        string     `protobuf:"bytes,16,opt,name=country,proto3" json:"country,omitempty"`
	// contains filtered or unexported fields
}

PeerInfo describes the peer interacting with the tunnel node

func (*PeerInfo) Descriptor deprecated

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

Deprecated: Use PeerInfo.ProtoReflect.Descriptor instead.

func (*PeerInfo) GetActivity added in v0.3.5

func (x *PeerInfo) GetActivity() *Timestamp

func (*PeerInfo) GetActivityID added in v0.3.5

func (x *PeerInfo) GetActivityID() string

func (*PeerInfo) GetBytesDeltaRx added in v0.3.5

func (x *PeerInfo) GetBytesDeltaRx() uint64

func (*PeerInfo) GetBytesDeltaTx added in v0.3.5

func (x *PeerInfo) GetBytesDeltaTx() uint64

func (*PeerInfo) GetBytesRx

func (x *PeerInfo) GetBytesRx() uint64

func (*PeerInfo) GetBytesTx

func (x *PeerInfo) GetBytesTx() uint64

func (*PeerInfo) GetCountry added in v0.3.5

func (x *PeerInfo) GetCountry() string

func (*PeerInfo) GetCreated

func (x *PeerInfo) GetCreated() *Timestamp

func (*PeerInfo) GetExpires

func (x *PeerInfo) GetExpires() *Timestamp

func (*PeerInfo) GetInstallationID

func (x *PeerInfo) GetInstallationID() string

func (*PeerInfo) GetLabel added in v0.3.5

func (x *PeerInfo) GetLabel() string

func (*PeerInfo) GetSeconds added in v0.3.5

func (x *PeerInfo) GetSeconds() uint64

func (*PeerInfo) GetSessionID

func (x *PeerInfo) GetSessionID() string

func (*PeerInfo) GetUpdated

func (x *PeerInfo) GetUpdated() *Timestamp

func (*PeerInfo) GetUserID

func (x *PeerInfo) GetUserID() string

func (*PeerInfo) ProtoMessage

func (*PeerInfo) ProtoMessage()

func (*PeerInfo) ProtoReflect

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

func (*PeerInfo) Reset

func (x *PeerInfo) Reset()

func (*PeerInfo) String

func (x *PeerInfo) String() string

type Timestamp

type Timestamp struct {
	Sec  int64 `protobuf:"varint,1,opt,name=sec,proto3" json:"sec,omitempty"`
	Nsec int64 `protobuf:"varint,2,opt,name=nsec,proto3" json:"nsec,omitempty"`
	// contains filtered or unexported fields
}

Timestamp represents the local Time corresponding to the given Unix time, sec seconds and nsec nanoseconds since January 1, 1970 UTC. It is valid to pass nsec outside the range [0, 999999999]. Not all sec values have a corresponding time value. One such value is 1<<63-1 (the largest int64 value).

func TimestampFromTime

func TimestampFromTime(t time.Time) *Timestamp

TimestampFromTime converts given std time.Time into Timestamp

func (*Timestamp) Descriptor deprecated

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

Deprecated: Use Timestamp.ProtoReflect.Descriptor instead.

func (*Timestamp) GetNsec

func (x *Timestamp) GetNsec() int64

func (*Timestamp) GetSec

func (x *Timestamp) GetSec() int64

func (*Timestamp) IntoTime

func (x *Timestamp) IntoTime() time.Time

func (*Timestamp) ProtoMessage

func (*Timestamp) ProtoMessage()

func (*Timestamp) ProtoReflect

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

func (*Timestamp) Reset

func (x *Timestamp) Reset()

func (*Timestamp) String

func (x *Timestamp) String() string

type UnimplementedEventLogServiceServer

type UnimplementedEventLogServiceServer struct {
}

UnimplementedEventLogServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedEventLogServiceServer) EventFetched added in v0.3.5

func (UnimplementedEventLogServiceServer) FetchEvents

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