Skip to content

DanielRenne/GoCore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Dec 23, 2022
bca2197 · Dec 23, 2022
Aug 13, 2022
Dec 23, 2022
Oct 5, 2022
Oct 10, 2022
Oct 10, 2022
Oct 3, 2022
Aug 13, 2022
Sep 24, 2019
Oct 14, 2019
May 13, 2018
Dec 23, 2022
Nov 13, 2022
Dec 23, 2022
Dec 23, 2022
Dec 23, 2022
Dec 23, 2022
Dec 23, 2022
Dec 23, 2022

Repository files navigation

GoCore

A Golang solution of tools for building a full stack web application.

Goals of the Project

Below are some targeted goals:


  • Database Goals. Provide Model/structs/ORM support and drivers for the following (only for use with GoCore full apps):
    • Supported databases:
      • MongoDB
      • BoltDB
    • Create SQL Schema (DDL) from JSON Configuration.
      • Generated golang structs and methods will also allow customization files to be injected inside your models/v1/model package
    • Create Golang ORM packages for RDBMS Transactions & Queries.
    • Create a bootstrapping system to seed data in various configurations and data dumping formats
    • Recursive Joins with foreign and primary keys in mongo or bolt.
    • A pubsub store (core/store) for mongo or bolt to allow for interfaces to subscribe to changes in the database or to save changes to the database with either golang or a javascript client.



  • Atomic file locking functions (on many common types) for file system operations on thread safe files in github.com/DanielRenne/GoCore/core/atomicTypes package
    • Adds a Get() and Set() method with a mutex lock to the following types:
      • AtomicString
      • AtomicUInt16
      • AtomicUInt32
      • AtomicByteArray
      • AtomicFloat64
      • AtomicBoolArray
      • AtomicBool (ToggleTrue returning if changed to true)
      • AtomicInt (Add, Increment, Decrement)

Get Started with GoCore

  1. To start a new project with go modules (after go 1.13) run the following steps in a new console window. Note, this just gets all packages indirectly and they will be removed in your app as you begin to use them.
go mod init yourProject/packageName

If you want to just play with all packages run:

go get github.com/DanielRenne/GoCore

Otherwise read the docs and see if anything adds value to your work and go get individual packages.

Build GoCore Backend Only Webserver app

There are three options to start a webserver. GoCoreLite (just a gin-gonic server with a gorilla websocket where you pass the port you wish), GoCoreFull ( which assumes usages of our model and ORM with mongo or boltDB ), or GoCoreCreateApp (full front-end examples with a backend webserver).

  • GoCore full docs are available at here

  • GoCoreLite full docs are available here

  • GoCoreCreateApp full docs are available here

FAQ

Why to I need to pass $(pwd) on go run?

This is because in many cases for a full GoCore web app, we need to read a webConfig.json in your current directory so that you dont compile configurations inside your main.go and developers and servers can be reconfigured without recompiling. Go will compile into a tmp directory and we dont know where your webConfig.json is located. Sure we could always enforce passing this file, but its easier to pass the current directory for go runs.

If you decide not to use the web server functionality and want to try out some other helper utilities outlined in our goals, our main documentation for the codebase located here: https://pkg.go.dev/github.com/DanielRenne/GoCore