Ejemplo n.º 1
0
func (c *context) createEvent(a *ct.AppDeletion, err error) error {
	e := ct.AppDeletionEvent{AppDeletion: a}
	if err != nil {
		e.Error = err.Error()
	}
	return c.db.Exec("event_insert", a.AppID, a.AppID, string(ct.EventTypeAppDeletion), e)
}
Ejemplo n.º 2
0
func (c *context) createEvent(a *ct.AppDeletion, err error) error {
	e := ct.AppDeletionEvent{AppDeletion: a}
	if err != nil {
		e.Error = err.Error()
	}
	data, err := json.Marshal(e)
	if err != nil {
		return err
	}
	query := "INSERT INTO app_events (app_id, object_id, object_type, data) VALUES ($1, $2, $3, $4)"
	return c.db.Exec(query, a.AppID, a.AppID, string(ct.EventTypeAppDeletion), data)
}