Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractGCSPath ¶
ExtractGCSPath returns the path after the bucket name and gs:// scheme.
func GetBucketName ¶
GetBucketName tries to obtain the bucket name. Bucket names must contain the gs:// prefix to distinguish them as being GCP type buckets.
Types ¶
type AppHandler ¶
type AppHandler func(http.ResponseWriter, *http.Request) *AppError
func HealthCheckHandler ¶
func HealthCheckHandler() AppHandler
HealthCheckHandler ensures the base endpoint is available and can return an HTTP status code 200
func OCRBucketDirHandler ¶
func OCRBucketDirHandler(gCPVisionAPIServer *GCPVisionAPIServer) AppHandler
OCRBucketDirHandler performs the vision API operation on the entire bucket or dir provided
func OCRHandler ¶
func OCRHandler(gCPVisionAPIServer *GCPVisionAPIServer) AppHandler
OCRHandler handles POST requests that represent a basic request to perform OCR. A GCS file path and output path must be provided
func (AppHandler) ServeHTTP ¶
func (fn AppHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type FileInfoJSON ¶
type FileInfoJSON struct { // OutputURI represents the GCS URI to drop off the artifacts after processing. OutputURI string `json:"outputUri"` // OutputPath represents the internal bucket folder to use OutputPath string `json:"outputPath"` // InputURI represents the GCS URI of the data to be used InputURI string `json:"inputUri"` }
FileInfoJSON represents the POST from the client detailing the URI for the client. Once processed the items will be sent to the OutputURI. Both must be specified
type GCPVisionAPIServer ¶
GCPVisionAPIServer is the base server that handles all incoming requests. It is equipped with a router and a reference to Vision API
func (*GCPVisionAPIServer) Init ¶
func (g *GCPVisionAPIServer) Init() error
Init ensures all relevant clients are called and set up before requests can begin
func (*GCPVisionAPIServer) Routes ¶
func (g *GCPVisionAPIServer) Routes() *mux.Router
Routes returns a Handler that acts as a multiplexer. We use the gorilla.Mux router.
type Initializable ¶
type Initializable interface { // Init is used to initialize a given server with clients, environment variables and any other logic Init() error }
Initializable interface houses the Init method used for initializing types.