MarshalObjToStruct
Marshals an object into a structpb.Struct. It uses jsonPb for proto messages and the standard JSON marshaler for other types.
def MarshalObjToStruct(
input: interface{}
) - > *structpb.Struct, error
Marshals an object into a struct. It uses jsonPb if the input is a proto message; otherwise, it uses the json marshaler.
Parameters
| Name | Type | Description |
|---|---|---|
| input | interface{} | The object to be marshaled into a struct. This can be a proto message or any other Go type that can be marshaled to JSON. |
Returns
| Type | Description |
|---|---|
*structpb.Struct, error | A pointer to a structpb.Struct representing the marshaled object, or an error if marshaling fails. |