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

Method HandleIdentity

plugin/plugin.go:112–117  ·  view source on GitHub ↗

HandleIdentity registers a function to parse identities of the form AGE-PLUGIN-NAME-1... into [age.Identity] values. data is the decoded Bech32 payload. It must be called before [Plugin.Main], and can be called at most once. Otherwise, it panics.

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

Source from the content-addressed store, hash-verified

110// It must be called before [Plugin.Main], and can be called at most once.
111// Otherwise, it panics.
112func (p *Plugin) HandleIdentity(f func(data []byte) (age.Identity, error)) {
113 if p.identity != nil {
114 panic("HandleIdentity called twice")
115 }
116 p.identity = f
117}
118
119// HandleRecipientEncoding is like [Plugin.HandleRecipient] but provides the
120// full recipient encoding string to the callback.

Callers 7

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

Calls

no outgoing calls

Tested by 3

TestMainFunction · 0.64
ExamplePlugin_mainFunction · 0.64
TestMainFunction · 0.64