Documentation
¶
Overview ¶
Package ocr contains Go samples for creating OCR (Optical Character Recognition) Cloud functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProcessImage ¶
ProcessImage is executed when a file is uploaded to the Cloud Storage bucket you created for uploading images. It runs detectText, which processes the image for text.
func SaveResult ¶
SaveResult is executed when a message is published to the Cloud Pub/Sub topic specified by the RESULT_TOPIC environment vairable, and saves the data packet to a file in GCS.
Types ¶
type MessagePublishedData ¶
type MessagePublishedData struct {
Message PubSubMessage
}
Eventarc sends a MessagePublishedData object. See the documentation for additional fields and more details: https://cloud.google.com/eventarc/docs/cloudevents#pubsub_1
type PubSubMessage ¶
type PubSubMessage struct {
Data []byte `json:"data"`
}
PubSubMessage is the payload of a Pub/Sub event. See the documentation for additional fields and more details: https://cloud.google.com/pubsub/docs/reference/rest/v1/PubsubMessage