MCPcopy
hub / github.com/FiloSottile/age / HandleIdentityEncoding

Method HandleIdentityEncoding

plugin/plugin.go:141–145  ·  view source on GitHub ↗

HandleIdentityEncoding is like [Plugin.HandleIdentity] but provides the full identity encoding string to the callback. It allows using functions like ParseIdentity directly.

(f func(identity string) (age.Identity, error))

Source from the content-addressed store, hash-verified

139//
140// It allows using functions like ParseIdentity directly.
141func (p *Plugin) HandleIdentityEncoding(f func(identity string) (age.Identity, error)) {
142 p.HandleIdentity(func(data []byte) (age.Identity, error) {
143 return f(EncodeIdentity(p.name, data))
144 })
145}
146
147// Main runs the plugin protocol. It returns an exit code to pass to os.Exit.
148//

Callers

nothing calls this directly

Calls 2

HandleIdentityMethod · 0.95
EncodeIdentityFunction · 0.85

Tested by

no test coverage detected