(ctx context.Context, opts ...Option)
| 40 | } |
| 41 | |
| 42 | func (b *builder) New(ctx context.Context, opts ...Option) Event { |
| 43 | evt := &event{ |
| 44 | ctx: ctx, |
| 45 | innerEvent: &ttnpb.Event{ |
| 46 | UniqueId: NewCorrelationID(), |
| 47 | Name: b.definition.name, |
| 48 | Time: timestamppb.Now(), |
| 49 | Origin: hostname, |
| 50 | CorrelationIds: CorrelationIDsFromContext(ctx), |
| 51 | }, |
| 52 | } |
| 53 | for _, opt := range b.options { |
| 54 | opt.applyTo(evt) |
| 55 | } |
| 56 | for _, opt := range opts { |
| 57 | opt.applyTo(evt) |
| 58 | } |
| 59 | return evt |
| 60 | } |
| 61 | |
| 62 | func (b *builder) NewWithIdentifiersAndData(ctx context.Context, ids EntityIdentifiers, data any) Event { |
| 63 | e := local(b.New(ctx)) |
no test coverage detected