MCPcopy
hub / github.com/cortesi/devd / Add

Method Add

route.go:130–140  ·  view source on GitHub ↗

Add a route to the collection

(value string, notfound []string)

Source from the content-addressed store, hash-verified

128
129// Add a route to the collection
130func (f RouteCollection) Add(value string, notfound []string) error {
131 s, err := newRoute(value, notfound)
132 if err != nil {
133 return err
134 }
135 if _, exists := f[s.MuxMatch()]; exists {
136 return errors.New("Route already exists.")
137 }
138 f[s.MuxMatch()] = *s
139 return nil
140}

Callers 8

AddRoutesMethod · 0.80
addTempFileFunction · 0.80
TestRouteWatchFunction · 0.80
TestRouteCollectionFunction · 0.80
GenerateCertFunction · 0.80
copyHeaderFunction · 0.80
checkLastModifiedFunction · 0.80

Calls 2

newRouteFunction · 0.85
MuxMatchMethod · 0.45

Tested by 4

addTempFileFunction · 0.64
TestRouteWatchFunction · 0.64
TestRouteCollectionFunction · 0.64