Exemple #1
0
func (m *RepStdTypes) Size() (n int) {
	var l int
	_ = l
	if len(m.NullableTimestamps) > 0 {
		for _, e := range m.NullableTimestamps {
			l = github_com_maditya_protobuf_types.SizeOfStdTime(*e)
			n += 1 + l + sovStdtypes(uint64(l))
		}
	}
	if len(m.NullableDurations) > 0 {
		for _, e := range m.NullableDurations {
			l = github_com_maditya_protobuf_types.SizeOfStdDuration(*e)
			n += 1 + l + sovStdtypes(uint64(l))
		}
	}
	if len(m.Timestamps) > 0 {
		for _, e := range m.Timestamps {
			l = github_com_maditya_protobuf_types.SizeOfStdTime(e)
			n += 1 + l + sovStdtypes(uint64(l))
		}
	}
	if len(m.Durations) > 0 {
		for _, e := range m.Durations {
			l = github_com_maditya_protobuf_types.SizeOfStdDuration(e)
			n += 1 + l + sovStdtypes(uint64(l))
		}
	}
	return n
}
Exemple #2
0
func (m *MapStdTypes) Size() (n int) {
	var l int
	_ = l
	if len(m.NullableTimestamp) > 0 {
		for k, v := range m.NullableTimestamp {
			_ = k
			_ = v
			l = 0
			if v != nil {
				l = github_com_maditya_protobuf_types.SizeOfStdTime(*v)
				l += 1 + sovStdtypes(uint64(l))
			}
			mapEntrySize := 1 + sovStdtypes(uint64(k)) + l
			n += mapEntrySize + 1 + sovStdtypes(uint64(mapEntrySize))
		}
	}
	if len(m.Timestamp) > 0 {
		for k, v := range m.Timestamp {
			_ = k
			_ = v
			l = github_com_maditya_protobuf_types.SizeOfStdTime(v)
			mapEntrySize := 1 + sovStdtypes(uint64(k)) + 1 + l + sovStdtypes(uint64(l))
			n += mapEntrySize + 1 + sovStdtypes(uint64(mapEntrySize))
		}
	}
	if len(m.NullableDuration) > 0 {
		for k, v := range m.NullableDuration {
			_ = k
			_ = v
			l = 0
			if v != nil {
				l = github_com_maditya_protobuf_types.SizeOfStdDuration(*v)
				l += 1 + sovStdtypes(uint64(l))
			}
			mapEntrySize := 1 + sovStdtypes(uint64(k)) + l
			n += mapEntrySize + 1 + sovStdtypes(uint64(mapEntrySize))
		}
	}
	if len(m.Duration) > 0 {
		for k, v := range m.Duration {
			_ = k
			_ = v
			l = github_com_maditya_protobuf_types.SizeOfStdDuration(v)
			mapEntrySize := 1 + sovStdtypes(uint64(k)) + 1 + l + sovStdtypes(uint64(l))
			n += mapEntrySize + 1 + sovStdtypes(uint64(mapEntrySize))
		}
	}
	return n
}
Exemple #3
0
func (m *StdTypes) Size() (n int) {
	var l int
	_ = l
	if m.NullableTimestamp != nil {
		l = github_com_maditya_protobuf_types.SizeOfStdTime(*m.NullableTimestamp)
		n += 1 + l + sovStdtypes(uint64(l))
	}
	if m.NullableDuration != nil {
		l = github_com_maditya_protobuf_types.SizeOfStdDuration(*m.NullableDuration)
		n += 1 + l + sovStdtypes(uint64(l))
	}
	l = github_com_maditya_protobuf_types.SizeOfStdTime(m.Timestamp)
	n += 1 + l + sovStdtypes(uint64(l))
	l = github_com_maditya_protobuf_types.SizeOfStdDuration(m.Duration)
	n += 1 + l + sovStdtypes(uint64(l))
	return n
}
Exemple #4
0
func (m *OneofStdTypes_Timestamp) Size() (n int) {
	var l int
	_ = l
	if m.Timestamp != nil {
		l = github_com_maditya_protobuf_types.SizeOfStdTime(*m.Timestamp)
		n += 1 + l + sovStdtypes(uint64(l))
	}
	return n
}
Exemple #5
0
func _OneofStdTypes_OneofSizer(msg proto.Message) (n int) {
	m := msg.(*OneofStdTypes)
	// OneOfStdTimes
	switch x := m.OneOfStdTimes.(type) {
	case *OneofStdTypes_Timestamp:
		s := github_com_maditya_protobuf_types.SizeOfStdTime(*x.Timestamp)
		n += proto.SizeVarint(1<<3 | proto.WireBytes)
		n += proto.SizeVarint(uint64(s))
		n += s
	case *OneofStdTypes_Duration:
		s := github_com_maditya_protobuf_types.SizeOfStdDuration(*x.Duration)
		n += proto.SizeVarint(2<<3 | proto.WireBytes)
		n += proto.SizeVarint(uint64(s))
		n += s
	case nil:
	default:
		panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
	}
	return n
}