Documentation
¶
Index ¶
- func ConvertFromValue(to, from any, opts ...Option) (any, error)
- func ConvertListToValue(li protopatch.List, opts ...Option) (*structpb.Value, error)
- func ConvertMapToValue(ma protopatch.Map, opts ...Option) (*structpb.Value, error)
- func ConvertMessageToValue(m proto.Message, opts ...Option) (*structpb.Value, error)
- func ConvertToValue(to, from any, opts ...Option) (any, error)
- func FromValueConverter(opts ...Option) protopatch.Converter
- func ToValueConverter(opts ...Option) protopatch.Converter
- func ValueContainerTransform(container protopatch.Container, opts ...Option) (protopatch.Container, error)
- func ValueContainerTransformer(opts ...Option) protopatch.ContainerTransformer
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertFromValue ¶
ConvertFromValue attempts to convert structpb.Value (or a value that is part of structpb.Value, like structpb.NullValue, structpb.Struct, structpb.ListValue, float64, string or bool) to appropriate proto type.
func ConvertListToValue ¶
func ConvertMapToValue ¶
func ConvertMessageToValue ¶
func ConvertToValue ¶
ConvertToValue attempts to convert the given proto type value into structpb.Value (or a value that is part of structpb.Value, like structpb.NullValue, structpb.Struct, structpb.ListValue, float64, string or bool).
func FromValueConverter ¶
func FromValueConverter(opts ...Option) protopatch.Converter
FromValueConverter returns a converter that attempts to convert structpb.Value (or a value that is part of structpb.Value, like structpb.NullValue, structpb.Struct, structpb.ListValue, float64, string or bool) to appropriate proto type.
func ToValueConverter ¶
func ToValueConverter(opts ...Option) protopatch.Converter
ToValueConverter returns a converter that attempts to convert the given proto type value into structpb.Value (or a value that is part of structpb.Value, like structpb.NullValue, structpb.Struct, structpb.ListValue, float64, string or bool).
func ValueContainerTransform ¶
func ValueContainerTransform(container protopatch.Container, opts ...Option) (protopatch.Container, error)
func ValueContainerTransformer ¶
func ValueContainerTransformer(opts ...Option) protopatch.ContainerTransformer
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func ClearInvalidValues ¶
func ClearInvalidValues() Option
ClearInvalidValues returns option that clears from the source structure each inner value which type do not matches.
func ClearUnknownKeys ¶
func ClearUnknownKeys() Option
ClearUnknownKeys returns option that clears from the source structure each inner unknown key when converting from structpb.Struct to proto.Message or when parsing a map key fails.
func IgnoreInvalidValues ¶
func IgnoreInvalidValues() Option
IgnoreInvalidValues returns option that ignores each inner source value which type do not matches.
func IgnoreUnknownKeys ¶
func IgnoreUnknownKeys() Option
IgnoreUnknownKeys returns option that ignores unknown keys when converting from structpb.Struct to proto.Message or when parsing a map key fails.