MCPcopy Create free account
hub / github.com/git-bug/git-bug / Match

Method Match

bridge/core/auth/options.go:19–36  ·  view source on GitHub ↗
(cred Credential)

Source from the content-addressed store, hash-verified

17}
18
19func (opts *listOptions) Match(cred Credential) bool {
20 if opts.target != "" && cred.Target() != opts.target {
21 return false
22 }
23
24 _, has := opts.kind[cred.Kind()]
25 if len(opts.kind) > 0 && !has {
26 return false
27 }
28
29 for key, val := range opts.meta {
30 if v, ok := cred.GetMetadata(key); !ok || v != val {
31 return false
32 }
33 }
34
35 return true
36}
37
38func WithTarget(target string) ListOption {
39 return func(opts *listOptions) {

Callers 1

ListFunction · 0.45

Calls 3

TargetMethod · 0.65
KindMethod · 0.65
GetMetadataMethod · 0.65

Tested by

no test coverage detected