mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 19:14:23 +00:00
26 lines
572 B
Go
26 lines
572 B
Go
|
package webkey
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
|
||
|
"github.com/zitadel/zitadel/internal/eventstore"
|
||
|
)
|
||
|
|
||
|
const (
|
||
|
AggregateType = "web_key"
|
||
|
AggregateVersion = "v1"
|
||
|
)
|
||
|
|
||
|
func NewAggregate(id, resourceOwner string) *eventstore.Aggregate {
|
||
|
return &eventstore.Aggregate{
|
||
|
Type: AggregateType,
|
||
|
Version: AggregateVersion,
|
||
|
ID: id,
|
||
|
ResourceOwner: resourceOwner,
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func AggregateFromWriteModel(ctx context.Context, wm *eventstore.WriteModel) *eventstore.Aggregate {
|
||
|
return eventstore.AggregateFromWriteModelCtx(ctx, wm, AggregateType, AggregateVersion)
|
||
|
}
|