learning-cloud-native-go / myapp Goto Github PK
View Code? Open in Web Editor NEW๐ How to build a Dockerized RESTful API application using Go.
Home Page: https://learning-cloud-native-go.github.io
License: MIT License
๐ How to build a Dockerized RESTful API application using Go.
Home Page: https://learning-cloud-native-go.github.io
License: MIT License
If the log is created using .With().Caller(), the location printed using logger.Print() and logger.Printf() print the location of Print() and Printf() in logger.go. The following implentations fix this:
func (l *GwLogger) Print(v ...interface{}) {
l.logger.Debug().CallerSkipFrame(2).Msg(fmt.Sprint(v...))
}
func (l *GwLogger) Printf(format string, v ...interface{}) {
l.logger.Debug().CallerSkipFrame(2).Msgf(format, v...)
}
Implement OpenTelemetry Metrics and Tracing.
๐ก app/handler/handler.go
Use Wire for Compile-time Dependency Injection.
Support graceful shutdowns.
$ docker-compose up
Starting myapp_db_1 ... done
Starting myapp_app_1 ... done
Attaching to myapp_db_1, myapp_app_1
db_1 | [i] mysqld already present, skipping creation
db_1 | [i] MySQL data directory not found, creating initial DBs
db_1 | 2020-03-20 9:40:12 0 [ERROR] InnoDB: The Auto-extending innodb_system data file './ibdata1' is of a different size 0 pages than specified in the .cnf file: initial 768 pages, max 0 (relevant if non-zero) pages!
db_1 | 2020-03-20 9:40:12 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
app_1 | ERROR 2002 (HY000): Can't connect to MySQL server on 'db' (115)
app_1 | MySQL is unavailable - sleeping
db_1 | 2020-03-20 9:40:14 0 [ERROR] Plugin 'InnoDB' init function returned error.
db_1 | 2020-03-20 9:40:14 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
db_1 | 2020-03-20 9:40:14 0 [ERROR] Unknown/unsupported storage engine: InnoDB
db_1 | 2020-03-20 9:40:14 0 [ERROR] Aborting
It does this a few times, then repeats this message until stopped:
app_1 | ERROR 2002 (HY000): Can't connect to MySQL server on 'db' (115)
app_1 | MySQL is unavailable - sleeping
app_1 | ERROR 2002 (HY000): Can't connect to MySQL server on 'db' (115)
app_1 | MySQL is unavailable - sleeping
app_1 | ERROR 2002 (HY000): Can't connect to MySQL server on 'db' (115)
app_1 | MySQL is unavailable - sleeping
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.