saucepan

command module
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

README

sauce framework

The goal of this project is to provide framework for building enterprise grade applications by using independent components, instead of monolith cross-dependency architecture. There are certain benefits of this approach:

  • independent testing of components (unit testing)
  • ability to build application differently for each environment
  • ability to build different grade of applications based on the same code base.

This repository represents list of services, clients, servers that are using dependency injection framework beans. The best practices of building enterprise applications are collected in this framework. Each application should have single application context, that is inherited by single core context, that could derive multiple servers and one client context.

Application context

Basic application knowledge, like application name and version. Application flags and stateless application config with the set of supported commandline commands are here.

Core context

Base application services, that does not have external interfaces called Core. The initial list of them are ConfigService, DatabaseService, Storage and etc. Since sauce framework uses encrypted storage, during core context creation should be provided bootstrap token. For this purpose exist sauce.CoreScanner interface that provides list of beans for core context, which would inherit from application basic context.

Server context

Server network application practically can have multiple servers that possible to locate in one server context, or if application needs to separate TLS certificate creation or other server related instances then it is reasonable to use multiple server contexts. Especially, in case of separation of protected public API servers from unprotected internal API servers. Each server needs to know listening address, therefore there is a special interface for server scanner: sauce.ServerScanner which is provides beans and server context would inherit core context.

Client context

Since application could have multiple servers it is still possible to have a single client. Each client needs to know the address to connect, therefore there is a special interface for client scanner: sauce.ClientScanner which is provides beans and client context would inherit application basic context.

ApplicationContext -> [Core Context, Client Context...]
Core Context -> [Server Context...]
Build
go install github.com/codeallergy/go-bindata@v1.0.1
go install github.com/google/go-licenses@v1.2.1
Configure (linux):
./sauce gen
./sauce create
./sauce config set autoupdate on

Download and install Protoc 3.13 for your OS (optional)

open https://github.com/protocolbuffers/protobuf/releases/tag/v3.19.4

Install protoc golang compiler

go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.27

Install gRPC compiler

go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2.0

Install gRPC gateway

go get -u github.com/grpc-ecosystem/grpc-gateway
git checkout v2.7.3

Compile and install protoc-gen-grpc-gateway

cd ~/go/src/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
go install

Compile and install protoc-gen-openapiv2

cd ~/go/src/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-openapiv2
go install

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
app
assets
Package assets Code generated by go-bindata.
Package assets Code generated by go-bindata.
assetsgz
Package assetsgz Code generated by go-bindata.
Package assetsgz Code generated by go-bindata.
client
* Copyright (c) 2022-2023 Zander Schwid & Co.
* Copyright (c) 2022-2023 Zander Schwid & Co.
cmd
* Copyright (c) 2022-2023 Zander Schwid & Co.
* Copyright (c) 2022-2023 Zander Schwid & Co.
core/dns
* Copyright (c) 2022-2023 Zander Schwid & Co.
* Copyright (c) 2022-2023 Zander Schwid & Co.
core/nat
* Copyright (c) 2022-2023 Zander Schwid & Co.
* Copyright (c) 2022-2023 Zander Schwid & Co.
resources
Package resources Code generated by go-bindata.
Package resources Code generated by go-bindata.

Jump to

Keyboard shortcuts

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