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

Method HandleRecipient

plugin/plugin.go:82–87  ·  view source on GitHub ↗

HandleRecipient registers a function to parse recipients of the form age1name1... into [age.Recipient] values. data is the decoded Bech32 payload. If the returned Recipient implements [age.RecipientWithLabels], Plugin will use it and enforce consistency across every returned stanza in an execution.

(f func(data []byte) (age.Recipient, error))

Source from the content-addressed store, hash-verified

80// It must be called before [Plugin.Main], and can be called at most once.
81// Otherwise, it panics.
82func (p *Plugin) HandleRecipient(f func(data []byte) (age.Recipient, error)) {
83 if p.recipient != nil {
84 panic("HandleRecipient called twice")
85 }
86 p.recipient = f
87}
88
89// HandleIdentityAsRecipient registers a function to parse identities of the
90// form AGE-PLUGIN-NAME-1... into [age.Recipient] values, for when identities

Callers 6

TestMainFunction · 0.80
ExamplePlugin_mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
TestMainFunction · 0.80

Calls

no outgoing calls

Tested by 3

TestMainFunction · 0.64
ExamplePlugin_mainFunction · 0.64
TestMainFunction · 0.64