v1

package
v0.0.0-...-2ef827d Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: MIT Imports: 28 Imported by: 2

Documentation

Index

Constants

View Source
const (
	Eventer_Emit_FullMethodName = "/core.eventer.v1.Eventer/Emit"
)

Variables

View Source
var Eventer_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "core.eventer.v1.Eventer",
	HandlerType: (*EventerServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Emit",
			Handler:    _Eventer_Emit_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "core/eventer/v1/services.proto",
}

Eventer_ServiceDesc is the grpc.ServiceDesc for Eventer 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_core_eventer_v1_events_proto protoreflect.FileDescriptor
View Source
var File_core_eventer_v1_models_proto protoreflect.FileDescriptor
View Source
var File_core_eventer_v1_services_proto protoreflect.FileDescriptor

Functions

func DefaultDeleteEvent

func DefaultDeleteEvent(ctx context.Context, in *Event, db *gorm.DB) error

func DefaultDeleteEventSet

func DefaultDeleteEventSet(ctx context.Context, in []*Event, db *gorm.DB) error

func RegisterEventerServer

func RegisterEventerServer(s grpc.ServiceRegistrar, srv EventerServer)

Types

type EmitRequest

type EmitRequest struct {
	Event *pb.CloudEvent `protobuf:"bytes,1,opt,name=event,proto3" json:"event,omitempty"`
	// contains filtered or unexported fields
}

func (*EmitRequest) Descriptor deprecated

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

Deprecated: Use EmitRequest.ProtoReflect.Descriptor instead.

func (*EmitRequest) GetEvent

func (x *EmitRequest) GetEvent() *pb.CloudEvent

func (*EmitRequest) ProtoMessage

func (*EmitRequest) ProtoMessage()

func (*EmitRequest) ProtoReflect

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

func (*EmitRequest) Reset

func (x *EmitRequest) Reset()

func (*EmitRequest) String

func (x *EmitRequest) String() string

func (*EmitRequest) Validate

func (m *EmitRequest) Validate() error

Validate checks the field values on EmitRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*EmitRequest) ValidateAll

func (m *EmitRequest) ValidateAll() error

ValidateAll checks the field values on EmitRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in EmitRequestMultiError, or nil if none found.

type EmitRequestMultiError

type EmitRequestMultiError []error

EmitRequestMultiError is an error wrapping multiple validation errors returned by EmitRequest.ValidateAll() if the designated constraints aren't met.

func (EmitRequestMultiError) AllErrors

func (m EmitRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (EmitRequestMultiError) Error

func (m EmitRequestMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type EmitRequestValidationError

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

EmitRequestValidationError is the validation error returned by EmitRequest.Validate if the designated constraints aren't met.

func (EmitRequestValidationError) Cause

Cause function returns cause value.

func (EmitRequestValidationError) Error

Error satisfies the builtin error interface

func (EmitRequestValidationError) ErrorName

func (e EmitRequestValidationError) ErrorName() string

ErrorName returns error name.

func (EmitRequestValidationError) Field

Field function returns field value.

func (EmitRequestValidationError) Key

Key function returns key value.

func (EmitRequestValidationError) Reason

Reason function returns reason value.

type EmitResponse

type EmitResponse struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*EmitResponse) Descriptor deprecated

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

Deprecated: Use EmitResponse.ProtoReflect.Descriptor instead.

func (*EmitResponse) GetId

func (x *EmitResponse) GetId() string

func (*EmitResponse) ProtoMessage

func (*EmitResponse) ProtoMessage()

func (*EmitResponse) ProtoReflect

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

func (*EmitResponse) Reset

func (x *EmitResponse) Reset()

func (*EmitResponse) String

func (x *EmitResponse) String() string

func (*EmitResponse) Validate

func (m *EmitResponse) Validate() error

Validate checks the field values on EmitResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*EmitResponse) ValidateAll

func (m *EmitResponse) ValidateAll() error

ValidateAll checks the field values on EmitResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in EmitResponseMultiError, or nil if none found.

type EmitResponseMultiError

type EmitResponseMultiError []error

EmitResponseMultiError is an error wrapping multiple validation errors returned by EmitResponse.ValidateAll() if the designated constraints aren't met.

func (EmitResponseMultiError) AllErrors

func (m EmitResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (EmitResponseMultiError) Error

func (m EmitResponseMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type EmitResponseValidationError

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

EmitResponseValidationError is the validation error returned by EmitResponse.Validate if the designated constraints aren't met.

func (EmitResponseValidationError) Cause

Cause function returns cause value.

func (EmitResponseValidationError) Error

Error satisfies the builtin error interface

func (EmitResponseValidationError) ErrorName

func (e EmitResponseValidationError) ErrorName() string

ErrorName returns error name.

func (EmitResponseValidationError) Field

Field function returns field value.

func (EmitResponseValidationError) Key

Key function returns key value.

func (EmitResponseValidationError) Reason

Reason function returns reason value.

type Event

type Event struct {

	// id is the table primary key
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// received_time is the time the event emit request was received
	ReceivedTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=received_time,json=receivedTime,proto3" json:"received_time,omitempty"`
	// published_time the time the event was been published the messagebus
	PublishedTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=published_time,json=publishedTime,proto3" json:"published_time,omitempty"`
	// transaction_id is a uuid that tracks all events that are part of the same transaction
	TransactionId string `protobuf:"bytes,4,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"`
	// event_source is cloudevent source
	EventSource string `protobuf:"bytes,11,opt,name=event_source,json=eventSource,proto3" json:"event_source,omitempty"`
	// event_type is cloudevent type
	EventType string `protobuf:"bytes,12,opt,name=event_type,json=eventType,proto3" json:"event_type,omitempty"`
	// event_data of the cloudevent type
	// it is saved as a json string for querying and interoperability
	EventData string `protobuf:"bytes,21,opt,name=event_data,json=eventData,proto3" json:"event_data,omitempty"`
	// contains filtered or unexported fields
}

func DefaultApplyFieldMaskEvent

func DefaultApplyFieldMaskEvent(ctx context.Context, patchee *Event, patcher *Event, updateMask *field_mask.FieldMask, prefix string, db *gorm.DB) (*Event, error)

DefaultApplyFieldMaskEvent patches an pbObject with patcher according to a field mask.

func DefaultCreateEvent

func DefaultCreateEvent(ctx context.Context, in *Event, db *gorm.DB) (*Event, error)

DefaultCreateEvent executes a basic gorm create call

func DefaultListEvent

func DefaultListEvent(ctx context.Context, db *gorm.DB) ([]*Event, error)

DefaultListEvent executes a gorm list call

func DefaultPatchEvent

func DefaultPatchEvent(ctx context.Context, in *Event, updateMask *field_mask.FieldMask, db *gorm.DB) (*Event, error)

DefaultPatchEvent executes a basic gorm update call with patch behavior

func DefaultPatchSetEvent

func DefaultPatchSetEvent(ctx context.Context, objects []*Event, updateMasks []*field_mask.FieldMask, db *gorm.DB) ([]*Event, error)

DefaultPatchSetEvent executes a bulk gorm update call with patch behavior

func DefaultReadEvent

func DefaultReadEvent(ctx context.Context, in *Event, db *gorm.DB) (*Event, error)

func DefaultStrictUpdateEvent

func DefaultStrictUpdateEvent(ctx context.Context, in *Event, db *gorm.DB) (*Event, error)

DefaultStrictUpdateEvent clears / replaces / appends first level 1:many children and then executes a gorm update call

func (*Event) Descriptor deprecated

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

Deprecated: Use Event.ProtoReflect.Descriptor instead.

func (*Event) GetEventData

func (x *Event) GetEventData() string

func (*Event) GetEventSource

func (x *Event) GetEventSource() string

func (*Event) GetEventType

func (x *Event) GetEventType() string

func (*Event) GetId

func (x *Event) GetId() string

func (*Event) GetPublishedTime

func (x *Event) GetPublishedTime() *timestamppb.Timestamp

func (*Event) GetReceivedTime

func (x *Event) GetReceivedTime() *timestamppb.Timestamp

func (*Event) GetTransactionId

func (x *Event) GetTransactionId() string

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

func (*Event) ToORM

func (m *Event) ToORM(ctx context.Context) (EventORM, error)

ToORM runs the BeforeToORM hook if present, converts the fields of this object to ORM format, runs the AfterToORM hook, then returns the ORM object

func (*Event) Validate

func (m *Event) Validate() error

Validate checks the field values on Event with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Event) ValidateAll

func (m *Event) ValidateAll() error

ValidateAll checks the field values on Event with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in EventMultiError, or nil if none found.

type EventMultiError

type EventMultiError []error

EventMultiError is an error wrapping multiple validation errors returned by Event.ValidateAll() if the designated constraints aren't met.

func (EventMultiError) AllErrors

func (m EventMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (EventMultiError) Error

func (m EventMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type EventORM

type EventORM struct {
	EventData     string     `gorm:"type:json"`
	EventSource   string     `gorm:"type:varchar(255)"`
	EventType     string     `gorm:"type:varchar(255)"`
	Id            string     `gorm:"type:uuid;primary_key"`
	PublishedTime *time.Time `gorm:"type:timestamp"`
	ReceivedTime  *time.Time `gorm:"type:timestamp"`
	TransactionId string     `gorm:"type:uuid"`
}

func (EventORM) TableName

func (EventORM) TableName() string

TableName overrides the default tablename generated by GORM

func (*EventORM) ToPB

func (m *EventORM) ToPB(ctx context.Context) (Event, error)

ToPB runs the BeforeToPB hook if present, converts the fields of this object to PB format, runs the AfterToPB hook, then returns the PB object

type EventORMWithAfterCreate_

type EventORMWithAfterCreate_ interface {
	AfterCreate_(context.Context, *gorm.DB) error
}

type EventORMWithAfterDeleteSet

type EventORMWithAfterDeleteSet interface {
	AfterDeleteSet(context.Context, []*Event, *gorm.DB) error
}

type EventORMWithAfterDelete_

type EventORMWithAfterDelete_ interface {
	AfterDelete_(context.Context, *gorm.DB) error
}

type EventORMWithAfterListFind

type EventORMWithAfterListFind interface {
	AfterListFind(context.Context, *gorm.DB, *[]EventORM) error
}

type EventORMWithAfterReadFind

type EventORMWithAfterReadFind interface {
	AfterReadFind(context.Context, *gorm.DB) error
}

type EventORMWithAfterStrictUpdateSave

type EventORMWithAfterStrictUpdateSave interface {
	AfterStrictUpdateSave(context.Context, *gorm.DB) error
}

type EventORMWithBeforeCreate_

type EventORMWithBeforeCreate_ interface {
	BeforeCreate_(context.Context, *gorm.DB) (*gorm.DB, error)
}

type EventORMWithBeforeDeleteSet

type EventORMWithBeforeDeleteSet interface {
	BeforeDeleteSet(context.Context, []*Event, *gorm.DB) (*gorm.DB, error)
}

type EventORMWithBeforeDelete_

type EventORMWithBeforeDelete_ interface {
	BeforeDelete_(context.Context, *gorm.DB) (*gorm.DB, error)
}

type EventORMWithBeforeListApplyQuery

type EventORMWithBeforeListApplyQuery interface {
	BeforeListApplyQuery(context.Context, *gorm.DB) (*gorm.DB, error)
}

type EventORMWithBeforeListFind

type EventORMWithBeforeListFind interface {
	BeforeListFind(context.Context, *gorm.DB) (*gorm.DB, error)
}

type EventORMWithBeforeReadApplyQuery

type EventORMWithBeforeReadApplyQuery interface {
	BeforeReadApplyQuery(context.Context, *gorm.DB) (*gorm.DB, error)
}

type EventORMWithBeforeReadFind

type EventORMWithBeforeReadFind interface {
	BeforeReadFind(context.Context, *gorm.DB) (*gorm.DB, error)
}

type EventORMWithBeforeStrictUpdateCleanup

type EventORMWithBeforeStrictUpdateCleanup interface {
	BeforeStrictUpdateCleanup(context.Context, *gorm.DB) (*gorm.DB, error)
}

type EventORMWithBeforeStrictUpdateSave

type EventORMWithBeforeStrictUpdateSave interface {
	BeforeStrictUpdateSave(context.Context, *gorm.DB) (*gorm.DB, error)
}

type EventValidationError

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

EventValidationError is the validation error returned by Event.Validate if the designated constraints aren't met.

func (EventValidationError) Cause

func (e EventValidationError) Cause() error

Cause function returns cause value.

func (EventValidationError) Error

func (e EventValidationError) Error() string

Error satisfies the builtin error interface

func (EventValidationError) ErrorName

func (e EventValidationError) ErrorName() string

ErrorName returns error name.

func (EventValidationError) Field

func (e EventValidationError) Field() string

Field function returns field value.

func (EventValidationError) Key

func (e EventValidationError) Key() bool

Key function returns key value.

func (EventValidationError) Reason

func (e EventValidationError) Reason() string

Reason function returns reason value.

type EventWithAfterPatchSave

type EventWithAfterPatchSave interface {
	AfterPatchSave(context.Context, *Event, *field_mask.FieldMask, *gorm.DB) error
}

type EventWithAfterToORM

type EventWithAfterToORM interface {
	AfterToORM(context.Context, *EventORM) error
}

EventAfterToORM called after default ToORM code

type EventWithAfterToPB

type EventWithAfterToPB interface {
	AfterToPB(context.Context, *Event) error
}

EventAfterToPB called after default ToPB code

type EventWithBeforePatchApplyFieldMask

type EventWithBeforePatchApplyFieldMask interface {
	BeforePatchApplyFieldMask(context.Context, *Event, *field_mask.FieldMask, *gorm.DB) (*gorm.DB, error)
}

type EventWithBeforePatchRead

type EventWithBeforePatchRead interface {
	BeforePatchRead(context.Context, *Event, *field_mask.FieldMask, *gorm.DB) (*gorm.DB, error)
}

type EventWithBeforePatchSave

type EventWithBeforePatchSave interface {
	BeforePatchSave(context.Context, *Event, *field_mask.FieldMask, *gorm.DB) (*gorm.DB, error)
}

type EventWithBeforeToORM

type EventWithBeforeToORM interface {
	BeforeToORM(context.Context, *EventORM) error
}

EventBeforeToORM called before default ToORM code

type EventWithBeforeToPB

type EventWithBeforeToPB interface {
	BeforeToPB(context.Context, *Event) error
}

EventBeforeToPB called before default ToPB code

type EventerClient

type EventerClient interface {
	Emit(ctx context.Context, in *EmitRequest, opts ...grpc.CallOption) (*EmitResponse, error)
}

EventerClient is the client API for Eventer 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 NewEventerClient

func NewEventerClient(cc grpc.ClientConnInterface) EventerClient

type EventerServer

type EventerServer interface {
	Emit(context.Context, *EmitRequest) (*EmitResponse, error)
}

EventerServer is the server API for Eventer service. All implementations should embed UnimplementedEventerServer for forward compatibility

type SaveFailed

type SaveFailed struct {

	// event is the event that failed to save
	Event *pb.CloudEvent `protobuf:"bytes,1,opt,name=event,proto3" json:"event,omitempty"`
	// error is the error that occurred while trying to save the event
	Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
	// received_time is the time the original event was received by the eventer service
	ReceivedTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=received_time,json=receivedTime,proto3" json:"received_time,omitempty"`
	// published_time is the time the original event was published by the eventer service
	PublishedTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=published_time,json=publishedTime,proto3" json:"published_time,omitempty"`
	// contains filtered or unexported fields
}

func (*SaveFailed) Descriptor deprecated

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

Deprecated: Use SaveFailed.ProtoReflect.Descriptor instead.

func (*SaveFailed) GetError

func (x *SaveFailed) GetError() string

func (*SaveFailed) GetEvent

func (x *SaveFailed) GetEvent() *pb.CloudEvent

func (*SaveFailed) GetPublishedTime

func (x *SaveFailed) GetPublishedTime() *timestamppb.Timestamp

func (*SaveFailed) GetReceivedTime

func (x *SaveFailed) GetReceivedTime() *timestamppb.Timestamp

func (*SaveFailed) ProtoMessage

func (*SaveFailed) ProtoMessage()

func (*SaveFailed) ProtoReflect

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

func (*SaveFailed) Reset

func (x *SaveFailed) Reset()

func (*SaveFailed) String

func (x *SaveFailed) String() string

func (*SaveFailed) Validate

func (m *SaveFailed) Validate() error

Validate checks the field values on SaveFailed with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*SaveFailed) ValidateAll

func (m *SaveFailed) ValidateAll() error

ValidateAll checks the field values on SaveFailed with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in SaveFailedMultiError, or nil if none found.

type SaveFailedMultiError

type SaveFailedMultiError []error

SaveFailedMultiError is an error wrapping multiple validation errors returned by SaveFailed.ValidateAll() if the designated constraints aren't met.

func (SaveFailedMultiError) AllErrors

func (m SaveFailedMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (SaveFailedMultiError) Error

func (m SaveFailedMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type SaveFailedValidationError

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

SaveFailedValidationError is the validation error returned by SaveFailed.Validate if the designated constraints aren't met.

func (SaveFailedValidationError) Cause

func (e SaveFailedValidationError) Cause() error

Cause function returns cause value.

func (SaveFailedValidationError) Error

Error satisfies the builtin error interface

func (SaveFailedValidationError) ErrorName

func (e SaveFailedValidationError) ErrorName() string

ErrorName returns error name.

func (SaveFailedValidationError) Field

Field function returns field value.

func (SaveFailedValidationError) Key

Key function returns key value.

func (SaveFailedValidationError) Reason

func (e SaveFailedValidationError) Reason() string

Reason function returns reason value.

type UnimplementedEventerServer

type UnimplementedEventerServer struct {
}

UnimplementedEventerServer should be embedded to have forward compatible implementations.

func (UnimplementedEventerServer) Emit

type UnsafeEventerServer

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

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

Jump to

Keyboard shortcuts

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