michelaquino / golang_bigtable_example

Exemplo de integração com Bigtable usando Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Golang Bigtable Example

Exemplo de integração com Bigtable usando Go

Dependências

Como usar

  1. Inicie o emulador do Bigtable:

$ gcloud beta emulators bigtable start

  1. Exporte as variáveis de ambiente

$ export BIGTABLE_EMULATOR_HOST="localhost:8086" BIGTABLE_PROJECT_ID="local" BIGTABLE_INSTANCE_ID="local-instance"

  1. Configure o banco

$ make setup-db

  1. Rode os exemplos
$ make insert-one
$ make insert-conditional
$ make insert-batch
$ make read-one
$ make read-multiple
$ make read-partialKey
$ make delete

CBT

CBT é a interface em linha de comando para fazer algumas operações no Bigtable

https://cloud.google.com/bigtable/docs/cbt-overview

Comandos úteis

  • Listar tabelas:
$ cbt -project local -instance local-instance -admin-endpoint localhost:8086 -data-endpoint localhost:8086 ls
  • Ler uma tabela específica
$ cbt -project local -instance local-instance -admin-endpoint localhost:8086 -data-endpoint localhost:8086 read media_progress

About

Exemplo de integração com Bigtable usando Go

License:GNU General Public License v3.0


Languages

Language:Go 90.9%Language:Makefile 9.1%