Documentation
¶
Index ¶
- Constants
- Variables
- func NewRepository(store protosource.Store, serializer protosource.Serializer, ...) *protosource.Repository
- type AddItem
- func (m *AddItem) CommandName() string
- func (*AddItem) Descriptor() ([]byte, []int)deprecated
- func (m *AddItem) EmitEvents(aggregate protosource.Aggregate) []protosource.Event
- func (x *AddItem) GetActor() string
- func (x *AddItem) GetId() string
- func (x *AddItem) GetItem() *LineItem
- func (m *AddItem) GuardState(aggregate protosource.Aggregate) error
- func (*AddItem) ProtoMessage()
- func (x *AddItem) ProtoReflect() protoreflect.Message
- func (m *AddItem) ProtoValidate() error
- func (x *AddItem) Reset()
- func (x *AddItem) String() string
- func (m *AddItem) ValidateVersion(version int64) error
- type AddTag
- func (m *AddTag) CommandName() string
- func (*AddTag) Descriptor() ([]byte, []int)deprecated
- func (m *AddTag) EmitEvents(aggregate protosource.Aggregate) []protosource.Event
- func (x *AddTag) GetActor() string
- func (x *AddTag) GetId() string
- func (x *AddTag) GetTag() *Tag
- func (m *AddTag) GuardState(aggregate protosource.Aggregate) error
- func (*AddTag) ProtoMessage()
- func (x *AddTag) ProtoReflect() protoreflect.Message
- func (m *AddTag) ProtoValidate() error
- func (x *AddTag) Reset()
- func (x *AddTag) String() string
- func (m *AddTag) ValidateVersion(version int64) error
- type Builder
- func (b *Builder) Cancelled(Actor string, Reason string)
- func (b *Builder) Created(Actor string, CustomerId string, CustomerName string)
- func (b *Builder) ItemAdded(Actor string, Item *LineItem)
- func (b *Builder) ItemRemoved(Actor string, ItemId string)
- func (b *Builder) Placed(Actor string, PlacedAt int64)
- func (b *Builder) ShippingSet(Actor string, ShippingAddress string)
- func (b *Builder) Snapshot(aggregate *Order)
- func (b *Builder) TagAdded(Actor string, Tag *Tag)
- func (b *Builder) TagRemoved(Actor string, Key string)
- type Cancel
- func (m *Cancel) CommandName() string
- func (*Cancel) Descriptor() ([]byte, []int)deprecated
- func (m *Cancel) EmitEvents(aggregate protosource.Aggregate) []protosource.Event
- func (x *Cancel) GetActor() string
- func (x *Cancel) GetId() string
- func (x *Cancel) GetReason() string
- func (m *Cancel) GuardState(aggregate protosource.Aggregate) error
- func (*Cancel) ProtoMessage()
- func (x *Cancel) ProtoReflect() protoreflect.Message
- func (m *Cancel) ProtoValidate() error
- func (x *Cancel) Reset()
- func (x *Cancel) String() string
- func (m *Cancel) ValidateVersion(version int64) error
- type Cancelled
- func (*Cancelled) Descriptor() ([]byte, []int)deprecated
- func (m *Cancelled) EventName() string
- func (x *Cancelled) GetActor() string
- func (x *Cancelled) GetAt() int64
- func (x *Cancelled) GetId() string
- func (x *Cancelled) GetReason() string
- func (x *Cancelled) GetVersion() int64
- func (*Cancelled) ProtoMessage()
- func (x *Cancelled) ProtoReflect() protoreflect.Message
- func (x *Cancelled) Reset()
- func (x *Cancelled) String() string
- type Create
- func (m *Create) CommandName() string
- func (*Create) Descriptor() ([]byte, []int)deprecated
- func (m *Create) EmitEvents(aggregate protosource.Aggregate) []protosource.Event
- func (x *Create) GetActor() string
- func (x *Create) GetCustomerId() string
- func (x *Create) GetCustomerName() string
- func (x *Create) GetId() string
- func (*Create) ProtoMessage()
- func (x *Create) ProtoReflect() protoreflect.Message
- func (m *Create) ProtoValidate() error
- func (x *Create) Reset()
- func (x *Create) String() string
- func (m *Create) ValidateVersion(version int64) error
- type Created
- func (*Created) Descriptor() ([]byte, []int)deprecated
- func (m *Created) EventName() string
- func (x *Created) GetActor() string
- func (x *Created) GetAt() int64
- func (x *Created) GetCustomerId() string
- func (x *Created) GetCustomerName() string
- func (x *Created) GetId() string
- func (x *Created) GetVersion() int64
- func (*Created) ProtoMessage()
- func (x *Created) ProtoReflect() protoreflect.Message
- func (x *Created) Reset()
- func (x *Created) String() string
- type HTTPClient
- func (c *HTTPClient) AddItem(ctx context.Context, id string, item *LineItem) (*responsev1.CommandResponse, error)
- func (c *HTTPClient) AddTag(ctx context.Context, id string, tag *Tag) (*responsev1.CommandResponse, error)
- func (c *HTTPClient) Cancel(ctx context.Context, id string, reason string) (*responsev1.CommandResponse, error)
- func (c *HTTPClient) Create(ctx context.Context, id string, customerId string, customerName string) (*responsev1.CommandResponse, error)
- func (c *HTTPClient) Get(ctx context.Context, id string) (*Order, error)
- func (c *HTTPClient) History(ctx context.Context, id string) (*historyv1.History, error)
- func (c *HTTPClient) Load(ctx context.Context, id string) (*Order, error)
- func (c *HTTPClient) Place(ctx context.Context, id string, placedAt int64) (*responsev1.CommandResponse, error)
- func (c *HTTPClient) QueryByCustomerId(ctx context.Context, customerId string) ([]*Order, error)
- func (c *HTTPClient) QueryByCustomerIdBetweenCreateAt(ctx context.Context, customerId string, createAtFrom int64, createAtTo int64) ([]*Order, error)
- func (c *HTTPClient) QueryByCustomerIdWithCreateAt(ctx context.Context, customerId string, skOp string, createAt int64) ([]*Order, error)
- func (c *HTTPClient) RemoveItem(ctx context.Context, id string, itemId string) (*responsev1.CommandResponse, error)
- func (c *HTTPClient) RemoveTag(ctx context.Context, id string, key string) (*responsev1.CommandResponse, error)
- func (c *HTTPClient) SetShipping(ctx context.Context, id string, shippingAddress string) (*responsev1.CommandResponse, error)
- type Handler
- func (h *Handler) HandleAddItem(ctx context.Context, request protosource.Request) protosource.Response
- func (h *Handler) HandleAddTag(ctx context.Context, request protosource.Request) protosource.Response
- func (h *Handler) HandleCancel(ctx context.Context, request protosource.Request) protosource.Response
- func (h *Handler) HandleCreate(ctx context.Context, request protosource.Request) protosource.Response
- func (h *Handler) HandleGet(ctx context.Context, request protosource.Request) protosource.Response
- func (h *Handler) HandleGetMaterialized(ctx context.Context, request protosource.Request) protosource.Response
- func (h *Handler) HandleHistory(ctx context.Context, request protosource.Request) protosource.Response
- func (h *Handler) HandlePlace(ctx context.Context, request protosource.Request) protosource.Response
- func (h *Handler) HandleQueryByCustomerId(ctx context.Context, request protosource.Request) protosource.Response
- func (h *Handler) HandleRemoveItem(ctx context.Context, request protosource.Request) protosource.Response
- func (h *Handler) HandleRemoveTag(ctx context.Context, request protosource.Request) protosource.Response
- func (h *Handler) HandleSetShipping(ctx context.Context, request protosource.Request) protosource.Response
- func (h *Handler) RegisterRoutes(router *protosource.Router)
- type ItemAdded
- func (*ItemAdded) Descriptor() ([]byte, []int)deprecated
- func (m *ItemAdded) EventName() string
- func (x *ItemAdded) GetActor() string
- func (x *ItemAdded) GetAt() int64
- func (x *ItemAdded) GetId() string
- func (x *ItemAdded) GetItem() *LineItem
- func (x *ItemAdded) GetVersion() int64
- func (*ItemAdded) ProtoMessage()
- func (x *ItemAdded) ProtoReflect() protoreflect.Message
- func (x *ItemAdded) Reset()
- func (x *ItemAdded) String() string
- type ItemRemoved
- func (*ItemRemoved) Descriptor() ([]byte, []int)deprecated
- func (m *ItemRemoved) EventName() string
- func (x *ItemRemoved) GetActor() string
- func (x *ItemRemoved) GetAt() int64
- func (x *ItemRemoved) GetId() string
- func (x *ItemRemoved) GetItemId() string
- func (x *ItemRemoved) GetVersion() int64
- func (*ItemRemoved) ProtoMessage()
- func (x *ItemRemoved) ProtoReflect() protoreflect.Message
- func (x *ItemRemoved) Reset()
- func (x *ItemRemoved) String() string
- type LineItem
- func (*LineItem) Descriptor() ([]byte, []int)deprecated
- func (x *LineItem) GetDescription() string
- func (x *LineItem) GetItemId() string
- func (x *LineItem) GetPriceCents() int64
- func (x *LineItem) GetQuantity() int32
- func (*LineItem) ProtoMessage()
- func (x *LineItem) ProtoReflect() protoreflect.Message
- func (x *LineItem) Reset()
- func (x *LineItem) String() string
- type Order
- func (o *Order) AfterOn()
- func (*Order) Descriptor() ([]byte, []int)deprecated
- func (m *Order) GSI1PK() string
- func (m *Order) GSI1SK() string
- func (m *Order) GSI2PK() string
- func (m *Order) GSI2SK() string
- func (m *Order) GSI3PK() string
- func (m *Order) GSI3SK() string
- func (m *Order) GSI4PK() string
- func (m *Order) GSI4SK() string
- func (m *Order) GSI5PK() string
- func (m *Order) GSI5SK() string
- func (m *Order) GSI6PK() string
- func (m *Order) GSI6SK() string
- func (m *Order) GSI7PK() string
- func (m *Order) GSI7SK() string
- func (m *Order) GSI8PK() string
- func (m *Order) GSI8SK() string
- func (m *Order) GSI9PK() string
- func (m *Order) GSI9SK() string
- func (m *Order) GSI10PK() string
- func (m *Order) GSI10SK() string
- func (m *Order) GSI11PK() string
- func (m *Order) GSI11SK() string
- func (m *Order) GSI12PK() string
- func (m *Order) GSI12SK() string
- func (m *Order) GSI13PK() string
- func (m *Order) GSI13SK() string
- func (m *Order) GSI14PK() string
- func (m *Order) GSI14SK() string
- func (m *Order) GSI15PK() string
- func (m *Order) GSI15SK() string
- func (m *Order) GSI16PK() string
- func (m *Order) GSI16SK() string
- func (m *Order) GSI17PK() string
- func (m *Order) GSI17SK() string
- func (m *Order) GSI18PK() string
- func (m *Order) GSI18SK() string
- func (m *Order) GSI19PK() string
- func (m *Order) GSI19SK() string
- func (m *Order) GSI20PK() string
- func (m *Order) GSI20SK() string
- func (x *Order) GetCreateAt() int64
- func (x *Order) GetCreateBy() string
- func (x *Order) GetCustomerId() string
- func (x *Order) GetCustomerName() string
- func (x *Order) GetId() string
- func (x *Order) GetItemCount() int32
- func (x *Order) GetItems() map[string]*LineItem
- func (x *Order) GetModifyAt() int64
- func (x *Order) GetModifyBy() string
- func (x *Order) GetPlacedAt() int64
- func (x *Order) GetShippingAddress() string
- func (x *Order) GetState() State
- func (x *Order) GetTags() map[string]*Tag
- func (x *Order) GetTotalCents() int64
- func (x *Order) GetVersion() int64
- func (m *Order) Hydrate(body []byte) error
- func (aggregate *Order) On(event protosource.Event) error
- func (m *Order) PK() string
- func (m *Order) ProjectOrderSummary() *OrderSummary
- func (m *Order) Projections() []proto.Message
- func (*Order) ProtoMessage()
- func (x *Order) ProtoReflect() protoreflect.Message
- func (x *Order) Reset()
- func (aggregate *Order) RestoreSnapshot(snapshot *Snapshot)
- func (m *Order) SK() string
- func (aggregate *Order) Snapshot(version int64) protosource.Event
- func (aggregate *Order) SnapshotInterval() int32
- func (x *Order) String() string
- type OrderClient
- func (c *OrderClient) AddOrder(ctx context.Context, d *Order, opts ...opaquedata.Option) error
- func (c *OrderClient) DeleteOrder(ctx context.Context, id string) error
- func (c *OrderClient) GetOrder(ctx context.Context, id string) (*Order, error)
- func (c *OrderClient) SelectOrderByCustomerId(ctx context.Context, customer_id string) ([]*Order, error)
- func (c *OrderClient) SelectOrderByCustomerIdWithCreateAt(ctx context.Context, customer_id string, op opaquedata.SortOperator, ...) ([]*Order, error)
- func (c *OrderClient) UpdateOrder(ctx context.Context, d *Order, opts ...opaquedata.Option) error
- type OrderGSI1SK
- type OrderList
- type OrderSummary
- func (*OrderSummary) Descriptor() ([]byte, []int)deprecated
- func (m *OrderSummary) GSI1PK() string
- func (m *OrderSummary) GSI1SK() string
- func (m *OrderSummary) GSI2PK() string
- func (m *OrderSummary) GSI2SK() string
- func (m *OrderSummary) GSI3PK() string
- func (m *OrderSummary) GSI3SK() string
- func (m *OrderSummary) GSI4PK() string
- func (m *OrderSummary) GSI4SK() string
- func (m *OrderSummary) GSI5PK() string
- func (m *OrderSummary) GSI5SK() string
- func (m *OrderSummary) GSI6PK() string
- func (m *OrderSummary) GSI6SK() string
- func (m *OrderSummary) GSI7PK() string
- func (m *OrderSummary) GSI7SK() string
- func (m *OrderSummary) GSI8PK() string
- func (m *OrderSummary) GSI8SK() string
- func (m *OrderSummary) GSI9PK() string
- func (m *OrderSummary) GSI9SK() string
- func (m *OrderSummary) GSI10PK() string
- func (m *OrderSummary) GSI10SK() string
- func (m *OrderSummary) GSI11PK() string
- func (m *OrderSummary) GSI11SK() string
- func (m *OrderSummary) GSI12PK() string
- func (m *OrderSummary) GSI12SK() string
- func (m *OrderSummary) GSI13PK() string
- func (m *OrderSummary) GSI13SK() string
- func (m *OrderSummary) GSI14PK() string
- func (m *OrderSummary) GSI14SK() string
- func (m *OrderSummary) GSI15PK() string
- func (m *OrderSummary) GSI15SK() string
- func (m *OrderSummary) GSI16PK() string
- func (m *OrderSummary) GSI16SK() string
- func (m *OrderSummary) GSI17PK() string
- func (m *OrderSummary) GSI17SK() string
- func (m *OrderSummary) GSI18PK() string
- func (m *OrderSummary) GSI18SK() string
- func (m *OrderSummary) GSI19PK() string
- func (m *OrderSummary) GSI19SK() string
- func (m *OrderSummary) GSI20PK() string
- func (m *OrderSummary) GSI20SK() string
- func (x *OrderSummary) GetCreateAt() int64
- func (x *OrderSummary) GetCustomerId() string
- func (x *OrderSummary) GetCustomerName() string
- func (x *OrderSummary) GetId() string
- func (x *OrderSummary) GetItemCount() int32
- func (x *OrderSummary) GetPlacedAt() int64
- func (x *OrderSummary) GetState() State
- func (x *OrderSummary) GetTotalCents() int64
- func (m *OrderSummary) Hydrate(body []byte) error
- func (m *OrderSummary) PK() string
- func (*OrderSummary) ProtoMessage()
- func (x *OrderSummary) ProtoReflect() protoreflect.Message
- func (x *OrderSummary) Reset()
- func (m *OrderSummary) SK() string
- func (x *OrderSummary) String() string
- type OrderSummaryClient
- func (c *OrderSummaryClient) AddOrderSummary(ctx context.Context, d *OrderSummary, opts ...opaquedata.Option) error
- func (c *OrderSummaryClient) DeleteOrderSummary(ctx context.Context, id string) error
- func (c *OrderSummaryClient) GetOrderSummary(ctx context.Context, id string) (*OrderSummary, error)
- func (c *OrderSummaryClient) SelectOrderSummaryByCustomerId(ctx context.Context, customer_id string) ([]*OrderSummary, error)
- func (c *OrderSummaryClient) SelectOrderSummaryByCustomerIdWithCreateAt(ctx context.Context, customer_id string, op opaquedata.SortOperator, ...) ([]*OrderSummary, error)
- func (c *OrderSummaryClient) SelectOrderSummaryByState(ctx context.Context, state State) ([]*OrderSummary, error)
- func (c *OrderSummaryClient) SelectOrderSummaryByStateWithPlacedAt(ctx context.Context, state State, op opaquedata.SortOperator, ...) ([]*OrderSummary, error)
- func (c *OrderSummaryClient) UpdateOrderSummary(ctx context.Context, d *OrderSummary, opts ...opaquedata.Option) error
- type OrderSummaryGSI1SK
- type OrderSummaryGSI2SK
- type Place
- func (m *Place) CommandName() string
- func (*Place) Descriptor() ([]byte, []int)deprecated
- func (m *Place) EmitEvents(aggregate protosource.Aggregate) []protosource.Event
- func (x *Place) GetActor() string
- func (x *Place) GetId() string
- func (x *Place) GetPlacedAt() int64
- func (m *Place) GuardState(aggregate protosource.Aggregate) error
- func (*Place) ProtoMessage()
- func (x *Place) ProtoReflect() protoreflect.Message
- func (m *Place) ProtoValidate() error
- func (x *Place) Reset()
- func (x *Place) String() string
- func (m *Place) ValidateVersion(version int64) error
- type Placed
- func (*Placed) Descriptor() ([]byte, []int)deprecated
- func (m *Placed) EventName() string
- func (x *Placed) GetActor() string
- func (x *Placed) GetAt() int64
- func (x *Placed) GetId() string
- func (x *Placed) GetPlacedAt() int64
- func (x *Placed) GetVersion() int64
- func (*Placed) ProtoMessage()
- func (x *Placed) ProtoReflect() protoreflect.Message
- func (x *Placed) Reset()
- func (x *Placed) String() string
- type RemoveItem
- func (m *RemoveItem) CommandName() string
- func (*RemoveItem) Descriptor() ([]byte, []int)deprecated
- func (m *RemoveItem) EmitEvents(aggregate protosource.Aggregate) []protosource.Event
- func (x *RemoveItem) GetActor() string
- func (x *RemoveItem) GetId() string
- func (x *RemoveItem) GetItemId() string
- func (m *RemoveItem) GuardState(aggregate protosource.Aggregate) error
- func (*RemoveItem) ProtoMessage()
- func (x *RemoveItem) ProtoReflect() protoreflect.Message
- func (m *RemoveItem) ProtoValidate() error
- func (x *RemoveItem) Reset()
- func (x *RemoveItem) String() string
- func (m *RemoveItem) ValidateVersion(version int64) error
- type RemoveTag
- func (m *RemoveTag) CommandName() string
- func (*RemoveTag) Descriptor() ([]byte, []int)deprecated
- func (m *RemoveTag) EmitEvents(aggregate protosource.Aggregate) []protosource.Event
- func (x *RemoveTag) GetActor() string
- func (x *RemoveTag) GetId() string
- func (x *RemoveTag) GetKey() string
- func (m *RemoveTag) GuardState(aggregate protosource.Aggregate) error
- func (*RemoveTag) ProtoMessage()
- func (x *RemoveTag) ProtoReflect() protoreflect.Message
- func (m *RemoveTag) ProtoValidate() error
- func (x *RemoveTag) Reset()
- func (x *RemoveTag) String() string
- func (m *RemoveTag) ValidateVersion(version int64) error
- type Repo
- type Repository
- type SetShipping
- func (m *SetShipping) CommandName() string
- func (*SetShipping) Descriptor() ([]byte, []int)deprecated
- func (m *SetShipping) EmitEvents(aggregate protosource.Aggregate) []protosource.Event
- func (x *SetShipping) GetActor() string
- func (x *SetShipping) GetId() string
- func (x *SetShipping) GetShippingAddress() string
- func (m *SetShipping) GuardState(aggregate protosource.Aggregate) error
- func (*SetShipping) ProtoMessage()
- func (x *SetShipping) ProtoReflect() protoreflect.Message
- func (m *SetShipping) ProtoValidate() error
- func (x *SetShipping) Reset()
- func (x *SetShipping) String() string
- func (m *SetShipping) ValidateVersion(version int64) error
- type ShippingSet
- func (*ShippingSet) Descriptor() ([]byte, []int)deprecated
- func (m *ShippingSet) EventName() string
- func (x *ShippingSet) GetActor() string
- func (x *ShippingSet) GetAt() int64
- func (x *ShippingSet) GetId() string
- func (x *ShippingSet) GetShippingAddress() string
- func (x *ShippingSet) GetVersion() int64
- func (*ShippingSet) ProtoMessage()
- func (x *ShippingSet) ProtoReflect() protoreflect.Message
- func (x *ShippingSet) Reset()
- func (x *ShippingSet) String() string
- type Snapshot
- func (*Snapshot) Descriptor() ([]byte, []int)deprecated
- func (m *Snapshot) EventName() string
- func (x *Snapshot) GetActor() string
- func (x *Snapshot) GetAt() int64
- func (x *Snapshot) GetId() string
- func (x *Snapshot) GetSnapshot() *Order
- func (x *Snapshot) GetVersion() int64
- func (*Snapshot) ProtoMessage()
- func (x *Snapshot) ProtoReflect() protoreflect.Message
- func (x *Snapshot) Reset()
- func (x *Snapshot) String() string
- type State
- type Tag
- type TagAdded
- func (*TagAdded) Descriptor() ([]byte, []int)deprecated
- func (m *TagAdded) EventName() string
- func (x *TagAdded) GetActor() string
- func (x *TagAdded) GetAt() int64
- func (x *TagAdded) GetId() string
- func (x *TagAdded) GetTag() *Tag
- func (x *TagAdded) GetVersion() int64
- func (*TagAdded) ProtoMessage()
- func (x *TagAdded) ProtoReflect() protoreflect.Message
- func (x *TagAdded) Reset()
- func (x *TagAdded) String() string
- type TagRemoved
- func (*TagRemoved) Descriptor() ([]byte, []int)deprecated
- func (m *TagRemoved) EventName() string
- func (x *TagRemoved) GetActor() string
- func (x *TagRemoved) GetAt() int64
- func (x *TagRemoved) GetId() string
- func (x *TagRemoved) GetKey() string
- func (x *TagRemoved) GetVersion() int64
- func (*TagRemoved) ProtoMessage()
- func (x *TagRemoved) ProtoReflect() protoreflect.Message
- func (x *TagRemoved) Reset()
- func (x *TagRemoved) String() string
Constants ¶
const SnapshotEveryNEvents int32 = 50
SnapshotEveryNEvents is the snapshot interval from the proto annotation.
Variables ¶
var ( State_name = map[int32]string{ 0: "STATE_UNSPECIFIED", 1: "STATE_DRAFT", 2: "STATE_PLACED", 3: "STATE_PAID", 4: "STATE_SHIPPED", 5: "STATE_DELIVERED", 6: "STATE_CANCELLED", } State_value = map[string]int32{ "STATE_UNSPECIFIED": 0, "STATE_DRAFT": 1, "STATE_PLACED": 2, "STATE_PAID": 3, "STATE_SHIPPED": 4, "STATE_DELIVERED": 5, "STATE_CANCELLED": 6, } )
Enum value maps for State.
var File_example_app_order_v1_order_v1_proto protoreflect.FileDescriptor
var ProviderSet = wire.NewSet( ProvideRepository, wire.Bind(new(Repo), new(*Repository)), )
ProviderSet provides the Order repository and binds it to Repo.
Functions ¶
func NewRepository ¶
func NewRepository(store protosource.Store, serializer protosource.Serializer, opts ...protosource.Option) *protosource.Repository
NewRepository creates a new protosource.Repository for the Order aggregate.
Types ¶
type AddItem ¶
type AddItem struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Actor string `protobuf:"bytes,2,opt,name=actor,proto3" json:"actor,omitempty"`
Item *LineItem `protobuf:"bytes,3,opt,name=item,proto3" json:"item,omitempty"`
// contains filtered or unexported fields
}
func (*AddItem) CommandName ¶
func (*AddItem) Descriptor
deprecated
func (*AddItem) EmitEvents ¶
func (m *AddItem) EmitEvents(aggregate protosource.Aggregate) []protosource.Event
func (*AddItem) GuardState ¶ added in v0.1.1
func (m *AddItem) GuardState(aggregate protosource.Aggregate) error
func (*AddItem) ProtoMessage ¶
func (*AddItem) ProtoMessage()
func (*AddItem) ProtoReflect ¶
func (x *AddItem) ProtoReflect() protoreflect.Message
func (*AddItem) ProtoValidate ¶
func (*AddItem) ValidateVersion ¶
type AddTag ¶
type AddTag struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Actor string `protobuf:"bytes,2,opt,name=actor,proto3" json:"actor,omitempty"`
Tag *Tag `protobuf:"bytes,3,opt,name=tag,proto3" json:"tag,omitempty"`
// contains filtered or unexported fields
}
func (*AddTag) CommandName ¶
func (*AddTag) Descriptor
deprecated
func (*AddTag) EmitEvents ¶
func (m *AddTag) EmitEvents(aggregate protosource.Aggregate) []protosource.Event
func (*AddTag) GuardState ¶ added in v0.1.1
func (m *AddTag) GuardState(aggregate protosource.Aggregate) error
func (*AddTag) ProtoMessage ¶
func (*AddTag) ProtoMessage()
func (*AddTag) ProtoReflect ¶
func (x *AddTag) ProtoReflect() protoreflect.Message
func (*AddTag) ProtoValidate ¶
func (*AddTag) ValidateVersion ¶
type Builder ¶
type Builder struct {
Events []protosource.Event
// contains filtered or unexported fields
}
func NewBuilder ¶
func (*Builder) ItemRemoved ¶
func (*Builder) ShippingSet ¶
func (*Builder) TagRemoved ¶
type Cancel ¶
type Cancel struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Actor string `protobuf:"bytes,2,opt,name=actor,proto3" json:"actor,omitempty"`
Reason string `protobuf:"bytes,3,opt,name=reason,proto3" json:"reason,omitempty"`
// contains filtered or unexported fields
}
func (*Cancel) CommandName ¶
func (*Cancel) Descriptor
deprecated
func (*Cancel) EmitEvents ¶
func (m *Cancel) EmitEvents(aggregate protosource.Aggregate) []protosource.Event
func (*Cancel) GuardState ¶ added in v0.1.1
func (m *Cancel) GuardState(aggregate protosource.Aggregate) error
func (*Cancel) ProtoMessage ¶
func (*Cancel) ProtoMessage()
func (*Cancel) ProtoReflect ¶
func (x *Cancel) ProtoReflect() protoreflect.Message
func (*Cancel) ProtoValidate ¶
func (*Cancel) ValidateVersion ¶
type Cancelled ¶
type Cancelled struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Version int64 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
At int64 `protobuf:"varint,3,opt,name=at,proto3" json:"at,omitempty"`
Actor string `protobuf:"bytes,4,opt,name=actor,proto3" json:"actor,omitempty"`
Reason string `protobuf:"bytes,5,opt,name=reason,proto3" json:"reason,omitempty"`
// contains filtered or unexported fields
}
func (*Cancelled) Descriptor
deprecated
func (*Cancelled) GetVersion ¶
func (*Cancelled) ProtoMessage ¶
func (*Cancelled) ProtoMessage()
func (*Cancelled) ProtoReflect ¶
func (x *Cancelled) ProtoReflect() protoreflect.Message
type Create ¶
type Create struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Actor string `protobuf:"bytes,2,opt,name=actor,proto3" json:"actor,omitempty"`
CustomerId string `protobuf:"bytes,3,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"`
CustomerName string `protobuf:"bytes,4,opt,name=customer_name,json=customerName,proto3" json:"customer_name,omitempty"`
// contains filtered or unexported fields
}
func (*Create) CommandName ¶
func (*Create) Descriptor
deprecated
func (*Create) EmitEvents ¶
func (m *Create) EmitEvents(aggregate protosource.Aggregate) []protosource.Event
func (*Create) GetCustomerId ¶
func (*Create) GetCustomerName ¶
func (*Create) ProtoMessage ¶
func (*Create) ProtoMessage()
func (*Create) ProtoReflect ¶
func (x *Create) ProtoReflect() protoreflect.Message
func (*Create) ProtoValidate ¶
func (*Create) ValidateVersion ¶
type Created ¶
type Created struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Version int64 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
At int64 `protobuf:"varint,3,opt,name=at,proto3" json:"at,omitempty"`
Actor string `protobuf:"bytes,4,opt,name=actor,proto3" json:"actor,omitempty"`
CustomerId string `protobuf:"bytes,5,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"`
CustomerName string `protobuf:"bytes,6,opt,name=customer_name,json=customerName,proto3" json:"customer_name,omitempty"`
// contains filtered or unexported fields
}
func (*Created) Descriptor
deprecated
func (*Created) GetCustomerId ¶
func (*Created) GetCustomerName ¶
func (*Created) GetVersion ¶
func (*Created) ProtoMessage ¶
func (*Created) ProtoMessage()
func (*Created) ProtoReflect ¶
func (x *Created) ProtoReflect() protoreflect.Message
type HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
HTTPClient is a typed HTTP client for the Order aggregate.
func NewHTTPClient ¶
func NewHTTPClient(c httpclient.Doer) *HTTPClient
NewHTTPClient creates a new Order HTTP client. Accepts httpclient.Doer for testability — use *httpclient.Client in production and a mock in tests.
func (*HTTPClient) AddItem ¶
func (c *HTTPClient) AddItem(ctx context.Context, id string, item *LineItem) (*responsev1.CommandResponse, error)
AddItem sends the AddItem command.
func (*HTTPClient) AddTag ¶
func (c *HTTPClient) AddTag(ctx context.Context, id string, tag *Tag) (*responsev1.CommandResponse, error)
AddTag sends the AddTag command.
func (*HTTPClient) Cancel ¶
func (c *HTTPClient) Cancel(ctx context.Context, id string, reason string) (*responsev1.CommandResponse, error)
Cancel sends the Cancel command.
func (*HTTPClient) Create ¶
func (c *HTTPClient) Create(ctx context.Context, id string, customerId string, customerName string) (*responsev1.CommandResponse, error)
Create sends the Create command.
func (*HTTPClient) Place ¶
func (c *HTTPClient) Place(ctx context.Context, id string, placedAt int64) (*responsev1.CommandResponse, error)
Place sends the Place command.
func (*HTTPClient) QueryByCustomerId ¶
QueryByCustomerId queries by customer_id via GSI1.
func (*HTTPClient) QueryByCustomerIdBetweenCreateAt ¶
func (c *HTTPClient) QueryByCustomerIdBetweenCreateAt(ctx context.Context, customerId string, createAtFrom int64, createAtTo int64) ([]*Order, error)
QueryByCustomerIdBetweenCreateAt queries with a between sort key condition (inclusive range).
func (*HTTPClient) QueryByCustomerIdWithCreateAt ¶
func (c *HTTPClient) QueryByCustomerIdWithCreateAt(ctx context.Context, customerId string, skOp string, createAt int64) ([]*Order, error)
QueryByCustomerIdWithCreateAt queries with a sort key condition (eq, lt, le, gt, ge, begins_with). For between queries, use QueryByCustomerIdBetweenCreateAt instead.
func (*HTTPClient) RemoveItem ¶
func (c *HTTPClient) RemoveItem(ctx context.Context, id string, itemId string) (*responsev1.CommandResponse, error)
RemoveItem sends the RemoveItem command.
func (*HTTPClient) RemoveTag ¶
func (c *HTTPClient) RemoveTag(ctx context.Context, id string, key string) (*responsev1.CommandResponse, error)
RemoveTag sends the RemoveTag command.
func (*HTTPClient) SetShipping ¶
func (c *HTTPClient) SetShipping(ctx context.Context, id string, shippingAddress string) (*responsev1.CommandResponse, error)
SetShipping sends the SetShipping command.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler provides request handler functions for the Order aggregate.
func NewHandler ¶
func NewHandler(repo Repo, client *OrderClient, authorizer authz.Authorizer) *Handler
NewHandler creates a new Handler instance with the given repository, client, and authorizer. Every generated command handler calls authorizer.Authorize with the canonical function name "example.app.order.v1.{CommandMessageName}" before running the command pipeline. Applications that do not enforce authorization at this layer should wire in allowall.Authorizer.
authorizer is required; passing nil panics immediately with a descriptive message rather than deferring to an opaque nil-pointer dereference on the first request.
func (*Handler) HandleAddItem ¶
func (h *Handler) HandleAddItem(ctx context.Context, request protosource.Request) protosource.Response
HandleAddItem processes a AddItem command.
func (*Handler) HandleAddTag ¶
func (h *Handler) HandleAddTag(ctx context.Context, request protosource.Request) protosource.Response
HandleAddTag processes a AddTag command.
func (*Handler) HandleCancel ¶
func (h *Handler) HandleCancel(ctx context.Context, request protosource.Request) protosource.Response
HandleCancel processes a Cancel command.
func (*Handler) HandleCreate ¶
func (h *Handler) HandleCreate(ctx context.Context, request protosource.Request) protosource.Response
HandleCreate processes a Create command.
func (*Handler) HandleGet ¶
func (h *Handler) HandleGet(ctx context.Context, request protosource.Request) protosource.Response
HandleGet retrieves the current state of a Order aggregate.
func (*Handler) HandleGetMaterialized ¶
func (h *Handler) HandleGetMaterialized(ctx context.Context, request protosource.Request) protosource.Response
HandleGetMaterialized retrieves the Order aggregate from the materialized store.
func (*Handler) HandleHistory ¶
func (h *Handler) HandleHistory(ctx context.Context, request protosource.Request) protosource.Response
HandleHistory retrieves the full event history for a Order aggregate.
func (*Handler) HandlePlace ¶
func (h *Handler) HandlePlace(ctx context.Context, request protosource.Request) protosource.Response
HandlePlace processes a Place command.
func (*Handler) HandleQueryByCustomerId ¶
func (h *Handler) HandleQueryByCustomerId(ctx context.Context, request protosource.Request) protosource.Response
HandleQueryByCustomerId queries GSI1 by partition key with optional sort key condition.
func (*Handler) HandleRemoveItem ¶
func (h *Handler) HandleRemoveItem(ctx context.Context, request protosource.Request) protosource.Response
HandleRemoveItem processes a RemoveItem command.
func (*Handler) HandleRemoveTag ¶
func (h *Handler) HandleRemoveTag(ctx context.Context, request protosource.Request) protosource.Response
HandleRemoveTag processes a RemoveTag command.
func (*Handler) HandleSetShipping ¶
func (h *Handler) HandleSetShipping(ctx context.Context, request protosource.Request) protosource.Response
HandleSetShipping processes a SetShipping command.
func (*Handler) RegisterRoutes ¶
func (h *Handler) RegisterRoutes(router *protosource.Router)
RegisterRoutes registers all handler routes on the given router.
type ItemAdded ¶
type ItemAdded struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Version int64 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
At int64 `protobuf:"varint,3,opt,name=at,proto3" json:"at,omitempty"`
Actor string `protobuf:"bytes,4,opt,name=actor,proto3" json:"actor,omitempty"`
Item *LineItem `protobuf:"bytes,5,opt,name=item,proto3" json:"item,omitempty"`
// contains filtered or unexported fields
}
func (*ItemAdded) Descriptor
deprecated
func (*ItemAdded) GetVersion ¶
func (*ItemAdded) ProtoMessage ¶
func (*ItemAdded) ProtoMessage()
func (*ItemAdded) ProtoReflect ¶
func (x *ItemAdded) ProtoReflect() protoreflect.Message
type ItemRemoved ¶
type ItemRemoved struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Version int64 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
At int64 `protobuf:"varint,3,opt,name=at,proto3" json:"at,omitempty"`
Actor string `protobuf:"bytes,4,opt,name=actor,proto3" json:"actor,omitempty"`
ItemId string `protobuf:"bytes,5,opt,name=item_id,json=itemId,proto3" json:"item_id,omitempty"`
// contains filtered or unexported fields
}
func (*ItemRemoved) Descriptor
deprecated
func (*ItemRemoved) Descriptor() ([]byte, []int)
Deprecated: Use ItemRemoved.ProtoReflect.Descriptor instead.
func (*ItemRemoved) EventName ¶
func (m *ItemRemoved) EventName() string
func (*ItemRemoved) GetActor ¶
func (x *ItemRemoved) GetActor() string
func (*ItemRemoved) GetAt ¶
func (x *ItemRemoved) GetAt() int64
func (*ItemRemoved) GetId ¶
func (x *ItemRemoved) GetId() string
func (*ItemRemoved) GetItemId ¶
func (x *ItemRemoved) GetItemId() string
func (*ItemRemoved) GetVersion ¶
func (x *ItemRemoved) GetVersion() int64
func (*ItemRemoved) ProtoMessage ¶
func (*ItemRemoved) ProtoMessage()
func (*ItemRemoved) ProtoReflect ¶
func (x *ItemRemoved) ProtoReflect() protoreflect.Message
func (*ItemRemoved) Reset ¶
func (x *ItemRemoved) Reset()
func (*ItemRemoved) String ¶
func (x *ItemRemoved) String() string
type LineItem ¶
type LineItem struct {
ItemId string `protobuf:"bytes,1,opt,name=item_id,json=itemId,proto3" json:"item_id,omitempty"`
Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
PriceCents int64 `protobuf:"varint,3,opt,name=price_cents,json=priceCents,proto3" json:"price_cents,omitempty"`
Quantity int32 `protobuf:"varint,4,opt,name=quantity,proto3" json:"quantity,omitempty"`
// contains filtered or unexported fields
}
LineItem is a value type representing a single item in an order.
func (*LineItem) Descriptor
deprecated
func (*LineItem) GetDescription ¶
func (*LineItem) GetPriceCents ¶
func (*LineItem) GetQuantity ¶
func (*LineItem) ProtoMessage ¶
func (*LineItem) ProtoMessage()
func (*LineItem) ProtoReflect ¶
func (x *LineItem) ProtoReflect() protoreflect.Message
type Order ¶
type Order struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Version int64 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
State State `protobuf:"varint,3,opt,name=state,proto3,enum=example.app.order.v1.State" json:"state,omitempty"`
CustomerId string `protobuf:"bytes,4,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"`
CustomerName string `protobuf:"bytes,5,opt,name=customer_name,json=customerName,proto3" json:"customer_name,omitempty"`
CreateAt int64 `protobuf:"varint,6,opt,name=create_at,json=createAt,proto3" json:"create_at,omitempty"`
CreateBy string `protobuf:"bytes,7,opt,name=create_by,json=createBy,proto3" json:"create_by,omitempty"`
ModifyAt int64 `protobuf:"varint,8,opt,name=modify_at,json=modifyAt,proto3" json:"modify_at,omitempty"`
ModifyBy string `protobuf:"bytes,9,opt,name=modify_by,json=modifyBy,proto3" json:"modify_by,omitempty"`
TotalCents int64 `protobuf:"varint,10,opt,name=total_cents,json=totalCents,proto3" json:"total_cents,omitempty"`
ItemCount int32 `protobuf:"varint,11,opt,name=item_count,json=itemCount,proto3" json:"item_count,omitempty"`
ShippingAddress string `protobuf:"bytes,12,opt,name=shipping_address,json=shippingAddress,proto3" json:"shipping_address,omitempty"`
PlacedAt int64 `protobuf:"varint,13,opt,name=placed_at,json=placedAt,proto3" json:"placed_at,omitempty"`
Items map[string]*LineItem `` /* 138-byte string literal not displayed */
Tags map[string]*Tag `` /* 136-byte string literal not displayed */
// contains filtered or unexported fields
}
func (*Order) AfterOn ¶
func (o *Order) AfterOn()
AfterOn computes derived fields from the items collection. Called once after full event replay in Load, once after all new events in Apply (materialization), and inside Builder.Snapshot when a snapshot is actually emitted. Not called per-event — safe to iterate collections here.
func (*Order) Descriptor
deprecated
func (*Order) GetCreateAt ¶
func (*Order) GetCreateBy ¶
func (*Order) GetCustomerId ¶
func (*Order) GetCustomerName ¶
func (*Order) GetItemCount ¶
func (*Order) GetModifyAt ¶
func (*Order) GetModifyBy ¶
func (*Order) GetPlacedAt ¶
func (*Order) GetShippingAddress ¶
func (*Order) GetTotalCents ¶
func (*Order) GetVersion ¶
func (*Order) On ¶
func (aggregate *Order) On(event protosource.Event) error
On applies an event to the aggregate, rebuilding its state. This method is called during Repository.Load to reconstruct from stored events, and during test scenarios. Events represent facts — never reject based on business rules.
func (*Order) ProjectOrderSummary ¶
func (m *Order) ProjectOrderSummary() *OrderSummary
ProjectOrderSummary builds a OrderSummary projection from the aggregate.
func (*Order) Projections ¶
Projections returns all projection views derived from this aggregate.
func (*Order) ProtoMessage ¶
func (*Order) ProtoMessage()
func (*Order) ProtoReflect ¶
func (x *Order) ProtoReflect() protoreflect.Message
func (*Order) RestoreSnapshot ¶
func (*Order) SnapshotInterval ¶
type OrderClient ¶
type OrderClient struct {
// contains filtered or unexported fields
}
func NewOrderClient ¶
func NewOrderClient(store opaquedata.OpaqueStore) *OrderClient
func (*OrderClient) AddOrder ¶
func (c *OrderClient) AddOrder(ctx context.Context, d *Order, opts ...opaquedata.Option) error
func (*OrderClient) DeleteOrder ¶
func (c *OrderClient) DeleteOrder(ctx context.Context, id string) error
func (*OrderClient) SelectOrderByCustomerId ¶
func (c *OrderClient) SelectOrderByCustomerId(ctx context.Context, customer_id string) ([]*Order, error)
SelectOrderByCustomerId queries GSI1 by partition key.
func (*OrderClient) SelectOrderByCustomerIdWithCreateAt ¶
func (c *OrderClient) SelectOrderByCustomerIdWithCreateAt(ctx context.Context, customer_id string, op opaquedata.SortOperator, vals ...OrderGSI1SK) ([]*Order, error)
SelectOrderByCustomerIdWithCreateAt queries GSI1 with a sort key condition.
func (*OrderClient) UpdateOrder ¶
func (c *OrderClient) UpdateOrder(ctx context.Context, d *Order, opts ...opaquedata.Option) error
type OrderGSI1SK ¶
type OrderGSI1SK struct {
CreateAt int64
}
func (OrderGSI1SK) String ¶
func (v OrderGSI1SK) String() string
type OrderList ¶
type OrderList struct {
Items []*Order `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
// contains filtered or unexported fields
}
func (*OrderList) Descriptor
deprecated
func (*OrderList) ProtoMessage ¶
func (*OrderList) ProtoMessage()
func (*OrderList) ProtoReflect ¶
func (x *OrderList) ProtoReflect() protoreflect.Message
type OrderSummary ¶
type OrderSummary struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
State State `protobuf:"varint,2,opt,name=state,proto3,enum=example.app.order.v1.State" json:"state,omitempty"`
CustomerId string `protobuf:"bytes,3,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"`
CustomerName string `protobuf:"bytes,4,opt,name=customer_name,json=customerName,proto3" json:"customer_name,omitempty"`
TotalCents int64 `protobuf:"varint,5,opt,name=total_cents,json=totalCents,proto3" json:"total_cents,omitempty"`
ItemCount int32 `protobuf:"varint,6,opt,name=item_count,json=itemCount,proto3" json:"item_count,omitempty"`
PlacedAt int64 `protobuf:"varint,7,opt,name=placed_at,json=placedAt,proto3" json:"placed_at,omitempty"`
CreateAt int64 `protobuf:"varint,8,opt,name=create_at,json=createAt,proto3" json:"create_at,omitempty"`
// contains filtered or unexported fields
}
OrderSummary is a lightweight view of the Order for listings and dashboards. Fields are a subset of the aggregate — matched by name, copied automatically. PK is the same as the aggregate; SK = "PROJ#OrderSummary". GSI2 provides a status+placed_at index not present on the aggregate itself.
func (*OrderSummary) Descriptor
deprecated
func (*OrderSummary) Descriptor() ([]byte, []int)
Deprecated: Use OrderSummary.ProtoReflect.Descriptor instead.
func (*OrderSummary) GSI1PK ¶
func (m *OrderSummary) GSI1PK() string
func (*OrderSummary) GSI1SK ¶
func (m *OrderSummary) GSI1SK() string
func (*OrderSummary) GSI2PK ¶
func (m *OrderSummary) GSI2PK() string
func (*OrderSummary) GSI2SK ¶
func (m *OrderSummary) GSI2SK() string
func (*OrderSummary) GSI3PK ¶
func (m *OrderSummary) GSI3PK() string
func (*OrderSummary) GSI3SK ¶
func (m *OrderSummary) GSI3SK() string
func (*OrderSummary) GSI4PK ¶
func (m *OrderSummary) GSI4PK() string
func (*OrderSummary) GSI4SK ¶
func (m *OrderSummary) GSI4SK() string
func (*OrderSummary) GSI5PK ¶
func (m *OrderSummary) GSI5PK() string
func (*OrderSummary) GSI5SK ¶
func (m *OrderSummary) GSI5SK() string
func (*OrderSummary) GSI6PK ¶
func (m *OrderSummary) GSI6PK() string
func (*OrderSummary) GSI6SK ¶
func (m *OrderSummary) GSI6SK() string
func (*OrderSummary) GSI7PK ¶
func (m *OrderSummary) GSI7PK() string
func (*OrderSummary) GSI7SK ¶
func (m *OrderSummary) GSI7SK() string
func (*OrderSummary) GSI8PK ¶
func (m *OrderSummary) GSI8PK() string
func (*OrderSummary) GSI8SK ¶
func (m *OrderSummary) GSI8SK() string
func (*OrderSummary) GSI9PK ¶
func (m *OrderSummary) GSI9PK() string
func (*OrderSummary) GSI9SK ¶
func (m *OrderSummary) GSI9SK() string
func (*OrderSummary) GSI10PK ¶
func (m *OrderSummary) GSI10PK() string
func (*OrderSummary) GSI10SK ¶
func (m *OrderSummary) GSI10SK() string
func (*OrderSummary) GSI11PK ¶
func (m *OrderSummary) GSI11PK() string
func (*OrderSummary) GSI11SK ¶
func (m *OrderSummary) GSI11SK() string
func (*OrderSummary) GSI12PK ¶
func (m *OrderSummary) GSI12PK() string
func (*OrderSummary) GSI12SK ¶
func (m *OrderSummary) GSI12SK() string
func (*OrderSummary) GSI13PK ¶
func (m *OrderSummary) GSI13PK() string
func (*OrderSummary) GSI13SK ¶
func (m *OrderSummary) GSI13SK() string
func (*OrderSummary) GSI14PK ¶
func (m *OrderSummary) GSI14PK() string
func (*OrderSummary) GSI14SK ¶
func (m *OrderSummary) GSI14SK() string
func (*OrderSummary) GSI15PK ¶
func (m *OrderSummary) GSI15PK() string
func (*OrderSummary) GSI15SK ¶
func (m *OrderSummary) GSI15SK() string
func (*OrderSummary) GSI16PK ¶
func (m *OrderSummary) GSI16PK() string
func (*OrderSummary) GSI16SK ¶
func (m *OrderSummary) GSI16SK() string
func (*OrderSummary) GSI17PK ¶
func (m *OrderSummary) GSI17PK() string
func (*OrderSummary) GSI17SK ¶
func (m *OrderSummary) GSI17SK() string
func (*OrderSummary) GSI18PK ¶
func (m *OrderSummary) GSI18PK() string
func (*OrderSummary) GSI18SK ¶
func (m *OrderSummary) GSI18SK() string
func (*OrderSummary) GSI19PK ¶
func (m *OrderSummary) GSI19PK() string
func (*OrderSummary) GSI19SK ¶
func (m *OrderSummary) GSI19SK() string
func (*OrderSummary) GSI20PK ¶
func (m *OrderSummary) GSI20PK() string
func (*OrderSummary) GSI20SK ¶
func (m *OrderSummary) GSI20SK() string
func (*OrderSummary) GetCreateAt ¶
func (x *OrderSummary) GetCreateAt() int64
func (*OrderSummary) GetCustomerId ¶
func (x *OrderSummary) GetCustomerId() string
func (*OrderSummary) GetCustomerName ¶
func (x *OrderSummary) GetCustomerName() string
func (*OrderSummary) GetId ¶
func (x *OrderSummary) GetId() string
func (*OrderSummary) GetItemCount ¶
func (x *OrderSummary) GetItemCount() int32
func (*OrderSummary) GetPlacedAt ¶
func (x *OrderSummary) GetPlacedAt() int64
func (*OrderSummary) GetState ¶
func (x *OrderSummary) GetState() State
func (*OrderSummary) GetTotalCents ¶
func (x *OrderSummary) GetTotalCents() int64
func (*OrderSummary) Hydrate ¶
func (m *OrderSummary) Hydrate(body []byte) error
func (*OrderSummary) PK ¶
func (m *OrderSummary) PK() string
PK is automatic: package#aggregate#id#<id_value>
func (*OrderSummary) ProtoMessage ¶
func (*OrderSummary) ProtoMessage()
func (*OrderSummary) ProtoReflect ¶
func (x *OrderSummary) ProtoReflect() protoreflect.Message
func (*OrderSummary) Reset ¶
func (x *OrderSummary) Reset()
func (*OrderSummary) SK ¶
func (m *OrderSummary) SK() string
func (*OrderSummary) String ¶
func (x *OrderSummary) String() string
type OrderSummaryClient ¶
type OrderSummaryClient struct {
// contains filtered or unexported fields
}
func NewOrderSummaryClient ¶
func NewOrderSummaryClient(store opaquedata.OpaqueStore) *OrderSummaryClient
func (*OrderSummaryClient) AddOrderSummary ¶
func (c *OrderSummaryClient) AddOrderSummary(ctx context.Context, d *OrderSummary, opts ...opaquedata.Option) error
func (*OrderSummaryClient) DeleteOrderSummary ¶
func (c *OrderSummaryClient) DeleteOrderSummary(ctx context.Context, id string) error
func (*OrderSummaryClient) GetOrderSummary ¶
func (c *OrderSummaryClient) GetOrderSummary(ctx context.Context, id string) (*OrderSummary, error)
func (*OrderSummaryClient) SelectOrderSummaryByCustomerId ¶
func (c *OrderSummaryClient) SelectOrderSummaryByCustomerId(ctx context.Context, customer_id string) ([]*OrderSummary, error)
SelectOrderSummaryByCustomerId queries GSI1 by partition key.
func (*OrderSummaryClient) SelectOrderSummaryByCustomerIdWithCreateAt ¶
func (c *OrderSummaryClient) SelectOrderSummaryByCustomerIdWithCreateAt(ctx context.Context, customer_id string, op opaquedata.SortOperator, vals ...OrderSummaryGSI1SK) ([]*OrderSummary, error)
SelectOrderSummaryByCustomerIdWithCreateAt queries GSI1 with a sort key condition.
func (*OrderSummaryClient) SelectOrderSummaryByState ¶
func (c *OrderSummaryClient) SelectOrderSummaryByState(ctx context.Context, state State) ([]*OrderSummary, error)
SelectOrderSummaryByState queries GSI2 by partition key.
func (*OrderSummaryClient) SelectOrderSummaryByStateWithPlacedAt ¶
func (c *OrderSummaryClient) SelectOrderSummaryByStateWithPlacedAt(ctx context.Context, state State, op opaquedata.SortOperator, vals ...OrderSummaryGSI2SK) ([]*OrderSummary, error)
SelectOrderSummaryByStateWithPlacedAt queries GSI2 with a sort key condition.
func (*OrderSummaryClient) UpdateOrderSummary ¶
func (c *OrderSummaryClient) UpdateOrderSummary(ctx context.Context, d *OrderSummary, opts ...opaquedata.Option) error
type OrderSummaryGSI1SK ¶
type OrderSummaryGSI1SK struct {
CreateAt int64
}
func (OrderSummaryGSI1SK) String ¶
func (v OrderSummaryGSI1SK) String() string
type OrderSummaryGSI2SK ¶
type OrderSummaryGSI2SK struct {
PlacedAt int64
}
func (OrderSummaryGSI2SK) String ¶
func (v OrderSummaryGSI2SK) String() string
type Place ¶
type Place struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Actor string `protobuf:"bytes,2,opt,name=actor,proto3" json:"actor,omitempty"`
PlacedAt int64 `protobuf:"varint,3,opt,name=placed_at,json=placedAt,proto3" json:"placed_at,omitempty"`
// contains filtered or unexported fields
}
func (*Place) CommandName ¶
func (*Place) Descriptor
deprecated
func (*Place) EmitEvents ¶
func (m *Place) EmitEvents(aggregate protosource.Aggregate) []protosource.Event
func (*Place) GetPlacedAt ¶
func (*Place) GuardState ¶ added in v0.1.1
func (m *Place) GuardState(aggregate protosource.Aggregate) error
func (*Place) ProtoMessage ¶
func (*Place) ProtoMessage()
func (*Place) ProtoReflect ¶
func (x *Place) ProtoReflect() protoreflect.Message
func (*Place) ProtoValidate ¶
func (*Place) ValidateVersion ¶
type Placed ¶
type Placed struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Version int64 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
At int64 `protobuf:"varint,3,opt,name=at,proto3" json:"at,omitempty"`
Actor string `protobuf:"bytes,4,opt,name=actor,proto3" json:"actor,omitempty"`
PlacedAt int64 `protobuf:"varint,5,opt,name=placed_at,json=placedAt,proto3" json:"placed_at,omitempty"`
// contains filtered or unexported fields
}
func (*Placed) Descriptor
deprecated
func (*Placed) GetPlacedAt ¶
func (*Placed) GetVersion ¶
func (*Placed) ProtoMessage ¶
func (*Placed) ProtoMessage()
func (*Placed) ProtoReflect ¶
func (x *Placed) ProtoReflect() protoreflect.Message
type RemoveItem ¶
type RemoveItem struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Actor string `protobuf:"bytes,2,opt,name=actor,proto3" json:"actor,omitempty"`
ItemId string `protobuf:"bytes,3,opt,name=item_id,json=itemId,proto3" json:"item_id,omitempty"`
// contains filtered or unexported fields
}
func (*RemoveItem) CommandName ¶
func (m *RemoveItem) CommandName() string
func (*RemoveItem) Descriptor
deprecated
func (*RemoveItem) Descriptor() ([]byte, []int)
Deprecated: Use RemoveItem.ProtoReflect.Descriptor instead.
func (*RemoveItem) EmitEvents ¶
func (m *RemoveItem) EmitEvents(aggregate protosource.Aggregate) []protosource.Event
func (*RemoveItem) GetActor ¶
func (x *RemoveItem) GetActor() string
func (*RemoveItem) GetId ¶
func (x *RemoveItem) GetId() string
func (*RemoveItem) GetItemId ¶
func (x *RemoveItem) GetItemId() string
func (*RemoveItem) GuardState ¶ added in v0.1.1
func (m *RemoveItem) GuardState(aggregate protosource.Aggregate) error
func (*RemoveItem) ProtoMessage ¶
func (*RemoveItem) ProtoMessage()
func (*RemoveItem) ProtoReflect ¶
func (x *RemoveItem) ProtoReflect() protoreflect.Message
func (*RemoveItem) ProtoValidate ¶
func (m *RemoveItem) ProtoValidate() error
func (*RemoveItem) Reset ¶
func (x *RemoveItem) Reset()
func (*RemoveItem) String ¶
func (x *RemoveItem) String() string
func (*RemoveItem) ValidateVersion ¶
func (m *RemoveItem) ValidateVersion(version int64) error
type RemoveTag ¶
type RemoveTag struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Actor string `protobuf:"bytes,2,opt,name=actor,proto3" json:"actor,omitempty"`
Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"`
// contains filtered or unexported fields
}
func (*RemoveTag) CommandName ¶
func (*RemoveTag) Descriptor
deprecated
func (*RemoveTag) EmitEvents ¶
func (m *RemoveTag) EmitEvents(aggregate protosource.Aggregate) []protosource.Event
func (*RemoveTag) GuardState ¶ added in v0.1.1
func (m *RemoveTag) GuardState(aggregate protosource.Aggregate) error
func (*RemoveTag) ProtoMessage ¶
func (*RemoveTag) ProtoMessage()
func (*RemoveTag) ProtoReflect ¶
func (x *RemoveTag) ProtoReflect() protoreflect.Message
func (*RemoveTag) ProtoValidate ¶
func (*RemoveTag) ValidateVersion ¶
type Repo ¶
type Repo interface {
protosource.Repo
}
Repo is a package-specific interface for dependency injection. It embeds protosource.Repo so that *protosource.Repository satisfies it, while giving each aggregate package a distinct type for Wire.
type Repository ¶ added in v0.1.4
type Repository struct{ *protosource.Repository }
Repository wraps *protosource.Repository for the Order aggregate, giving Wire a distinct concrete type per aggregate.
func ProvideRepository ¶ added in v0.1.4
func ProvideRepository(store protosource.Store, serializer protosource.Serializer) *Repository
ProvideRepository creates a Order repository accepting interfaces.
type SetShipping ¶
type SetShipping struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Actor string `protobuf:"bytes,2,opt,name=actor,proto3" json:"actor,omitempty"`
ShippingAddress string `protobuf:"bytes,3,opt,name=shipping_address,json=shippingAddress,proto3" json:"shipping_address,omitempty"`
// contains filtered or unexported fields
}
func (*SetShipping) CommandName ¶
func (m *SetShipping) CommandName() string
func (*SetShipping) Descriptor
deprecated
func (*SetShipping) Descriptor() ([]byte, []int)
Deprecated: Use SetShipping.ProtoReflect.Descriptor instead.
func (*SetShipping) EmitEvents ¶
func (m *SetShipping) EmitEvents(aggregate protosource.Aggregate) []protosource.Event
func (*SetShipping) GetActor ¶
func (x *SetShipping) GetActor() string
func (*SetShipping) GetId ¶
func (x *SetShipping) GetId() string
func (*SetShipping) GetShippingAddress ¶
func (x *SetShipping) GetShippingAddress() string
func (*SetShipping) GuardState ¶ added in v0.1.1
func (m *SetShipping) GuardState(aggregate protosource.Aggregate) error
func (*SetShipping) ProtoMessage ¶
func (*SetShipping) ProtoMessage()
func (*SetShipping) ProtoReflect ¶
func (x *SetShipping) ProtoReflect() protoreflect.Message
func (*SetShipping) ProtoValidate ¶
func (m *SetShipping) ProtoValidate() error
func (*SetShipping) Reset ¶
func (x *SetShipping) Reset()
func (*SetShipping) String ¶
func (x *SetShipping) String() string
func (*SetShipping) ValidateVersion ¶
func (m *SetShipping) ValidateVersion(version int64) error
type ShippingSet ¶
type ShippingSet struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Version int64 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
At int64 `protobuf:"varint,3,opt,name=at,proto3" json:"at,omitempty"`
Actor string `protobuf:"bytes,4,opt,name=actor,proto3" json:"actor,omitempty"`
ShippingAddress string `protobuf:"bytes,5,opt,name=shipping_address,json=shippingAddress,proto3" json:"shipping_address,omitempty"`
// contains filtered or unexported fields
}
func (*ShippingSet) Descriptor
deprecated
func (*ShippingSet) Descriptor() ([]byte, []int)
Deprecated: Use ShippingSet.ProtoReflect.Descriptor instead.
func (*ShippingSet) EventName ¶
func (m *ShippingSet) EventName() string
func (*ShippingSet) GetActor ¶
func (x *ShippingSet) GetActor() string
func (*ShippingSet) GetAt ¶
func (x *ShippingSet) GetAt() int64
func (*ShippingSet) GetId ¶
func (x *ShippingSet) GetId() string
func (*ShippingSet) GetShippingAddress ¶
func (x *ShippingSet) GetShippingAddress() string
func (*ShippingSet) GetVersion ¶
func (x *ShippingSet) GetVersion() int64
func (*ShippingSet) ProtoMessage ¶
func (*ShippingSet) ProtoMessage()
func (*ShippingSet) ProtoReflect ¶
func (x *ShippingSet) ProtoReflect() protoreflect.Message
func (*ShippingSet) Reset ¶
func (x *ShippingSet) Reset()
func (*ShippingSet) String ¶
func (x *ShippingSet) String() string
type Snapshot ¶
type Snapshot struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Version int64 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
At int64 `protobuf:"varint,3,opt,name=at,proto3" json:"at,omitempty"`
Actor string `protobuf:"bytes,4,opt,name=actor,proto3" json:"actor,omitempty"`
Snapshot *Order `protobuf:"bytes,5,opt,name=snapshot,proto3" json:"snapshot,omitempty"`
// contains filtered or unexported fields
}
func (*Snapshot) Descriptor
deprecated
func (*Snapshot) GetSnapshot ¶
func (*Snapshot) GetVersion ¶
func (*Snapshot) ProtoMessage ¶
func (*Snapshot) ProtoMessage()
func (*Snapshot) ProtoReflect ¶
func (x *Snapshot) ProtoReflect() protoreflect.Message
type State ¶
type State int32
func (State) Descriptor ¶
func (State) Descriptor() protoreflect.EnumDescriptor
func (State) EnumDescriptor
deprecated
func (State) Number ¶
func (x State) Number() protoreflect.EnumNumber
func (State) Type ¶
func (State) Type() protoreflect.EnumType
type Tag ¶
type Tag struct {
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
// contains filtered or unexported fields
}
Tag is a key-value label on an order (e.g. "priority"="rush", "source"="web").
func (*Tag) Descriptor
deprecated
func (*Tag) ProtoMessage ¶
func (*Tag) ProtoMessage()
func (*Tag) ProtoReflect ¶
func (x *Tag) ProtoReflect() protoreflect.Message
type TagAdded ¶
type TagAdded struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Version int64 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
At int64 `protobuf:"varint,3,opt,name=at,proto3" json:"at,omitempty"`
Actor string `protobuf:"bytes,4,opt,name=actor,proto3" json:"actor,omitempty"`
Tag *Tag `protobuf:"bytes,5,opt,name=tag,proto3" json:"tag,omitempty"`
// contains filtered or unexported fields
}
func (*TagAdded) Descriptor
deprecated
func (*TagAdded) GetVersion ¶
func (*TagAdded) ProtoMessage ¶
func (*TagAdded) ProtoMessage()
func (*TagAdded) ProtoReflect ¶
func (x *TagAdded) ProtoReflect() protoreflect.Message
type TagRemoved ¶
type TagRemoved struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Version int64 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
At int64 `protobuf:"varint,3,opt,name=at,proto3" json:"at,omitempty"`
Actor string `protobuf:"bytes,4,opt,name=actor,proto3" json:"actor,omitempty"`
Key string `protobuf:"bytes,5,opt,name=key,proto3" json:"key,omitempty"`
// contains filtered or unexported fields
}
func (*TagRemoved) Descriptor
deprecated
func (*TagRemoved) Descriptor() ([]byte, []int)
Deprecated: Use TagRemoved.ProtoReflect.Descriptor instead.
func (*TagRemoved) EventName ¶
func (m *TagRemoved) EventName() string
func (*TagRemoved) GetActor ¶
func (x *TagRemoved) GetActor() string
func (*TagRemoved) GetAt ¶
func (x *TagRemoved) GetAt() int64
func (*TagRemoved) GetId ¶
func (x *TagRemoved) GetId() string
func (*TagRemoved) GetKey ¶
func (x *TagRemoved) GetKey() string
func (*TagRemoved) GetVersion ¶
func (x *TagRemoved) GetVersion() int64
func (*TagRemoved) ProtoMessage ¶
func (*TagRemoved) ProtoMessage()
func (*TagRemoved) ProtoReflect ¶
func (x *TagRemoved) ProtoReflect() protoreflect.Message
func (*TagRemoved) Reset ¶
func (x *TagRemoved) Reset()
func (*TagRemoved) String ¶
func (x *TagRemoved) String() string