(ctx context.Context, opts ...UsageOpt)
| 179 | } |
| 180 | |
| 181 | func (i *image) Usage(ctx context.Context, opts ...UsageOpt) (int64, error) { |
| 182 | var config usageOptions |
| 183 | for _, opt := range opts { |
| 184 | if err := opt(&config); err != nil { |
| 185 | return 0, err |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | var usageOpts []usage.Opt |
| 190 | if config.manifestLimit != nil { |
| 191 | usageOpts = append(usageOpts, usage.WithManifestLimit(i.platform, *config.manifestLimit)) |
| 192 | } |
| 193 | if config.snapshots { |
| 194 | usageOpts = append(usageOpts, usage.WithSnapshotters(i.client.SnapshotService)) |
| 195 | } |
| 196 | if config.manifestOnly { |
| 197 | usageOpts = append(usageOpts, usage.WithManifestUsage()) |
| 198 | } |
| 199 | |
| 200 | return usage.CalculateImageUsage(ctx, i.i, i.client.ContentStore(), usageOpts...) |
| 201 | } |
| 202 | |
| 203 | func (i *image) Config(ctx context.Context) (ocispec.Descriptor, error) { |
| 204 | provider := i.client.ContentStore() |
nothing calls this directly
no test coverage detected