Documentation ¶
Overview ¶
Copyright 2018, Square, Inc.
Index ¶
Constants ¶
View Source
const ( VALIDATE_ON_CREATE byte = iota VALIDATE_ON_UPDATE VALIDATE_ON_DELETE )
Variables ¶
This section is empty.
Functions ¶
func IsDupeKeyError ¶ added in v0.11.0
func NewStore ¶
func NewStore(entities map[string]*mongo.Collection, cdcStore cdc.Store) store
NewStore creates a Store.
func NewValidator ¶
func NewValidator(entityTypes []string) validator
Types ¶
type Store ¶
type Store interface { WithContext(context.Context) Store ReadEntities(string, query.Query, etre.QueryFilter) ([]etre.Entity, error) CreateEntities(WriteOp, []etre.Entity) ([]string, error) UpdateEntities(WriteOp, query.Query, etre.Entity) ([]etre.Entity, error) DeleteEntities(WriteOp, query.Query) ([]etre.Entity, error) DeleteLabel(WriteOp, string) (etre.Entity, error) }
Store interface has methods needed to do CRUD operations on entities.
type ValidationError ¶
func (ValidationError) Error ¶
func (e ValidationError) Error() string
type WriteOp ¶
type WriteOp struct { Caller string // required (auth.Caller.Name) EntityType string // required EntityId string // optional // Delete ops do not support set ops like insert and update because no // entities are sent by the client on delete. However, the caller can do // DELETE /entity/node?setOp=foo&setId=bar&setSize=2 and the controller // will pass along the set op values. This could (but not currently) also // be used to impose/inject a set op on a write op that doesn't specify // a set op. SetOp string // optional SetId string // optional SetSize int // optional }
WriteOp represents common metadata for insert, update, and delete Store methods.
Click to show internal directories.
Click to hide internal directories.