(ctx context.Context, name string, withContent bool)
| 100 | } |
| 101 | |
| 102 | func (c *Client) GetAllowList(ctx context.Context, name string, withContent bool) (*ent.AllowList, error) { |
| 103 | q := c.Ent.AllowList.Query().Where(allowlist.NameEQ(name)) |
| 104 | if withContent { |
| 105 | q = q.WithAllowlistItems() |
| 106 | } |
| 107 | |
| 108 | result, err := q.First(ctx) |
| 109 | if err != nil { |
| 110 | if ent.IsNotFound(err) { |
| 111 | return nil, fmt.Errorf("allowlist '%s' not found", name) |
| 112 | } |
| 113 | |
| 114 | return nil, err |
| 115 | } |
| 116 | |
| 117 | return result, nil |
| 118 | } |
| 119 | |
| 120 | func (c *Client) GetAllowListByID(ctx context.Context, allowlistID string, withContent bool) (*ent.AllowList, error) { |
| 121 | q := c.Ent.AllowList.Query().Where(allowlist.AllowlistIDEQ(allowlistID)) |
no test coverage detected