MCPcopy Create free account
hub / github.com/docker/cli / getData

Method getData

cli/context/store/tlsstore.go:37–46  ·  view source on GitHub ↗
(name, endpointName, filename string)

Source from the content-addressed store, hash-verified

35}
36
37func (s *tlsStore) getData(name, endpointName, filename string) ([]byte, error) {
38 data, err := os.ReadFile(filepath.Join(s.endpointDir(name, endpointName), filename))
39 if err != nil {
40 if os.IsNotExist(err) {
41 return nil, notFound(fmt.Errorf("TLS data for %s/%s/%s does not exist", name, endpointName, filename))
42 }
43 return nil, fmt.Errorf("failed to read TLS data for endpoint %s: %w", endpointName, err)
44 }
45 return data, nil
46}
47
48// remove deletes all TLS data for the given context.
49func (s *tlsStore) remove(name string) error {

Callers 2

GetTLSDataMethod · 0.80

Calls 2

endpointDirMethod · 0.95
notFoundFunction · 0.70

Tested by 1