MCPcopy
hub / github.com/perkeep/perkeep / populateClaimMap

Function populateClaimMap

pkg/schema/schema.go:839–854  ·  view source on GitHub ↗
(m map[string]interface{}, cp *claimParam)

Source from the content-addressed store, hash-verified

837}
838
839func populateClaimMap(m map[string]interface{}, cp *claimParam) {
840 m["claimType"] = string(cp.claimType)
841 switch cp.claimType {
842 case ShareClaim:
843 m["authType"] = cp.authType
844 m["transitive"] = cp.transitive
845 case DeleteClaim:
846 m["target"] = cp.target.String()
847 default:
848 m["permaNode"] = cp.permanode.String()
849 m["attribute"] = cp.attribute
850 if !(cp.claimType == DelAttributeClaim && cp.value == "") {
851 m["value"] = cp.value
852 }
853 }
854}
855
856// NewShareRef creates a *Builder for a "share" claim.
857func NewShareRef(authType string, transitive bool) *Builder {

Callers 1

newClaimFunction · 0.85

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected