Beispiel #1
0
func (l *Loader) insertUid(tx *sqlx.Tx, pubkey *Pubkey, r *UserId) error {
	_, err := tx.Execv(l.insertSelectFrom(`
INSERT INTO openpgp_uid (
	uuid, creation, expiration, state, packet,
	pubkey_uuid, revsig_uuid, keywords, keywords_fulltext)
SELECT $1, $2, $3, $4, $5,
	$6, $7, $8, to_tsvector($8)`,
		"openpgp_uid", "uuid = $1"),
		r.ScopedDigest, r.Creation, r.Expiration, r.State, r.Packet,
		pubkey.RFingerprint, r.RevSigDigest, util.CleanUtf8(r.Keywords))
	return err
}
Beispiel #2
0
func (uid *UserId) init() (err error) {
	uid.Creation = NeverExpires
	uid.Expiration = time.Unix(0, 0)
	uid.Keywords = util.CleanUtf8(uid.UserId.Id)
	return
}