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

Method HandleRecipientEncoding

plugin/plugin.go:123–127  ·  view source on GitHub ↗

HandleRecipientEncoding is like [Plugin.HandleRecipient] but provides the full recipient encoding string to the callback. It allows using functions like ParseRecipient directly.

(f func(recipient string) (age.Recipient, error))

Source from the content-addressed store, hash-verified

121//
122// It allows using functions like ParseRecipient directly.
123func (p *Plugin) HandleRecipientEncoding(f func(recipient string) (age.Recipient, error)) {
124 p.HandleRecipient(func(data []byte) (age.Recipient, error) {
125 return f(EncodeRecipient(p.name, data))
126 })
127}
128
129// HandleIdentityEncodingAsRecipient is like [Plugin.HandleIdentityAsRecipient] but
130// provides the full identity encoding string to the callback.

Callers 1

mainFunction · 0.80

Calls 2

HandleRecipientMethod · 0.95
EncodeRecipientFunction · 0.85

Tested by

no test coverage detected