DefaultProtobufStore
Implements ProtobufStore to marshal and unmarshal protobufs to/from a RawStore
Methods
ReadProtobuf()
@classmethod
def ReadProtobuf(
ctx: context.Context,
reference: [DataReference](datareference.md?sid=flytestdlib_storage_datareference),
msg: proto.Message
) - > error
Reads a protobuf message from the store using the provided reference and unmarshals it into the given message object.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the operation, allowing for cancellation and timeouts. |
| reference | [DataReference](datareference.md?sid=flytestdlib_storage_datareference) | The reference identifying the location of the protobuf data to be read. |
| msg | proto.Message | The protobuf message object into which the read data will be unmarshaled. |
Returns
| Type | Description |
|---|---|
error | An error if the read or unmarshaling fails, otherwise nil. |
WriteProtobuf()
@classmethod
def WriteProtobuf(
ctx: context.Context,
reference: [DataReference](datareference.md?sid=flytestdlib_storage_datareference),
opts: [Options](../../flyteplugins/go/tasks/pluginmachinery/k8s/options.md?sid=flyteplugins_go_tasks_pluginmachinery_k8s_options),
msg: proto.Message
) - > error
Writes a protobuf message to the store using the provided reference and options, marshaling the message into raw data.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the operation, allowing for cancellation and timeouts. |
| reference | [DataReference](datareference.md?sid=flytestdlib_storage_datareference) | The reference identifying the location where the protobuf data will be written. |
| opts | [Options](../../flyteplugins/go/tasks/pluginmachinery/k8s/options.md?sid=flyteplugins_go_tasks_pluginmachinery_k8s_options) | Options controlling the write operation, such as consistency levels or metadata. |
| msg | proto.Message | The protobuf message object to be marshaled and written to the store. |
Returns
| Type | Description |
|---|---|
error | An error if the marshaling or write operation fails, otherwise nil. |