Example #1
0
func (db *datastore) SetTeamSecret(sec *model.TeamSecret) error {
	var got = new(model.TeamSecret)
	var err = meddler.QueryRow(db, got, rebind(teamSecretNameQuery), sec.Key, sec.Name)
	if err == nil && got.ID != 0 {
		sec.ID = got.ID // update existing id
	}
	return meddler.Save(db, teamSecretTable, sec)
}
Example #2
0
func DeleteGlobalSecret(c context.Context, s *model.TeamSecret) error {
	s.Key = globalTeamName
	return DeleteTeamSecret(c, s)
}
Example #3
0
func SetGlobalSecret(c context.Context, s *model.TeamSecret) error {
	s.Key = globalTeamName
	return SetTeamSecret(c, s)
}