MCPcopy Index your code
hub / github.com/coder/coder / run

Function run

scripts/aibridgepricesgen/main.go:89–106  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

87}
88
89func run() error {
90 upstream, err := fetch()
91 if err != nil {
92 return xerrors.Errorf("fetch %s: %w", sourceURL, err)
93 }
94 rows, err := convert(upstream, supportedProviders)
95 if err != nil {
96 return err
97 }
98 if err := validate(rows); err != nil {
99 return err
100 }
101 if err := write(os.Stdout, rows); err != nil {
102 return err
103 }
104 _, _ = fmt.Fprintf(os.Stderr, "aibridgepricesgen: wrote %d prices for %d provider(s)\n", len(rows), len(supportedProviders))
105 return nil
106}
107
108func fetch() (map[string]upstreamProvider, error) {
109 ctx, cancel := context.WithTimeout(context.Background(), fetchTimeout)

Callers 1

mainFunction · 0.70

Calls 5

convertFunction · 0.85
fetchFunction · 0.70
validateFunction · 0.70
writeFunction · 0.70
ErrorfMethod · 0.45

Tested by

no test coverage detected