github.com/tacerus/ldifdiff@v0.0.0-20181030102753-4dccbe38183b/types.go (about) 1 package ldifdiff 2 3 /* Types */ 4 // Each Dn has an action (actionAdd, actionDelete, actionModify) and a set of subctions applied 5 // on the associated attributes; 6 // - action actionAdd and actionDelete have no subactions (typed as 1 subaction subActionNone) and 7 // are expected to have only 1 set of attributes. actionAdd will add the Dn with the 8 // supplied attributes, while actionDelete will delete the Dn completely (supplied 9 // attributes are ignored). 10 // - action actionModify is more complex and has 3 types of subactions (subActionModifyAdd, 11 // subActionModifyDelete and subActionModifyUpdate). A Dn with a actionModify action can have 12 // multiple combinations of subActions and associated attributes. In the case of the 13 // subAction ModifyUpdate, the attribute must be unique in order to to respect possible 14 // schema restrictions (rfc2849). 15 16 type action int 17 type subAction int 18 type subActionAttrs map[subAction][]string 19 type actionEntry struct { 20 Dn string 21 Action action 22 SubActionAttrs []subActionAttrs 23 } 24 25 // Return map with dn as key and attribute array as value 26 type entries map[string][]string 27 28 const ( 29 actionAdd action = iota 30 actionDelete 31 actionModify 32 ) 33 const ( 34 subActionModifyAdd subAction = iota 35 subActionModifyDelete 36 subActionModifyReplace 37 subActionNone 38 )