Magic is a package containing implementation of common building blocks required when developing micro-services in go-lang.
The goal is to move all common functionality such as speaking with storage systems, performing leader election, checking the health of a micro-service, logging in text vs. JSON, etc. out of every micro-service's code base allowing the micro-service code to focus only on business logic.
go get github.com/tink3rlabs/magic@latest
Magic exposes multiple common functionalities each in it's own package.
This package contains everything needed to persist data in storage systems. For example to write data to an in-memory database you would instantiate the storage system as follows:
import (
"embed"
"fmt"
"github.com/google/uuid"
"github.com/tink3rlabs/magic/storage"
)
config := map[string]string{}
s, err := storage.StorageAdapterFactory{}.GetInstance(storage.MEMORY, config)
if err != nil {
fmt.Println(err)
}
fmt.Println(s.Ping())
storage.NewDatabaseMigration(s).Migrate()
See more detailed examples in the examples folder
TODO
TODO
TODO
TODO
TODO
Please see CONTRIBUTING. Thank you, contributors!
Released under the MIT License