vitess.io/vitess@v0.16.2/go/vt/srvtopo/cached_size.go (about) 1 /* 2 Copyright 2021 The Vitess Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 // Code generated by Sizegen. DO NOT EDIT. 17 18 package srvtopo 19 20 type cachedObject interface { 21 CachedSize(alloc bool) int64 22 } 23 24 func (cached *ResolvedShard) CachedSize(alloc bool) int64 { 25 if cached == nil { 26 return int64(0) 27 } 28 size := int64(0) 29 if alloc { 30 size += int64(24) 31 } 32 // field Target *vitess.io/vitess/go/vt/proto/query.Target 33 size += cached.Target.CachedSize(true) 34 // field Gateway vitess.io/vitess/go/vt/srvtopo.Gateway 35 if cc, ok := cached.Gateway.(cachedObject); ok { 36 size += cc.CachedSize(true) 37 } 38 return size 39 }