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