Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterEventServiceServer(s grpc.ServiceRegistrar, srv EventServiceServer)
- type Event
- func (*Event) Descriptor() ([]byte, []int)deprecated
- func (x *Event) GetId() string
- func (x *Event) GetLabels() []string
- func (x *Event) GetMetadata() map[string]string
- func (x *Event) GetResourceId() string
- func (x *Event) GetTimestamp() *timestamppb.Timestamp
- func (x *Event) GetType() EventType
- func (*Event) ProtoMessage()
- func (x *Event) ProtoReflect() protoreflect.Message
- func (x *Event) Reset()
- func (x *Event) String() string
- type EventServiceClient
- type EventServiceServer
- type EventService_ListenClient
- type EventService_ListenServer
- type EventType
- type ListenRequest
- func (*ListenRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ListenRequest) GetCidFilters() []string
- func (x *ListenRequest) GetEventTypes() []EventType
- func (x *ListenRequest) GetLabelFilters() []string
- func (*ListenRequest) ProtoMessage()
- func (x *ListenRequest) ProtoReflect() protoreflect.Message
- func (x *ListenRequest) Reset()
- func (x *ListenRequest) String() string
- type ListenResponse
- type UnimplementedEventServiceServer
- type UnsafeEventServiceServer
Constants ¶
const (
EventService_Listen_FullMethodName = "/agntcy.dir.events.v1.EventService/Listen"
)
Variables ¶
var ( EventType_name = map[int32]string{ 0: "EVENT_TYPE_UNSPECIFIED", 1: "EVENT_TYPE_RECORD_PUSHED", 2: "EVENT_TYPE_RECORD_PULLED", 3: "EVENT_TYPE_RECORD_DELETED", 4: "EVENT_TYPE_RECORD_PUBLISHED", 5: "EVENT_TYPE_RECORD_UNPUBLISHED", 6: "EVENT_TYPE_SYNC_CREATED", 7: "EVENT_TYPE_SYNC_COMPLETED", 8: "EVENT_TYPE_SYNC_FAILED", 9: "EVENT_TYPE_RECORD_SIGNED", 10: "EVENT_TYPE_RECORD_VERIFIED", 11: "EVENT_TYPE_PUBLIC_KEY_UPLOADED", } EventType_value = map[string]int32{ "EVENT_TYPE_UNSPECIFIED": 0, "EVENT_TYPE_RECORD_PUSHED": 1, "EVENT_TYPE_RECORD_PULLED": 2, "EVENT_TYPE_RECORD_DELETED": 3, "EVENT_TYPE_RECORD_PUBLISHED": 4, "EVENT_TYPE_RECORD_UNPUBLISHED": 5, "EVENT_TYPE_SYNC_CREATED": 6, "EVENT_TYPE_SYNC_COMPLETED": 7, "EVENT_TYPE_SYNC_FAILED": 8, "EVENT_TYPE_RECORD_SIGNED": 9, "EVENT_TYPE_RECORD_VERIFIED": 10, "EVENT_TYPE_PUBLIC_KEY_UPLOADED": 11, } )
Enum value maps for EventType.
var EventService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "agntcy.dir.events.v1.EventService", HandlerType: (*EventServiceServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "Listen", Handler: _EventService_Listen_Handler, ServerStreams: true, }, }, Metadata: "agntcy/dir/events/v1/event_service.proto", }
EventService_ServiceDesc is the grpc.ServiceDesc for EventService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_agntcy_dir_events_v1_event_service_proto protoreflect.FileDescriptor
Functions ¶
func RegisterEventServiceServer ¶
func RegisterEventServiceServer(s grpc.ServiceRegistrar, srv EventServiceServer)
Types ¶
type Event ¶
type Event struct {
// Unique event identifier (generated by the system).
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// Type of event that occurred.
Type EventType `protobuf:"varint,2,opt,name=type,proto3,enum=agntcy.dir.events.v1.EventType" json:"type,omitempty"`
// When the event occurred.
Timestamp *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
// Resource identifier (CID for records, sync_id for syncs, etc.).
ResourceId string `protobuf:"bytes,4,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"`
// Optional labels associated with the record (for record events).
Labels []string `protobuf:"bytes,5,rep,name=labels,proto3" json:"labels,omitempty"`
// Optional metadata for additional context.
// Used for flexible event-specific data that doesn't fit standard fields.
Metadata map[string]string `` /* 143-byte string literal not displayed */
// contains filtered or unexported fields
}
Event represents a system event that occurred.
func (*Event) Descriptor
deprecated
func (*Event) GetMetadata ¶
func (*Event) GetResourceId ¶
func (*Event) GetTimestamp ¶
func (x *Event) GetTimestamp() *timestamppb.Timestamp
func (*Event) ProtoMessage ¶
func (*Event) ProtoMessage()
func (*Event) ProtoReflect ¶
func (x *Event) ProtoReflect() protoreflect.Message
type EventServiceClient ¶
type EventServiceClient interface {
// Listen establishes a streaming connection to receive events.
// Events are only delivered while the stream is active.
// On disconnect, missed events are not recoverable.
Listen(ctx context.Context, in *ListenRequest, opts ...grpc.CallOption) (EventService_ListenClient, error)
}
EventServiceClient is the client API for EventService 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.
EventService provides real-time event streaming for all system operations. Events are delivered from subscription time forward with no history or replay. This service enables external applications to react to system changes in real-time.
func NewEventServiceClient ¶
func NewEventServiceClient(cc grpc.ClientConnInterface) EventServiceClient
type EventServiceServer ¶
type EventServiceServer interface {
// Listen establishes a streaming connection to receive events.
// Events are only delivered while the stream is active.
// On disconnect, missed events are not recoverable.
Listen(*ListenRequest, EventService_ListenServer) error
}
EventServiceServer is the server API for EventService service. All implementations should embed UnimplementedEventServiceServer for forward compatibility.
EventService provides real-time event streaming for all system operations. Events are delivered from subscription time forward with no history or replay. This service enables external applications to react to system changes in real-time.
type EventService_ListenClient ¶
type EventService_ListenClient interface {
Recv() (*ListenResponse, error)
grpc.ClientStream
}
type EventService_ListenServer ¶
type EventService_ListenServer interface {
Send(*ListenResponse) error
grpc.ServerStream
}
type EventType ¶
type EventType int32
EventType represents all valid event types in the system. Each value represents a specific operation that can occur.
Supported Events: - Store: RECORD_PUSHED, RECORD_PULLED, RECORD_DELETED - Routing: RECORD_PUBLISHED, RECORD_UNPUBLISHED - Sync: SYNC_CREATED, SYNC_COMPLETED, SYNC_FAILED - Sign: RECORD_SIGNED
const ( // Unknown/unspecified event type. EventType_EVENT_TYPE_UNSPECIFIED EventType = 0 // A record was pushed to local storage. EventType_EVENT_TYPE_RECORD_PUSHED EventType = 1 // A record was pulled from storage. EventType_EVENT_TYPE_RECORD_PULLED EventType = 2 // A record was deleted from storage. EventType_EVENT_TYPE_RECORD_DELETED EventType = 3 // A record was published/announced to the network. EventType_EVENT_TYPE_RECORD_PUBLISHED EventType = 4 // A record was unpublished from the network. EventType_EVENT_TYPE_RECORD_UNPUBLISHED EventType = 5 // A sync operation was created/initiated. EventType_EVENT_TYPE_SYNC_CREATED EventType = 6 // A sync operation completed successfully. EventType_EVENT_TYPE_SYNC_COMPLETED EventType = 7 // A sync operation failed. EventType_EVENT_TYPE_SYNC_FAILED EventType = 8 // A record was signed. EventType_EVENT_TYPE_RECORD_SIGNED EventType = 9 // A record signature was verified. EventType_EVENT_TYPE_RECORD_VERIFIED EventType = 10 // A public key was uploaded. EventType_EVENT_TYPE_PUBLIC_KEY_UPLOADED EventType = 11 )
func (EventType) Descriptor ¶
func (EventType) Descriptor() protoreflect.EnumDescriptor
func (EventType) EnumDescriptor
deprecated
func (EventType) Number ¶
func (x EventType) Number() protoreflect.EnumNumber
func (EventType) Type ¶
func (EventType) Type() protoreflect.EnumType
type ListenRequest ¶
type ListenRequest struct {
// Event types to subscribe to.
// If empty, subscribes to all event types.
EventTypes []EventType `` /* 135-byte string literal not displayed */
// Optional label filters (e.g., "/skills/AI", "/domains/research").
// Only events for records matching these labels are delivered.
// Uses substring matching.
LabelFilters []string `protobuf:"bytes,2,rep,name=label_filters,json=labelFilters,proto3" json:"label_filters,omitempty"`
// Optional CID filters.
// Only events for specific CIDs are delivered.
CidFilters []string `protobuf:"bytes,3,rep,name=cid_filters,json=cidFilters,proto3" json:"cid_filters,omitempty"`
// contains filtered or unexported fields
}
ListenRequest specifies filters for event subscription.
func (*ListenRequest) Descriptor
deprecated
func (*ListenRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListenRequest.ProtoReflect.Descriptor instead.
func (*ListenRequest) GetCidFilters ¶
func (x *ListenRequest) GetCidFilters() []string
func (*ListenRequest) GetEventTypes ¶
func (x *ListenRequest) GetEventTypes() []EventType
func (*ListenRequest) GetLabelFilters ¶
func (x *ListenRequest) GetLabelFilters() []string
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 ListenResponse ¶
type ListenResponse struct {
// The event that occurred.
Event *Event `protobuf:"bytes,1,opt,name=event,proto3" json:"event,omitempty"`
// contains filtered or unexported fields
}
ListenResponse is the response message for the Listen RPC. Wraps the Event message to allow for future extensions without breaking the Event structure.
func (*ListenResponse) Descriptor
deprecated
func (*ListenResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListenResponse.ProtoReflect.Descriptor instead.
func (*ListenResponse) GetEvent ¶
func (x *ListenResponse) GetEvent() *Event
func (*ListenResponse) ProtoMessage ¶
func (*ListenResponse) ProtoMessage()
func (*ListenResponse) ProtoReflect ¶
func (x *ListenResponse) ProtoReflect() protoreflect.Message
func (*ListenResponse) Reset ¶
func (x *ListenResponse) Reset()
func (*ListenResponse) String ¶
func (x *ListenResponse) String() string
type UnimplementedEventServiceServer ¶
type UnimplementedEventServiceServer struct{}
UnimplementedEventServiceServer should be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedEventServiceServer) Listen ¶
func (UnimplementedEventServiceServer) Listen(*ListenRequest, EventService_ListenServer) error
type UnsafeEventServiceServer ¶
type UnsafeEventServiceServer interface {
// contains filtered or unexported methods
}
UnsafeEventServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to EventServiceServer will result in compilation errors.