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

Function NewBridge

bridge/core/bridge.go:91–106  ·  view source on GitHub ↗

Instantiate a new Bridge for a repo, from the given target and name

(repo *cache.RepoCache, target string, name string)

Source from the content-addressed store, hash-verified

89
90// Instantiate a new Bridge for a repo, from the given target and name
91func NewBridge(repo *cache.RepoCache, target string, name string) (*Bridge, error) {
92 implType, ok := bridgeImpl[target]
93 if !ok {
94 return nil, fmt.Errorf("unknown bridge target %v", target)
95 }
96
97 impl := reflect.New(implType).Interface().(BridgeImpl)
98
99 bridge := &Bridge{
100 Name: name,
101 repo: repo,
102 impl: impl,
103 }
104
105 return bridge, nil
106}
107
108// LoadBridge instantiate a new bridge from a repo configuration
109func LoadBridge(repo *cache.RepoCache, name string) (*Bridge, error) {

Callers 2

NewBridgeFunction · 0.92
LoadBridgeFunction · 0.70

Calls 2

ErrorfMethod · 0.80
NewMethod · 0.45

Tested by

no test coverage detected