Documentation ¶
Index ¶
- func ForEachRange(totalSize int, maxSubRangeSize int, handler func(from, to int) error) error
- func GetFieldTypeForOneOf(protoMsg proto.Message, fieldDesc preflect.FieldDescriptor) (reflect.StructField, bool)
- func GetValueFromProtoPath(msg proto.Message, rawPath string) (interface{}, bool)
- func GetValuesFromProtoPath(msg proto.Message, rawPath string) ([]interface{}, bool, error)
- func IsNil(v interface{}) bool
- func JsonMarshal(v interface{}) ([]byte, error)
- func SetFieldPathValueToProtoMsg(target proto.Message, rawPath string, v any)
- func SetFieldValueToProtoMsg(target proto.Message, fieldDesc preflect.FieldDescriptor, v any)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ForEachRange ¶ added in v0.4.39
ForEachRange is simple utility calling given function for each sub-range defined within [0-totalSize]. It wont be called however if range is empty. For example, MakeRanges(35, 10, fc) will result in fc being called 4 times with arguments: * 0-10 * 10-20 * 20-30 * 30-35 It can be used to split slice into smaller ones. Params totalSize must not be less than 0, maxSubRangeSize must be bigger than 0. If those are not met, function panics. If given function returns error, iteration stops and ForEachRange returns that error
func GetFieldTypeForOneOf ¶ added in v0.9.2
func GetFieldTypeForOneOf(protoMsg proto.Message, fieldDesc preflect.FieldDescriptor) (reflect.StructField, bool)
func GetValueFromProtoPath ¶ added in v1.0.0
func GetValuesFromProtoPath ¶ added in v1.0.4
func JsonMarshal ¶
func SetFieldPathValueToProtoMsg ¶ added in v1.0.0
func SetFieldValueToProtoMsg ¶ added in v1.0.0
func SetFieldValueToProtoMsg(target proto.Message, fieldDesc preflect.FieldDescriptor, v any)
Types ¶
This section is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.