Documentation ¶
Overview ¶
Package intstr is a generated protocol buffer package.
It is generated from these files:
k8s.io/kubernetes/pkg/util/intstr/generated.proto
It has these top-level messages:
IntOrString
Index ¶
- Variables
- func DeepCopy_intstr_IntOrString(in IntOrString, out *IntOrString, c *conversion.Cloner) error
- func GetValueFromIntOrPercent(intOrPercent *IntOrString, total int, roundUp bool) (int, error)
- type IntOrString
- func (intstr *IntOrString) Fuzz(c fuzz.Continue)
- func (intstr *IntOrString) IntValue() int
- func (m *IntOrString) Marshal() (data []byte, err error)
- func (intstr IntOrString) MarshalJSON() ([]byte, error)
- func (m *IntOrString) MarshalTo(data []byte) (int, error)
- func (*IntOrString) ProtoMessage()
- func (m *IntOrString) Reset()
- func (m *IntOrString) Size() (n int)
- func (intstr *IntOrString) String() string
- func (m *IntOrString) Unmarshal(data []byte) error
- func (intstr *IntOrString) UnmarshalJSON(value []byte) error
- type Type
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow") )
Functions ¶
func DeepCopy_intstr_IntOrString ¶ added in v1.3.0
func DeepCopy_intstr_IntOrString(in IntOrString, out *IntOrString, c *conversion.Cloner) error
func GetValueFromIntOrPercent ¶
func GetValueFromIntOrPercent(intOrPercent *IntOrString, total int, roundUp bool) (int, error)
Types ¶
type IntOrString ¶
type IntOrString struct { Type Type `protobuf:"varint,1,opt,name=type,casttype=Type"` IntVal int32 `protobuf:"varint,2,opt,name=intVal"` StrVal string `protobuf:"bytes,3,opt,name=strVal"` }
IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number. TODO: Rename to Int32OrString
+gencopy=true +protobuf=true +protobuf.options.(gogoproto.goproto_stringer)=false
func FromInt ¶
func FromInt(val int) IntOrString
FromInt creates an IntOrString object with an int32 value. It is your responsibility not to call this method with a value greater than int32. TODO: convert to (val int32)
func FromString ¶
func FromString(val string) IntOrString
FromString creates an IntOrString object with a string value.
func (*IntOrString) Fuzz ¶
func (intstr *IntOrString) Fuzz(c fuzz.Continue)
func (*IntOrString) IntValue ¶
func (intstr *IntOrString) IntValue() int
IntValue returns the IntVal if type Int, or if it is a String, will attempt a conversion to int.
func (*IntOrString) Marshal ¶ added in v1.3.0
func (m *IntOrString) Marshal() (data []byte, err error)
func (IntOrString) MarshalJSON ¶
func (intstr IntOrString) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface.
func (*IntOrString) MarshalTo ¶ added in v1.3.0
func (m *IntOrString) MarshalTo(data []byte) (int, error)
func (*IntOrString) ProtoMessage ¶ added in v1.3.0
func (*IntOrString) ProtoMessage()
func (*IntOrString) Reset ¶ added in v1.3.0
func (m *IntOrString) Reset()
func (*IntOrString) Size ¶ added in v1.3.0
func (m *IntOrString) Size() (n int)
func (*IntOrString) String ¶
func (intstr *IntOrString) String() string
String returns the string value, or the Itoa of the int value.
func (*IntOrString) Unmarshal ¶ added in v1.3.0
func (m *IntOrString) Unmarshal(data []byte) error
func (*IntOrString) UnmarshalJSON ¶
func (intstr *IntOrString) UnmarshalJSON(value []byte) error
UnmarshalJSON implements the json.Unmarshaller interface.