Documentation ¶
Overview ¶
Package cockroach provides an implementation of a dss.Store on top of a cockroach DB instance.
Index ¶
- Variables
- type ISAStore
- func (c *ISAStore) Delete(ctx context.Context, isa *ridmodels.IdentificationServiceArea) (*ridmodels.IdentificationServiceArea, []*ridmodels.Subscription, error)
- func (c *ISAStore) Get(ctx context.Context, id dssmodels.ID) (*ridmodels.IdentificationServiceArea, error)
- func (c *ISAStore) Insert(ctx context.Context, isa *ridmodels.IdentificationServiceArea) (*ridmodels.IdentificationServiceArea, []*ridmodels.Subscription, error)
- func (c *ISAStore) Search(ctx context.Context, cells s2.CellUnion, earliest *time.Time, ...) ([]*ridmodels.IdentificationServiceArea, error)
- func (c *ISAStore) Update(ctx context.Context, isa *ridmodels.IdentificationServiceArea) (*ridmodels.IdentificationServiceArea, []*ridmodels.Subscription, error)
- type Store
- type SubscriptionStore
- func (c *SubscriptionStore) Delete(ctx context.Context, s *ridmodels.Subscription) (*ridmodels.Subscription, error)
- func (c *SubscriptionStore) Get(ctx context.Context, id dssmodels.ID) (*ridmodels.Subscription, error)
- func (c *SubscriptionStore) Insert(ctx context.Context, s *ridmodels.Subscription) (*ridmodels.Subscription, error)
- func (c *SubscriptionStore) Search(ctx context.Context, cells s2.CellUnion) ([]*ridmodels.Subscription, error)
- func (c *SubscriptionStore) SearchByOwner(ctx context.Context, cells s2.CellUnion, owner dssmodels.Owner) ([]*ridmodels.Subscription, error)
- func (c *SubscriptionStore) Update(ctx context.Context, s *ridmodels.Subscription) (*ridmodels.Subscription, error)
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultClock is what is used as the Store's clock, returned from Dial. DefaultClock = clockwork.NewRealClock() )
Functions ¶
This section is empty.
Types ¶
type ISAStore ¶
ISAStore is an implementation of the ISARepo for CRDB.
func (*ISAStore) Delete ¶
func (c *ISAStore) Delete(ctx context.Context, isa *ridmodels.IdentificationServiceArea) (*ridmodels.IdentificationServiceArea, []*ridmodels.Subscription, error)
Delete deletes the IdentificationServiceArea identified by "id" and owned by "owner". Returns the delete IdentificationServiceArea and all Subscriptions affected by the delete.
func (*ISAStore) Get ¶
func (c *ISAStore) Get(ctx context.Context, id dssmodels.ID) (*ridmodels.IdentificationServiceArea, error)
Get returns the isa identified by "id".
func (*ISAStore) Insert ¶
func (c *ISAStore) Insert(ctx context.Context, isa *ridmodels.IdentificationServiceArea) (*ridmodels.IdentificationServiceArea, []*ridmodels.Subscription, error)
Insert inserts the IdentificationServiceArea identified by "id" and owned by "owner", affecting "cells" in the time interval ["starts", "ends"].
Returns the created IdentificationServiceArea and all Subscriptions affected by it. TODO: Simplify the logic to insert without a query, such that the insert fails if there's an existing entity.
func (*ISAStore) Search ¶
func (c *ISAStore) Search(ctx context.Context, cells s2.CellUnion, earliest *time.Time, latest *time.Time) ([]*ridmodels.IdentificationServiceArea, error)
Search searches IdentificationServiceArea instances that intersect with "cells" and, if set, the temporal volume defined by "earliest" and "latest".
func (*ISAStore) Update ¶
func (c *ISAStore) Update(ctx context.Context, isa *ridmodels.IdentificationServiceArea) (*ridmodels.IdentificationServiceArea, []*ridmodels.Subscription, error)
Update updates the IdentificationServiceArea identified by "id" and owned by "owner", affecting "cells" in the time interval ["starts", "ends"].
Returns the created IdentificationServiceArea and all Subscriptions affected by it. TODO: simplify the logic to just update, without the primary query.
type Store ¶
Store is an implementation of dss.Store using Cockroach DB as its backend store.
type SubscriptionStore ¶
SubscriptionStore is an implementation of the SubscriptionRepo for CRDB.
func (*SubscriptionStore) Delete ¶
func (c *SubscriptionStore) Delete(ctx context.Context, s *ridmodels.Subscription) (*ridmodels.Subscription, error)
Delete deletes the subscription identified by "id" and returns the deleted subscription.
func (*SubscriptionStore) Get ¶
func (c *SubscriptionStore) Get(ctx context.Context, id dssmodels.ID) (*ridmodels.Subscription, error)
Get returns the subscription identified by "id".
func (*SubscriptionStore) Insert ¶
func (c *SubscriptionStore) Insert(ctx context.Context, s *ridmodels.Subscription) (*ridmodels.Subscription, error)
Insert inserts subscription into the store and returns the resulting subscription including its ID.
func (*SubscriptionStore) Search ¶
func (c *SubscriptionStore) Search(ctx context.Context, cells s2.CellUnion) ([]*ridmodels.Subscription, error)
Search returns all subscriptions in "cells".
func (*SubscriptionStore) SearchByOwner ¶
func (c *SubscriptionStore) SearchByOwner(ctx context.Context, cells s2.CellUnion, owner dssmodels.Owner) ([]*ridmodels.Subscription, error)
SearchByOwner returns all subscriptions in "cells".
func (*SubscriptionStore) Update ¶
func (c *SubscriptionStore) Update(ctx context.Context, s *ridmodels.Subscription) (*ridmodels.Subscription, error)
Update updates the Subscription.. not yet implemented.