MCPcopy Create free account
hub / github.com/evcc-io/evcc / StringGetter

Method StringGetter

plugin/http.go:230–250  ·  view source on GitHub ↗

StringGetter sends string request

()

Source from the content-addressed store, hash-verified

228
229// StringGetter sends string request
230func (p *HTTP) StringGetter() (func() (string, error), error) {
231 return func() (string, error) {
232 if p.mu != nil {
233 p.mu.Lock()
234 defer p.mu.Unlock()
235 }
236
237 url, err := setFormattedValue(p.url, "", "")
238 if err != nil {
239 return "", err
240 }
241
242 b, err := p.request(url, p.body)
243
244 if err == nil && p.pipeline != nil {
245 b, err = p.pipeline.Process(b)
246 }
247
248 return string(b), err
249 }, nil
250}
251
252func (p *HTTP) set(param string, val any) error {
253 url, err := setFormattedValue(p.url, param, val)

Callers 3

TestGetMethod · 0.95
TestCacheGetMethod · 0.95
TestCacheGetNoStoreMethod · 0.95

Calls 5

requestMethod · 0.95
setFormattedValueFunction · 0.85
LockMethod · 0.80
UnlockMethod · 0.80
ProcessMethod · 0.80

Tested by 3

TestGetMethod · 0.76
TestCacheGetMethod · 0.76
TestCacheGetNoStoreMethod · 0.76