Git Product home page Git Product logo

go_db_2023's Introduction

GO_DB_2023

Experiments with GoLang:

  1. Database + Domain
  2. Database singleton client connection
  3. Worker Pooling
  4. Client-Server
  5. SSL
  6. Web server go routines

Installation, Setup, and Use

Go, etc.

GCC (and make):

  1. Install via MSYS2 on Windows. MSYS2 still seems to be the best Windows Linux tools distribution around (2022). Will install a Linux terminal and add itself to Environment Variables automatically. Will come bundled with pacman.
  2. I'd recommend the toolchain: pacman -S mingw-w64-x86_64-toolchain
  3. You'll still need to add the gcc dir to the Environment Variables (C:\msys64\mingw64\bin) PATH.

If you run into pacman PGP key trust errors per this:

pacman-key --init
pacman-key --populate msys2
pacman-key --refresh-keys

Think the code repositories rotate keys every 3 months or so. Make sure to update those!

Execute the following commands to grab all the Go dependencies manually:

  1. go clean && go clean -modcache
  2. go get github.com/gofrs/uuid

For a valid self-signed SSL:

  1. openssl genrsa -out key.pem 2048
  2. openssl req -new -sha256 -key key.pem -out csr.csr
  3. openssl req -x509 -sha256 -days 365 -key key.pem -in csr.csr -out certificate.pem

Navigate to ./goserver:

  1. go run httpsServer.go

You should see:

=================== POLLING EVERY 5s ===================
=================== POLLING EVERY 5s ===================
=================== POLLING EVERY 5s ===================
2023/02/02 16:55:38 http: TLS handshake error from [::1]:60797: remote error: tls: unknown certificate
2023/02/02 16:55:40 http: TLS handshake error from [::1]:60802: remote error: tls: unknown certificate
=================== POLLING EVERY 5s ===================
=================== POLLING EVERY 5s ===================
=================== POLLING EVERY 5s ===================
=================== POLLING EVERY 5s ===================

Views and API Endpoints

  1. https://localhost/public/
  2. https://localhost/public/queryworker.html
  3. https://localhost/public/querystatus.html
  4. https://localhost/public/querystatuses.html
  5. https://localhost/public/addworker.html
  6. https://localhost/public/stopworker.html
  7. https://localhost/api/examples

go_db_2023's People

Contributors

thoughtscript avatar

Watchers

 avatar

go_db_2023's Issues

Question: regarding Singleton DB

Does the DB init maintain a connection across Go routines (does it reinitialize by Go routine).

Think it does not keep it open (reinitializes by Go routine presently), the Go routine will close clearing it’s stack, calling defer close(). Want to verify this.

Add a comment to DB.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.