Constructs a cache volume for a given cache key.
(key string, opts ...CacheVolumeOpts)
| 12299 | |
| 12300 | // Constructs a cache volume for a given cache key. |
| 12301 | func (r *Query) CacheVolume(key string, opts ...CacheVolumeOpts) *CacheVolume { |
| 12302 | q := r.query.Select("cacheVolume") |
| 12303 | for i := len(opts) - 1; i >= 0; i-- { |
| 12304 | // `source` optional argument |
| 12305 | if !querybuilder.IsZeroValue(opts[i].Source) { |
| 12306 | q = q.Arg("source", opts[i].Source) |
| 12307 | } |
| 12308 | // `sharing` optional argument |
| 12309 | if !querybuilder.IsZeroValue(opts[i].Sharing) { |
| 12310 | q = q.Arg("sharing", opts[i].Sharing) |
| 12311 | } |
| 12312 | // `owner` optional argument |
| 12313 | if !querybuilder.IsZeroValue(opts[i].Owner) { |
| 12314 | q = q.Arg("owner", opts[i].Owner) |
| 12315 | } |
| 12316 | } |
| 12317 | q = q.Arg("key", key) |
| 12318 | |
| 12319 | return &CacheVolume{ |
| 12320 | query: q, |
| 12321 | } |
| 12322 | } |
| 12323 | |
| 12324 | // Creates an empty changeset |
| 12325 | func (r *Query) Changeset() *Changeset { |