MCPcopy Create free account
hub / github.com/brimdata/super / GetPools

Function GetPools

db/api/api.go:86–101  ·  view source on GitHub ↗
(ctx context.Context, api Interface)

Source from the content-addressed store, hash-verified

84}
85
86func GetPools(ctx context.Context, api Interface) ([]*pools.Config, error) {
87 b := newBuffer(pools.Config{})
88 q, err := api.Query(ctx, srcfiles.Plain("from :pools"))
89 if err != nil {
90 return nil, err
91 }
92 defer q.Pull(true)
93 if err := vio.Copy(b, q); err != nil {
94 return nil, err
95 }
96 var pls []*pools.Config
97 for _, r := range b.results {
98 pls = append(pls, r.(*pools.Config))
99 }
100 return pls, nil
101}
102
103func LookupPoolByID(ctx context.Context, api Interface, id ksuid.KSUID) (*pools.Config, error) {
104 b := newBuffer(pools.Config{})

Callers 1

getPoolsFunction · 0.92

Calls 5

PlainFunction · 0.92
CopyFunction · 0.92
newBufferFunction · 0.70
QueryMethod · 0.65
PullMethod · 0.65

Tested by

no test coverage detected