p

package module
v0.0.0-...-59ef1fd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

README

Google Cloud function for reading BigTable

This is a reference implementaion for getting data out of BigTable.

deploying

First deploy (creation) must include all the flags to configure the environment:

gcloud functions --project your-project deploy testnet --region europe-west3 --entry-point Entry --runtime go116 --trigger-http --allow-unauthenticated --service-account=your-readonly@your-project.iam.gserviceaccount.com --update-env-vars GCP_PROJECT=your-project,BIGTABLE_INSTANCE=wormhole-testnet

Subsequent deploys (updates) only need include flags to indentify the resource for updating: project, region, name.

gcloud functions --project your-project deploy testnet --region europe-west3 --entry-point Entry

invocation

All routes accept their input(s) as query parameters, or request body. Just two different ways of querying:

GET

curl "https://region-project-id.cloudfunctions.net/testnet/readrow?emitterChain=2&emitterAddress=000000000000000000000000e982e462b094850f12af94d21d470e21be9d0e9c&sequence=0000000000000006"

POST

curl -X POST  https://region-project-id.cloudfunctions.net/testnet/readrow \
-H "Content-Type:application/json" \
-d \
'{"emitterChain":"2", "emitterAddress":"000000000000000000000000e982e462b094850f12af94d21d470e21be9d0e9c", "sequence":"0000000000000006"}'

See ./bigtable-endpoints.md for API patterns

Documentation

Overview

Package p contains an HTTP Cloud Function.

Package p contains an HTTP Cloud Function.

Package p contains an HTTP Cloud Function.

Package p contains an HTTP Cloud Function.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Entry

func Entry(w http.ResponseWriter, r *http.Request)

Entry is the cloud function entry point

func ReadRow

func ReadRow(w http.ResponseWriter, r *http.Request)

fetch a single row by the row key

func Recent

func Recent(w http.ResponseWriter, r *http.Request)

fetch recent rows. optionally group by a EmitterChain or EmitterAddress optionally query for recent rows of a given EmitterChain or EmitterAddress

func Totals

func Totals(w http.ResponseWriter, r *http.Request)

get number of recent transactions in the last 24 hours, and daily for a period optionally group by a EmitterChain or EmitterAddress optionally query for recent rows of a given EmitterChain or EmitterAddress

func Transaction

func Transaction(w http.ResponseWriter, r *http.Request)

fetch a single row by transaction identifier

Types

type Details

type Details struct {
	SignedVAA      *vaa.VAA
	EmitterChain   string
	EmitterAddress string
	Sequence       string
	InitiatingTxID string
	Payload        []byte
	SignedVAABytes []byte
	QuorumTime     string
}

Details is a Summary, with the VAA decoded as SignedVAA

type Summary

type Summary struct {
	EmitterChain   string
	EmitterAddress string
	Sequence       string
	InitiatingTxID string
	Payload        []byte
	SignedVAABytes []byte
	QuorumTime     string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL