Documentation
¶
Overview ¶
Package history provides interfaces for managing DataStore entities that correspond to past DataStore data
Index ¶
- Constants
- func BatchUpdateSnapshotMsg(ctx context.Context, msgs []*SnapshotMsgEntity) error
- func CreateBatchChangeEvents(ctx context.Context, changes []*ufspb.ChangeEvent) ([]*ufspb.ChangeEvent, error)
- func DeleteChangeEventEntities(ctx context.Context, entities []*ChangeEventEntity) error
- func DeleteSnapshotMsgEntities(ctx context.Context, entities []*SnapshotMsgEntity) error
- func QueryChangesByPropertyName(ctx context.Context, propertyName, id string) ([]*ufspb.ChangeEvent, error)
- type ChangeEventEntity
- type SnapshotMsgEntity
Constants ¶
const ChangeEventKind string = "ChangeEvent"
ChangeEventKind is the datastore entity kind for entity changes.
const SnapshotMsgKind string = "SnapshotMsg"
SnapshotMsgKind is the datastore entity kind for storing the snapshot msgs of resources.
Variables ¶
This section is empty.
Functions ¶
func BatchUpdateSnapshotMsg ¶
func BatchUpdateSnapshotMsg(ctx context.Context, msgs []*SnapshotMsgEntity) error
BatchUpdateSnapshotMsg updates a batch of new snapshot msgs
func CreateBatchChangeEvents ¶
func CreateBatchChangeEvents(ctx context.Context, changes []*ufspb.ChangeEvent) ([]*ufspb.ChangeEvent, error)
CreateBatchChangeEvents creates a batch of new change records in datastore.
func DeleteChangeEventEntities ¶
func DeleteChangeEventEntities(ctx context.Context, entities []*ChangeEventEntity) error
DeleteChangeEventEntities deletes a batch of change events' entities
func DeleteSnapshotMsgEntities ¶
func DeleteSnapshotMsgEntities(ctx context.Context, entities []*SnapshotMsgEntity) error
DeleteSnapshotMsgEntities deletes a batch of snapshot msg entities
func QueryChangesByPropertyName ¶
func QueryChangesByPropertyName(ctx context.Context, propertyName, id string) ([]*ufspb.ChangeEvent, error)
QueryChangesByPropertyName queries change event Entity in the datastore
Types ¶
type ChangeEventEntity ¶
type ChangeEventEntity struct { Extra datastore.PropertyMap `gae:",extra"` // Add an auto-increment ID as key for deleting ID int64 `gae:"$id"` Name string `gae:"name"` UserEmail string `gae:"user_email"` // ufspb.ChangeEvent cannot be directly used as it contains pointer. Change []byte `gae:",noindex"` // contains filtered or unexported fields }
ChangeEventEntity is a datastore entity that tracks a platform.
func GetAllChangeEventEntities ¶
func GetAllChangeEventEntities(ctx context.Context) ([]*ChangeEventEntity, error)
GetAllChangeEventEntities returns all change events' entities in datastore.
func (*ChangeEventEntity) GetProto ¶
func (e *ChangeEventEntity) GetProto() (proto.Message, error)
GetProto returns the unmarshaled Chrome platform.
func (*ChangeEventEntity) Validate ¶
func (e *ChangeEventEntity) Validate() error
Validate returns whether the ChangeEventEntity is valid.
type SnapshotMsgEntity ¶
type SnapshotMsgEntity struct { Extra datastore.PropertyMap `gae:",extra"` // Add an auto-increment ID as key for deleting ID int64 `gae:"$id"` ResourceName string `gae:"resource_name"` Delete bool `gae:"delete"` Msg []byte `gae:",noindex"` // contains filtered or unexported fields }
SnapshotMsgEntity is a datastore entity that stores the snapshot msgs.
func GetAllSnapshotMsg ¶
func GetAllSnapshotMsg(ctx context.Context) ([]*SnapshotMsgEntity, error)
GetAllSnapshotMsg returns all snapshot msg entities in datastore.
func NewSnapshotMsgEntity ¶
func NewSnapshotMsgEntity(resourceName string, delete bool, pm proto.Message) (*SnapshotMsgEntity, error)
NewSnapshotMsgEntity creates a new SnapshotMsgEntity
func QuerySnapshotMsgByPropertyName ¶
func QuerySnapshotMsgByPropertyName(ctx context.Context, propertyName, id string) ([]*SnapshotMsgEntity, error)
QuerySnapshotMsgByPropertyName queries snapshot msg entity in the datastore