MCPcopy Create free account
hub / github.com/cloudreve/cloudreve / ListActiveNodes

Method ListActiveNodes

inventory/node.go:55–61  ·  view source on GitHub ↗
(ctx context.Context, subset []int)

Source from the content-addressed store, hash-verified

53}
54
55func (c *nodeClient) ListActiveNodes(ctx context.Context, subset []int) ([]*ent.Node, error) {
56 stm := c.client.Node.Query().Where(node.StatusEQ(node.StatusActive))
57 if len(subset) > 0 {
58 stm = stm.Where(node.IDIn(subset...))
59 }
60 return stm.All(ctx)
61}
62
63func (c *nodeClient) GetNodeByIds(ctx context.Context, ids []int) ([]*ent.Node, error) {
64 return withNodeEagerLoading(ctx, c.client.Node.Query().Where(node.IDIn(ids...))).All(ctx)

Callers

nothing calls this directly

Calls 5

StatusEQFunction · 0.92
IDInFunction · 0.92
WhereMethod · 0.45
QueryMethod · 0.45
AllMethod · 0.45

Tested by

no test coverage detected