Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Operator ¶
type Operator interface { Direct(scopedMap map[string]interface{}, scopedAttr string, value interface{}) (map[string]interface{}, bool) ByValueForItem(scopedSlice []interface{}, value interface{}) ([]interface{}, bool) ByValueExpressionForItem(scopedMaps []map[string]interface{}, expr filter.Expression, value interface{}) ([]map[string]interface{}, bool) ByValueExpressionForAttribute(scopedMaps []map[string]interface{}, expr filter.Expression, subAttr string, value interface{}) ([]map[string]interface{}, bool) }
Operator は Patch Operation の各操作のドメインとなるインターフェースです。 Direct は map とその map 内で更新対象となる属性と更新後の値を受け取って更新後のmapと変更有無を返却します この関数のみ、pathが未指定の場合でも利用されます ByValueForItem は path が指定されているときに、MultiValued な属性名が指定されたとき対象のスライスと指定された値を受け取って、更新後のスライスと変更有無を返却します。 ByValueExpressionForItem は 対象の属性が、MultiValuedComplexAttribute で path にて valFilter が指定されているときにそれを受けとって更新後のスライスと変更有無を返却します。 ByValueExpressionForAttribute は 対象の属性が、MultiValuedComplexAttribute で path にて valFilter と subAttr が指定されているときにそれを受けとって更新後のスライスと変更有無を返却します。
type Patcher ¶
type Patcher struct {
// contains filtered or unexported fields
}
func NewPatcher ¶
NewPatcher は Patcher の実態を取得します。
func (*Patcher) Apply ¶
func (p *Patcher) Apply(op scim.PatchOperation, data map[string]interface{}) (map[string]interface{}, bool, error)
Apply は RFC7644 3.5.2. Modifying with PATCH の実装です。 data に op が適用された ResourceAttributes と実際に適用されたかどうかの真偽値を返却します。 see. https://datatracker.ietf.org/doc/html/rfc7644#section-3.5.2
type PatcherOpts ¶
PatcherOpts を利用することで Pathcerが利用する各操作の Operator を上書きすることができます。 指定しない場合はパッケージデフォルトで実装されている Operator が利用されます。