Skip to content

Commit

Permalink
Merge remote-tracking branch 'new/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
1995parham committed Apr 1, 2024
2 parents 721dcdd + 2dd2f52 commit 24fd6a3
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 13 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Created by https://www.toptal.com/developers/gitignore/api/go
# Edit at https://www.toptal.com/developers/gitignore?templates=go

Expand Down
14 changes: 7 additions & 7 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007

Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

Expand Down Expand Up @@ -631,8 +631,8 @@ to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

{one line to give the program's name and a brief idea of what it does.}
Copyright (C) {year} {name of author}
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -645,14 +645,14 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

{project} Copyright (C) {year} {fullname}
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
Expand All @@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
<https://www.gnu.org/licenses/>.

The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
<https://www.gnu.org/licenses/why-not-lgpl.html>.
89 changes: 84 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,63 @@
<h1 align="center"> Learning Go for Internet Engineering </h1>
<h1 align="center"> Learning Go </h1>

<p align="center">
<img alt="banner" src="./.github/assets/banner.jpg" height="200px" />
</p>

## Introduction

This repository contains sample codes for introducing people to Go.
C background is **required** for learning Go.
> Learn to develop cloud-native programs with Go!
## Outline
The Golang programming language is very similar to the C programming language,
and its purpose is to reduce complexity in program development.
This language is widely used to implement web servers, applications, and container management tools.
Among the tools that have been developed with this language are:

- [Kubernetes](https://github.com/kubernetes/kubernetes)
- [Docker](https://github.com/moby/moby)
- [NATS](https://github.com/nats-io/nats-server)
- [Prometheus](https://github.com/prometheus/prometheus)

In the last few years, this language has opened its place in Iranian companies,
and it is used for the development of backend services.

> C background is **required** for learning Go.
## Outline (As a separate course)

- History
- Variables and constants
- Calculation
- Conditions
- Loops
- Functions
- Strings
- Arrays and slices
- `map`
- `struct`
- `interface`
- Pointers
- Errors
- Concurrency and channels
- `select`
- `go mod` and using packages
- An overview of advanced features
- Introduction to HTTP protocol
- HTTP server implementation
- Settings management paragraph
- Metric, Log and Tracing
- connection with the database using PostgreSQL and GORM
- Introduction to Docker and containerization

At the beginning of the course, an introduction to the Go language is made and students implement simple programs with it.
Since the implementation of web servers is one of the important uses of the Go programming language,
we will review the structure of the HTTP protocol and then implement a simple web server in Go.
In this implementation, we try to familiarize ourselves with the structure of large programs created in Go and review details such as
Configuration or Metrics, which are of great value in real systems.
Finally, a MongoDB and PostgreSQL databases are added to this web server,
the purpose of which is to familiarize students with database interfaces in the Go.

## Outline (As a part of internet engineering course)

Using Go for design and implementing servers contains two major steps.
First is about learning Go itself and another step is learning an HTTP framework (here we go with Echo).
Expand Down Expand Up @@ -53,4 +101,35 @@ Reviewing these source codes are useful for learning Go but there aren't enough.

## Continue your journey

You can visit [go101](https://github.com/1995parham-learning/go101) which contains some more advance concepts of Golang.
You can visit [go101](https://github.com/1995parham-learning/go101) which contains
some more advance concepts of Golang.

## Review Me

One of the main steps in learning new language and its best practices is reviewing
written projects:

- <https://github.com/1995parham/koochooloo>:

- In the first step, you need to review the project structure and find out how modules are related
- Then we continue with running the docker-compose to have the requirements
- And in the final step, we lunch the application and trying it with curl based on its swagger
- This project use zap as a logger and pass it into its modules also each module
has its metrics based on [otel](https://github.com/open-telemetry/).

- <https://github.com/1995parham/fandogh>:

- This example containing the migration and how we store things on the [MongoDB](https://www.mongodb.com/) database.

- <https://github.com/1995parham/saf>:

- This example shows tracing in action with [NATS](https://nats.io/) as a message queue.
- Also, We can use profiler to see how replacing [Echo](https://echo.labstack.com/) with [GoFiber](https://gofiber.io/) increase the performance.
- This project has Helm chart and after knowing Kubernetes basis we can lunch it on the cloud with its Helm.

- <https://github.com/1995parham/k1s>:
- In the first step, we review the server structure. The server is stateless and only returns simple responses.
- We it on the cloud with its manifests
- using server and ingress to send requests and see how they distributed between instances
- We also see how we can mount configuration on Kubernetes with [configmap](https://kubernetes.io/docs/concepts/configuration/configmap/).
> > > > > > > new/main

0 comments on commit 24fd6a3

Please sign in to comment.