Skip to content

Instantly share code, notes, and snippets.

View Rickcau's full-sized avatar

Rickcau Rickcau

View GitHub Profile
@Rickcau
Rickcau / main.go
Created November 7, 2018 00:06
Golang GoQuery is not returning the expected results
I am new to Golang as in two days new to it, so I am learning this as fast as I can, I applogize if I am overlooking a basic mistake.
I cannot seem to get a grip on how to best parse the HTML data. If you take a look at the below sample HTML and open it in VS Code, and search for table, tbody
you will find that HTML elements that I would like to start parsing at.
The idea in the below GoLang code is to use GoQuery to walk the DOM object. My first goal was to navigate down in the DOM to the table, then tbody, then tr and then
select the first 3 <td> elements below this, building an array filled with these 3 elements.
The goal is it end up with an array that looks like this:
@Rickcau
Rickcau / Readme.md
Last active February 26, 2023 17:39
Azure Function API with Cosmos DB Input Binding

HttpTrigger -Cosmos DB API

The HttpTrigger makes it incredibly easy to have your functions executed via an HTTP call to your function. This sample, exposes a function that can get call with an HTTP GET and it will return all Patients from Cosmos DB. It can be used to build a REST API that exposes CRUD operations. You can take this a step further by leveraging APIM. The idea is to create a serverless micro-service CRUD endpoint using Azure functions. This is a much faster way to create an API for backends than writing a Web App. If you need better performance just use the Premimum tier.

How it works