Constructs a cache volume for a given cache key.
(key string, opts ...CacheVolumeOpts)
| 12319 | |
| 12320 | // Constructs a cache volume for a given cache key. |
| 12321 | func (r *Query) CacheVolume(key string, opts ...CacheVolumeOpts) *CacheVolume { |
| 12322 | q := r.query.Select("cacheVolume") |
| 12323 | for i := len(opts) - 1; i >= 0; i-- { |
| 12324 | // `source` optional argument |
| 12325 | if !querybuilder.IsZeroValue(opts[i].Source) { |
| 12326 | q = q.Arg("source", opts[i].Source) |
| 12327 | } |
| 12328 | // `sharing` optional argument |
| 12329 | if !querybuilder.IsZeroValue(opts[i].Sharing) { |
| 12330 | q = q.Arg("sharing", opts[i].Sharing) |
| 12331 | } |
| 12332 | // `owner` optional argument |
| 12333 | if !querybuilder.IsZeroValue(opts[i].Owner) { |
| 12334 | q = q.Arg("owner", opts[i].Owner) |
| 12335 | } |
| 12336 | } |
| 12337 | q = q.Arg("key", key) |
| 12338 | |
| 12339 | return &CacheVolume{ |
| 12340 | query: q, |
| 12341 | } |
| 12342 | } |
| 12343 | |
| 12344 | // Creates an empty changeset |
| 12345 | func (r *Query) Changeset() *Changeset { |
no test coverage detected