separation of data, added new roadmap prototype

pull/70/head
A-HK 2023-03-05 17:07:34 +05:30
rodzic ceb6f4a022
commit 8cc8c091b9
7 zmienionych plików z 993 dodań i 419 usunięć

181
package-lock.json wygenerowano
Wyświetl plik

@ -7,6 +7,9 @@
"": {
"name": "learndb",
"version": "1.0.0",
"dependencies": {
"svelvet": "^6.0.12"
},
"devDependencies": {
"@rgossiaux/svelte-headlessui": "^1.0.2",
"@rgossiaux/svelte-heroicons": "^0.1.2",
@ -836,6 +839,42 @@
"node": ">=4"
}
},
"node_modules/d3-color": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz",
"integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==",
"engines": {
"node": ">=12"
}
},
"node_modules/d3-dispatch": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-3.0.1.tgz",
"integrity": "sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg==",
"engines": {
"node": ">=12"
}
},
"node_modules/d3-drag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-3.0.0.tgz",
"integrity": "sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg==",
"dependencies": {
"d3-dispatch": "1 - 3",
"d3-selection": "3"
},
"engines": {
"node": ">=12"
}
},
"node_modules/d3-ease": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz",
"integrity": "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==",
"engines": {
"node": ">=12"
}
},
"node_modules/d3-hierarchy": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/d3-hierarchy/-/d3-hierarchy-3.1.2.tgz",
@ -845,6 +884,66 @@
"node": ">=12"
}
},
"node_modules/d3-interpolate": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz",
"integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==",
"dependencies": {
"d3-color": "1 - 3"
},
"engines": {
"node": ">=12"
}
},
"node_modules/d3-selection": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz",
"integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==",
"engines": {
"node": ">=12"
}
},
"node_modules/d3-timer": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-3.0.1.tgz",
"integrity": "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==",
"engines": {
"node": ">=12"
}
},
"node_modules/d3-transition": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-3.0.1.tgz",
"integrity": "sha512-ApKvfjsSR6tg06xrL434C0WydLr7JewBB3V+/39RMHsaXTOG0zmt/OAXeng5M5LBm0ojmxJrpomQVZ1aPvBL4w==",
"dependencies": {
"d3-color": "1 - 3",
"d3-dispatch": "1 - 3",
"d3-ease": "1 - 3",
"d3-interpolate": "1 - 3",
"d3-timer": "1 - 3"
},
"engines": {
"node": ">=12"
},
"peerDependencies": {
"d3-selection": "2 - 3"
}
},
"node_modules/d3-zoom": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/d3-zoom/-/d3-zoom-3.0.0.tgz",
"integrity": "sha512-b8AmV3kfQaqWAuacbPuNbL6vahnOJflOhexLzMMNLga62+/nh0JzvJ0aO/5a5MVgUFGS7Hu1P9P03o3fJkDCyw==",
"dependencies": {
"d3-dispatch": "1 - 3",
"d3-drag": "2 - 3",
"d3-interpolate": "1 - 3",
"d3-selection": "2 - 3",
"d3-transition": "2 - 3"
},
"engines": {
"node": ">=12"
}
},
"node_modules/debug": {
"version": "4.3.4",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
@ -1814,6 +1913,14 @@
}
}
},
"node_modules/svelvet": {
"version": "6.0.12",
"resolved": "https://registry.npmjs.org/svelvet/-/svelvet-6.0.12.tgz",
"integrity": "sha512-Y+4JMnd5tUTlIUwgmsZ96alU9TsUEkYKk/NNPpTiPLVjjtsI2WVy9iLh0CAg+ubsD9ZbvUzO71bjzZywLQe94A==",
"dependencies": {
"d3-zoom": "^3.0.0"
}
},
"node_modules/tailwindcss": {
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.2.4.tgz",
@ -2561,12 +2668,78 @@
"integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==",
"dev": true
},
"d3-color": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz",
"integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA=="
},
"d3-dispatch": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-3.0.1.tgz",
"integrity": "sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg=="
},
"d3-drag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-3.0.0.tgz",
"integrity": "sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg==",
"requires": {
"d3-dispatch": "1 - 3",
"d3-selection": "3"
}
},
"d3-ease": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz",
"integrity": "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w=="
},
"d3-hierarchy": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/d3-hierarchy/-/d3-hierarchy-3.1.2.tgz",
"integrity": "sha512-FX/9frcub54beBdugHjDCdikxThEqjnR93Qt7PvQTOHxyiNCAlvMrHhclk3cD5VeAaq9fxmfRp+CnWw9rEMBuA==",
"dev": true
},
"d3-interpolate": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz",
"integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==",
"requires": {
"d3-color": "1 - 3"
}
},
"d3-selection": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz",
"integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ=="
},
"d3-timer": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-3.0.1.tgz",
"integrity": "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA=="
},
"d3-transition": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-3.0.1.tgz",
"integrity": "sha512-ApKvfjsSR6tg06xrL434C0WydLr7JewBB3V+/39RMHsaXTOG0zmt/OAXeng5M5LBm0ojmxJrpomQVZ1aPvBL4w==",
"requires": {
"d3-color": "1 - 3",
"d3-dispatch": "1 - 3",
"d3-ease": "1 - 3",
"d3-interpolate": "1 - 3",
"d3-timer": "1 - 3"
}
},
"d3-zoom": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/d3-zoom/-/d3-zoom-3.0.0.tgz",
"integrity": "sha512-b8AmV3kfQaqWAuacbPuNbL6vahnOJflOhexLzMMNLga62+/nh0JzvJ0aO/5a5MVgUFGS7Hu1P9P03o3fJkDCyw==",
"requires": {
"d3-dispatch": "1 - 3",
"d3-drag": "2 - 3",
"d3-interpolate": "1 - 3",
"d3-selection": "2 - 3",
"d3-transition": "2 - 3"
}
},
"debug": {
"version": "4.3.4",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
@ -3208,6 +3381,14 @@
"strip-indent": "^3.0.0"
}
},
"svelvet": {
"version": "6.0.12",
"resolved": "https://registry.npmjs.org/svelvet/-/svelvet-6.0.12.tgz",
"integrity": "sha512-Y+4JMnd5tUTlIUwgmsZ96alU9TsUEkYKk/NNPpTiPLVjjtsI2WVy9iLh0CAg+ubsD9ZbvUzO71bjzZywLQe94A==",
"requires": {
"d3-zoom": "^3.0.0"
}
},
"tailwindcss": {
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.2.4.tgz",

Wyświetl plik

@ -14,15 +14,18 @@
"@rgossiaux/svelte-heroicons": "^0.1.2",
"@sveltejs/pancake": "^0.0.18",
"@sveltejs/vite-plugin-svelte": "^2.0.2",
"autoprefixer": "^10.4.7",
"d3-hierarchy": "^3.1.2",
"marked": "^4.2.4",
"svelte": "^3.55.0",
"svelte-bricks": "^0.1.7",
"vite": "^4.0.3",
"postcss": "^8.4.14",
"postcss-load-config": "^4.0.1",
"svelte": "^3.55.0",
"svelte-bricks": "^0.1.7",
"svelte-preprocess": "^4.10.7",
"autoprefixer": "^10.4.7",
"tailwindcss": "^3.1.5"
"tailwindcss": "^3.1.5",
"vite": "^4.0.3"
},
"dependencies": {
"svelvet": "^6.0.12"
}
}

Wyświetl plik

@ -12,6 +12,7 @@
import Settings from "./Settings.svelte"
import Roadmap from "./Roadmap.svelte"
import RoadmapList from "./RoadmapList.svelte"
import RoadmapAlt from './RoadmapAlt.svelte';
import NavButtonWithLabel from './NavButtonWithLabel.svelte';
import { SearchIcon, LibraryIcon, ViewGridIcon, GiftIcon, CogIcon, BookmarkAltIcon, BookmarkIcon, SupportIcon, MapIcon } from "@rgossiaux/svelte-heroicons/outline";
@ -82,6 +83,8 @@
<Roadmap topic={currentView.split("/")[2]}/>
{:else if currentView.startsWith("/roadmaps")}
<RoadmapList/>
{:else if currentView.startsWith("/roadmap-alternate/")}
<RoadmapAlt topic={currentView.split("/")[2]}/>
{/if}

Wyświetl plik

@ -1,6 +1,7 @@
<script>
import { marked } from "marked";
import { roadmap_progress } from "./stores.js"
import { roadmap_data } from "./roadmap_data.js"
const renderer = new marked.Renderer();
const linkRenderer = renderer.link;
@ -29,496 +30,142 @@
const roadmaps = {
programming_in_golang: {
start: {label: "Computer & Internet Basics"},
start: {label: `${roadmap_data.start.label}`},
blocks: [
{
label: "Learn Golang Basics",
label: `${roadmap_data.blocks[0].label}`,
left: [
{
label: "Basic Syntax",
desc: `
# Basic Syntax
Learn about the basic syntax of Go, such as how the go programs are executed, package imports, main function, and so on. Visit the resources listed below
### Resources:
- READ: [Go Tutorial: Getting started](https://go.dev/doc/tutorial/getting-started)
- READ: [Go by Example: Hello World](https://gobyexample.com/hello-world)
- READ: [W3schools : Go Syntax](https://www.w3schools.com/go/go_syntax.php)
`
label: `${roadmap_data.blocks[0].group1[0].label}`,
desc: `${roadmap_data.blocks[0].group1[0].desc}`
},
{
label: "Variables and declaration",
desc: `
# Variables in Go
Variable is the name given to a memory location to store a value of a specific [type](https://golangbot.com/types/). Go provides multiple ways to declare and use variables.
### Resources:
- READ: [Go Variables](https://go.dev/tour/basics/8)
- READ: [Go by Example: Variables](https://gobyexample.com/variables)
- READ: [w3schools Go variables](https://www.w3schools.com/go/go_variables.php)
`
label: `${roadmap_data.blocks[0].group1[1].label}`,
desc: `${roadmap_data.blocks[0].group1[1].desc}`
},
{
label: "Data types",
desc: `
# Data Types
Go is a statically typed programming language, which means each variable has a type defined at first and can only hold values with that type. There are two categories of types in Go: basics types and composite types.
To learn more about types in Go, visit these resources :
### Resources:
- READ: [Basic data types](https://www.w3schools.com/go/go_data_types.php)
- READ: [Tour of Go: types](https://go.dev/tour/basics/11)
- READ: [Go types with examples](https://golangbyexample.com/all-data-types-in-golang-with-examples/)
`
label: `${roadmap_data.blocks[0].group1[2].label}`,
desc: `${roadmap_data.blocks[0].group1[2].desc}`
},
],
middle: [
{
label: "Conditional statements: if, switch",
desc: `
# Conditional Statements
Conditional statements are used to run code only if a certain condition is true; go supports :
- \`if\` statements
- \`if / else\` statements
- \`switch\` \`case\` statements
### Resources:
- READ: [Effective Go: if statement](https://go.dev/doc/effective_go#if)
- READ: [Basic conditional patterns](https://yourbasic.org/golang/if-else-statement/)
- READ: [Go by Example: If-Else](https://gobyexample.com/if-else)
- READ: [Golang programs if else](https://www.golangprograms.com/golang-if-else-statements.html)
- READ: [Golang programs switch case](https://www.golangprograms.com/golang-switch-case-statements.html)
`
label: `${roadmap_data.blocks[0].group2[0].label}`,
desc: `${roadmap_data.blocks[0].group2[0].desc}`
},
{
label: "Looping: for, range",
desc: `
# For Loop
Go has only one looping construct, the \`for\` loop. The basic \`for\` loop has three components separated by semicolons:
- the init statement: executed before the first iteration
- the condition expression: evaluated before every iteration
- the post statement: executed at the end of every iteration
### Resources:
- READ: [For Loop in Golang](https://go.dev/tour/flowcontrol/1)
- READ: [Effective Go: For loop](https://go.dev/doc/effective_go#for)
- READ: [Go by Example: For loop](https://gobyexample.com/for)
- READ: [5 basic for loop patterns](https://yourbasic.org/golang/for-loop/)
# Range
\`Range\` is used with \`For Loops\` to iterate over each element in arrays, strings and other data structures .
### Resources:
- READ: [Go Ranges](https://go.dev/tour/moretypes/16)
- READ: [Go by Example: Range](https://gobyexample.com/range)
- READ: [Go ranges basic patterns](https://yourbasic.org/golang/for-loop-range-array-slice-map-channel/)
`
label: `${roadmap_data.blocks[0].group2[1].label}`,
desc: `${roadmap_data.blocks[0].group2[1].desc}`
},
{
label: "Errors, Panic, Recover",
desc: `
# Errors/Panic/Recover
In lieu of adding exception handlers, the Go creators exploited Gos ability to return multiple values. The most commonly used Go technique for issuing errors is to return the error as the last value in a return.
A panic typically means something went unexpectedly wrong. Mostly used to fail fast on errors that shouldnt occur during normal operation, or that we arent prepared to handle gracefully.
Panic recovery in Go depends on a feature of the language called deferred functions. Go has the ability to guarantee the execution of a function at the moment its parent function returns. This happens regardless of whether the reason for the parent functions return is a return statement, the end of the function block, or a panic.
### Resources:
- READ: [Error handling and Go](https://go.dev/blog/error-handling-and-go)
- READ: [Go Defer, Panic and Recover](https://go.dev/blog/defer-panic-and-recover)
- READ: [Effective error handling in Go](https://earthly.dev/blog/golang-errors/)
`
label: `${roadmap_data.blocks[0].group2[2].label}`,
desc: `${roadmap_data.blocks[0].group2[2].desc}`
},
],
right: [
{
label: "Functions, multiple/named returns",
desc: `
# Functions
Discover how functions work in Go, the list of resources below will cover :
- How to define and call functions in Go?
- Named returns in Go?
- Handle multiple return types.
- Different types of functions in Go.
### Resources:
- READ: [Go by Example: Functions](https://gobyexample.com/functions)
- READ: [Functions in go](https://www.golangprograms.com/go-language/functions.html)
`
label:`${roadmap_data.blocks[0].group3[0].label}`,
desc: `${roadmap_data.blocks[0].group3[0].desc}`
},
{
label: "Packages, imports and exports",
desc: `
# Packages
Packages are the most powerful part of the Go language. The purpose of a package is to design and maintain a large number of programs by grouping related features together into single units so that they can be easy to maintain and understand and independent of the other package programs. This modularity allows them to share and reuse. In Go language, every package is defined with a different name and that name is close to their functionality like “strings” package and it contains methods and functions that only related to strings.
### Resources:
- READ: [How to create a package in Go](https://www.golang-book.com/books/intro/11)
- READ: [How to manage external dependencies in Go](https://go.dev/doc/modules/managing-dependencies)
- EXPLORE: [Go Packages explorer](https://pkg.go.dev/)
- Official Website: [Standard library](https://pkg.go.dev/std)
- READ: [Packages in Golang](https://www.geeksforgeeks.org/packages-in-golang/)
- READ: [Go Packages](https://www.programiz.com/golang/packages)
`
label:`${roadmap_data.blocks[0].group3[1].label}`,
desc: `${roadmap_data.blocks[0].group3[1].desc}`
},
{
label: "Type casting, Type inference",
desc: `
# Type Casting
Go doesn't support automatic type conversion, but it allows type casting, which is the process of explicitly changing the variable type. To learn more about typecasting, visit these resources :
### Resources:
- READ: [Geeks for Geeks: Type casting](https://www.geeksforgeeks.org/type-casting-or-type-conversion-in-golang/)
- READ: [Tour of Go: Type Casting Basics](https://go.dev/tour/basics/13)
- READ: [Go Docs: Type Casting](https://golangdocs.com/type-casting-in-golang)
# Type Inference
Type inference gives go the capability to detect the type of a value without being explicitly indicated , hence the possibility to declare variables without providing its type at first
### Resources:
- READ: [Go Variables: Type Inference](https://www.callicoder.com/golang-variables-zero-values-type-inference/#type-inference)
- READ: [Tour of Go: Type Inference](https://go.dev/tour/basics/14)
`
label: `${roadmap_data.blocks[0].group3[2].label}`,
desc: `${roadmap_data.blocks[0].group3[2].desc}`
},
{
label: "Arrays, Slices, Maps",
desc: `
# Arrays
In Go an \`array\` is a collection of elements of the same type with a **fixed** size defined when the array is created.
### Resources:
- Official Website: [Go Arrays](https://go.dev/tour/moretypes/6)
- READ: [Effective Go: Arrays](https://go.dev/doc/effective_go#arrays)
- WATCH: [Learn Go Programming - Arrays (by freeCodeCamp on YouTube)](https://youtu.be/YS4e4q9oBaU?t=6473)
# Slices
Slices are similar to arrays but are more powerful and flexible. Like arrays, slices are also used to store multiple values of the same type in a single variable. However, unlike arrays, the length of a slice can grow and shrink as you see fit.
### Resources:
- Official Website: [Go Slices](https://go.dev/tour/moretypes/7)
- READ: [Effective Go: Slices](https://go.dev/doc/effective_go#slices)
- READ: [Slices in Go](https://www.w3schools.com/go/go_slices.php)
- WATCH: [Learn Go Programming - Slices (by freeCodeCamp on YouTube)](https://youtu.be/YS4e4q9oBaU?t=6473)
# Maps
Maps are the data structure in Go, where we use whenever we want to have mappings between key:value pairs. They have flexibility in terms of removing or adding elements into them. Maps do not allow duplicate entries while data are kept unordered.
### Resources:
- Official Website: [Go Maps](https://go.dev/tour/moretypes/19)
- READ: [Effective Go: Maps](https://go.dev/doc/effective_go#maps)
- READ: [Maps in Go](https://www.w3schools.com/go/go_maps.php)
- WATCH: [Golang Tutorial #15 - Maps (by Tech With Tim on YouTube)](https://www.youtube.com/watch?v=yJE2RC37BF4)
`
label: `${roadmap_data.blocks[0].group3[3].label}`,
desc: `${roadmap_data.blocks[0].group3[3].desc}`
},
{
label: "make(), structs",
desc: `
# Make
Golang's built-in function make, helps us create and initialize slices, maps and channels, depending on the arguments that are provided to the function.
### Resources:
- READ: [Effective Go: Allocation with make](https://go.dev/doc/effective_go#allocation_make)
- READ: [Create a slice with make](https://www.golangprograms.com/how-to-create-slice-using-make-function-in-golang.html)
- READ: [Create a map with make](https://www.golangprograms.com/golang-package-examples/how-to-create-map-using-the-make-function-in-go.html)
- READ: [Create a channel with make](https://www.programiz.com/golang/channel#channel)
# Structs
Structs are user-defined types that help us create a collection of data describing a single entity.
### Resources:
- Official Website: [Go Structs](https://go.dev/tour/moretypes/2)
- READ: [Go by Example: Structs](https://gobyexample.com/structs)
- WATCH: [Structs in Go](https://www.youtube.com/watch?v=NMTN543WVQY)
`
label: `${roadmap_data.blocks[0].group3[4].label}`,
desc: `${roadmap_data.blocks[0].group3[4].desc}`
},
]
},
{
label: "Go Deeper",
label: `${roadmap_data.blocks[1].label}`,
left: [
{
label: "Go Modules",
desc: `
# Modules
Go modules are a group of related packages that are versioned and distributed together. They specify the requirements of our project, list all the required dependencies, and help us keep track of the specific versions of installed dependencies.
Modules are identified by a module path that is declared in the first line of the go.mod file in our project.
### Resources:
- Official Website: [Go Modules](https://go.dev/blog/using-go-modules)
- WATCH: [Go Modules](https://www.youtube.com/watch?v=9cV1KESTJRc)
- READ: [DigitalOcean: How to use Go Modules](https://www.digitalocean.com/community/tutorials/how-to-use-go-modules)
- WATCH: [Go Modules Explained in 5 Minutes (by Golang Dojo on YouTube)](https://youtu.be/7xSxIwWJ9R4)
- READ: [How to create a module in Go](https://go.dev/doc/tutorial/create-module)
- READ: [How to use modules in Go](https://go.dev/blog/using-go-modules)
- READ: [How to modify existing projects to use Go modules](https://jfrog.com/blog/converting-projects-for-go-modules/)
`
label: `${roadmap_data.blocks[1].group1[0].label}`,
desc: `${roadmap_data.blocks[1].group1[0].desc}`
},
{
label: "Marshalling and unmarshalling JSON",
desc: `
# Working with json
JSON (JavaScript Object Notation) is a simple data interchange format. Syntactically it resembles the objects and lists of JavaScript. It is most commonly used for communication between web back-ends and JavaScript programs running in the browser, but it is used in many other places, too.
### Resources:
- Official Website: [JSON](https://go.dev/blog/json)
- READ: [Guide to JSON in Golang](https://www.sohamkamani.com/golang/json/)
- READ: [JSON to GO](https://mholt.github.io/json-to-go/)
`
label: `${roadmap_data.blocks[1].group1[1].label}`,
desc: `${roadmap_data.blocks[1].group1[1].desc}`
},
],
middle: [
{
label: "Types, type assertions, switches",
desc: `
# Types and type assertions
Type assertions in Golang provide access to the exact type of variable of an interface.
### Resources:
- Official Website: [Types Assertions](https://go.dev/tour/methods/15)
- READ: [Type Assertion](https://www.geeksforgeeks.org/type-assertions-in-golang/)
`
label: `${roadmap_data.blocks[1].group2[0].label}`,
desc: `${roadmap_data.blocks[1].group2[0].desc}`
},
{
label: "Interfaces, context",
desc: `
# Interfaces
An interface in Go, is a type that defines a set of methods. If we have a type (e.g. struct) that implements that set of methods, then we have a type that implements this interface.
### Resources:
- Official Website: [Go Interfaces](https://go.dev/tour/methods/9)
- READ: [Effective Go: Interfaces](https://go.dev/doc/effective_go#interfaces)
- READ: [Go by Example: Interfaces](https://gobyexample.com/interfaces)
- WATCH: [Golang Tutorial #22 - Interfaces (by Tech With Tim on YouTube)](https://www.youtube.com/watch?v=lh_Uv2imp14)
- WATCH: [Learn Go Interfaces](https://www.youtube.com/watch?v=KB3ysH8cupY)
- WATCH: [Understanding Go Interfaces](https://www.youtube.com/watch?v=qJKQZKGZgf0)
# Context
The \`context\` package provides a standard way to solve the problem of managing the state during a request. The package satisfies the need for request-scoped data and provides a standardized way to handle: Deadlines, Cancellation Signals, etc.
### Resources:
- Official Website: [Go Context](https://pkg.go.dev/context)
- READ: [Go by Example: Context](https://gobyexample.com/context)
- READ: [Digital Ocean: How to Use Contexts in Go](https://www.digitalocean.com/community/tutorials/how-to-use-contexts-in-go)
- WATCH: [Context in Go](https://www.youtube.com/watch?v=LSzR0VEraWw)
- WATCH: [Understanding Contexts in Go](https://youtu.be/h2RdcrMLQAo)
`
label: `${roadmap_data.blocks[1].group2[1].label}`,
desc: `${roadmap_data.blocks[1].group2[1].desc}`
},
],
right: [
{
label: "Goroutines, channels",
desc: `
# Goroutines
Goroutines allow us to write concurrent programs in Go. Things like web servers handling thousands of requests or a website rendering new pages while also concurrently making network requests are a few example of concurrency.
In Go, each of these concurrent tasks are called \`Goroutines\`.
### Resources:
- Official Website: [Goroutines](https://go.dev/tour/concurrency/1)
- READ: [Effective Go: Goroutines](https://go.dev/doc/effective_go#goroutines)
- READ: [Goroutines in Golang](https://www.geeksforgeeks.org/goroutines-concurrency-in-golang)
- WATCH: [GoRoutines](https://www.youtube.com/watch?v=LvgVSSpwND8)
- WATCH: [Understanding Concurrency](https://www.youtube.com/watch?v=V-0ifUKCkBI)
- READ: [Go by Example: Goroutines](https://gobyexample.com/goroutines)
- WATCH: [Golang Goroutine Basics You MUST Learn! (by Golang Dojo on YouTube)](https://youtu.be/oHIbeTmmTaA)
# Channels
Channels are the pipes that connect concurrent goroutines. You can send values into channels from one goroutine and receive those values into another goroutine.
Channels are a typed conduit through which you can send and receive values with the channel operator, \`<-\` .
### Resources:
- Official Website: [Channels](https://go.dev/tour/concurrency/2)
- READ: [Effective Go: Channels](https://go.dev/doc/effective_go#channels)
- READ: [Go by Example: Channels](https://gobyexample.com/channels)
- READ: [Channels in Golang](https://golangbot.com/channels/)
- WATCH: [Channels](https://www.youtube.com/watch?v=e4bu9g-bYtg)
- READ: [GeeksForGeeks: Channel in Golang](https://www.geeksforgeeks.org/channel-in-golang/)
- WATCH: [Golang Channel Basics You must Know!](https://youtu.be/LgCmPHqAuf4)
`
label: `${roadmap_data.blocks[1].group3[0].label}`,
desc: `${roadmap_data.blocks[1].group3[0].desc}`
},
{
label: "Buffer, Select",
desc: `
# Buffer
The \`buffer\` belongs to the byte package of the Go language, and we can use these package to manipulate the byte of the string.
### Resources:
- Official Website: [Buffer Examples](https://pkg.go.dev/bytes#example-Buffer)
- READ: [Buffer](https://www.educba.com/golang-buffer/)
- WATCH: [Buffers in Golang](https://www.youtube.com/watch?v=NoDRq6Twkts)
# Select
The \`select\` statement lets a goroutine wait on multiple communication operations.
A \`select\` blocks until one of its cases can run, then it executes that case. It chooses one at random if multiple are ready. The \`select\` statement is just like switch statement, but in the select statement, case statement refers to communication, i.e. sent or receive operation on the channel.
### Resources:
- Official Website: [Select](https://go.dev/tour/concurrency/5)
- READ: [Go by Example: Select](https://gobyexample.com/select)
- READ: [Select in Golang](https://www.geeksforgeeks.org/select-statement-in-go-language/)
- WATCH: [Select Statement](https://www.youtube.com/watch?v=1c7ttSJDMAI)
`
label: `${roadmap_data.blocks[1].group3[1].label}`,
desc: `${roadmap_data.blocks[1].group3[1].desc}`
},
{
label: "Mutex",
desc: `
# Mutex
Go allows us to run code concurrently using goroutines. However, when concurrent processes access the same piece of data, it can lead to [race conditions](https://www.sohamkamani.com/golang/data-races/). Mutexes are data structures provided by the [sync](https://pkg.go.dev/sync/) package. They can help us place a lock on different sections of data so that only one goroutine can access it at a time.
- READ: [Using a Mutex in Go with Examples](https://www.sohamkamani.com/golang/mutex/)
`
label: `${roadmap_data.blocks[1].group3[2].label}`,
desc: `${roadmap_data.blocks[1].group3[2].desc}`
},
]
},
{
label: "Applications",
label: `${roadmap_data.blocks[2].label}`,
left: [
{
label: "Logging",
desc: `
# Logging
Go has built-in features to make it easier for programmers to implement logging. Third parties have also built additional tools to make logging easier.
### Resources:
- READ: [Logging in Go: Choosing a System and Using it](https://www.honeybadger.io/blog/golang-logging/)
- READ: [Logging in Golang – How to Start](https://www.loggly.com/use-cases/logging-in-golang-how-to-start/)
`
label: `${roadmap_data.blocks[2].group1[0].label}`,
desc: `${roadmap_data.blocks[2].group1[0].desc}`
},
{
label: "Building CLIs",
desc: `
# Building CLI Applications
Command line interfaces (CLIs), unlike graphical user interfaces (GUIs), are text-only. Cloud and infrastructure applications are primarily CLI-based due to their easy automation and remote capabilities.
Go applications are built into a single self contained binary making installing Go applications trivial; specifically, programs written in Go run on any system without requiring any existing libraries, runtimes, or dependencies. And programs written in Go have an immediate startup time—similar to C or C++ but unobtainable with other programming languages.
### Resources:
- READ: [Command-line Interfaces (CLIs)](https://go.dev/solutions/clis)
`
label: `${roadmap_data.blocks[2].group1[1].label}`,
desc: `${roadmap_data.blocks[2].group1[1].desc}`
},
],
middle: [
{
label: "ORMs",
desc: `
# ORMs
Object–relational mapping (ORM, O/RM, and O/R mapping tool) in computer science is a programming technique for converting data between type systems using object-oriented programming languages. This creates, in effect, a "virtual object database", hence a layer of abstraction, that can be used from within the programming language.
Most common ORM library in Go is [GORM](https://gorm.io/).
`
label: `${roadmap_data.blocks[2].group2[0].label}`,
desc: `${roadmap_data.blocks[2].group2[0].desc}`
},
{
label: "Web frameworks",
desc: `
# Web Frameworks
There are several famous web frameworks for Go. Most common ones being:
* Beego
* Gin
* Revel
* Echo
### Resources:
- READ: [Comparison of Web Frameworks](https://github.com/diyan/go-web-framework-comparison)
`
label: `${roadmap_data.blocks[2].group2[1].label}`,
desc: `${roadmap_data.blocks[2].group2[1].desc}`
},
],
right: [
{
label: "Real time communication",
desc: `
# Real time communication
Work in progress.
`
label: `${roadmap_data.blocks[2].group3[0].label}`,
desc: `${roadmap_data.blocks[2].group3[0].desc}`
},
{
label: "API Clients",
desc: `
# API Clients
An API client is a set of tools and protocols that operate from an application on a computer. They help you to bypass some operations when developing a web application rather than reinventing the wheel every time. Using a client API is a great way to speed up the development process.
### Resources:
- READ: [API Clients](https://rapidapi.com/blog/api-glossary/client/)
`
label: `${roadmap_data.blocks[2].group3[1].label}`,
desc: `${roadmap_data.blocks[2].group3[1].desc}`
},
{
label: "Tools for Microservices",
desc: `
# Microservices
Microservices are an architectural approach to software development that allows the creation of a distributed application from deployable services that allow communication through a well-defined API. Being a solution to monoliths.
### Resources:
- READ: [Introduction to microservices](https://developer.ibm.com/learningpaths/get-started-application-modernization/intro-microservices/introduction/)
- READ: [Microservice Patterns and Resources by Chris Richardson](https://microservices.io/index.html)
- READ: [Microservices AntiPatterns and Pitfalls - Mark Richards](https://www.oreilly.com/content/microservices-antipatterns-and-pitfalls/)
- READ: [Building Microservices, 2nd Edition - Sam Newman](https://samnewman.io/books/building_microservices_2nd_edition/)
`
label: `${roadmap_data.blocks[2].group3[2].label}`,
desc: `${roadmap_data.blocks[2].group3[2].desc}`
},
]
},
],
edges: [
{path: "M 10,30 A 20,20 0,0,1 50,30 A 20,20 0,0,1 90,30 Q 90,60 50,90 Q 10,60 10,30 z", style: "primary"},
{path: "M 10,10 L 90,90 V 10 H 50", style: "secondary"},
],
end: {label: "Now go make cool things with Golang!"}
end: {label: `${roadmap_data.end.label}`}
},
};
@ -526,7 +173,9 @@ Microservices are an architectural approach to software development that allows
</script>
<h1 class="text-xl md:text-4xl font-extrabold mb-8">{topic.split('_').map(capitalize).join(' ')}</h1>
<span>
<h1 class="inline-block text-xl md:text-4xl font-extrabold mb-8">{topic.split('_').map(capitalize).join(' ')}</h1>
</span>
<div class="">
{#if roadmap}
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox={`0 -130 1000 ${blockHeight*roadmap.blocks.length+300}`} style="font-family: balsamiq">
@ -577,7 +226,7 @@ Microservices are an architectural approach to software development that allows
<g>
<rect
class="secondary"
fill={$roadmap_progress[topic] && $roadmap_progress[topic][sec.label] == 'done' ? '#ccc' : 'rgb(252, 252, 179)'}
fill={$roadmap_progress[topic] && $roadmap_progress[topic][sec.label] == 'done' ? '#ccc' : 'rgb(255,229,153)'}
x={20} y={30+blockHeight*i+50*j} rx={5}
on:click={e => selectedNode = sec}
width={250}
@ -597,7 +246,7 @@ Microservices are an architectural approach to software development that allows
<g>
<rect
class="secondary"
fill={$roadmap_progress[topic] && $roadmap_progress[topic][sec.label] == 'done' ? '#ccc' : 'rgb(252, 252, 179)'}
fill={$roadmap_progress[topic] && $roadmap_progress[topic][sec.label] == 'done' ? '#ccc' : 'rgb(255,229,153)'}
on:click={e => selectedNode = sec}
x={350} y={140+blockHeight*i+50*j} rx={5}
width={250}
@ -617,7 +266,7 @@ Microservices are an architectural approach to software development that allows
<g>
<rect
class="secondary"
fill={$roadmap_progress[topic] && $roadmap_progress[topic][sec.label] == 'done' ? '#ccc' : 'rgb(252, 252, 179)'}
fill={$roadmap_progress[topic] && $roadmap_progress[topic][sec.label] == 'done' ? '#ccc' : 'rgb(255,229,153)'}
on:click={e => selectedNode = sec}
x={720} y={30+blockHeight*i+50*j} rx={5}
width={250}

Wyświetl plik

@ -0,0 +1,243 @@
<script>
import Svelvet from "svelvet";
import { roadmap_data } from "./roadmap_data";
import { new_roadmap } from "./stores.js"
import { marked } from "marked";
import { roadmap_progress } from "./stores.js"
const renderer = new marked.Renderer();
const linkRenderer = renderer.link;
renderer.link = (href, title, text) => {
const localLink = href.startsWith(`${location.protocol}//${location.hostname}`);
const html = linkRenderer.call(renderer, href, title, text);
return localLink ? html : html.replace(/^<a /, `<a target="_blank" rel="noreferrer noopener nofollow" `);
};
export let topic;
const capitalize = s => s && s[0].toUpperCase() + s.slice(1);
const blockHeight = 400;
const nodeHeight = 50;
const nodeWidth = 250;
let roadmap_edit = false;
function saveProgress(topic, item, status){
let newobj = {};
newobj = Object.assign(newobj, $roadmap_progress)
if(!newobj[topic]) newobj[topic] = {};
newobj[topic][item] = status;
roadmap_progress.set(newobj)
}
let selectedNode;
$: roadmap = roadmap_data[topic];
const initialNodes = [
{
id: 1,
position: { x: 240, y: 50 },
data: { label: roadmap_data.start.label },
width: 200,
height: 60,
bgColor: "white",
childNodes: [2, 3, 4]
},
{
id: 2,
position: { x: 40, y: 250 },
data: { label: roadmap_data.blocks[0].label},
width: 175,
height: 40,
bgColor: "white",
childNodes: [5]
},
{
id: 3,
position: { x: 240, y: 250 },
data: { label: roadmap_data.blocks[1].label},
width: 175,
height: 40,
bgColor: "white",
},
{
id: 4,
position: { x: 440, y: 250 },
data: { label: roadmap_data.blocks[2].label},
width: 175,
height: 40,
bgColor: "white",
},
{
id: 5,
position: { x: 40, y: 350 },
data: { label: "Section 1"},
width: 175,
height: 40,
bgColor: "white",
childNodes: [8, 9, 10]
},
{
id: 6,
position: { x: 40, y: 600 },
data: { label: "Section 2"},
width: 175,
height: 40,
bgColor: "white",
childNodes: [11, 12, 13]
},
{
id: 7,
position: { x: 40, y: 850 },
data: { label: "Section 3", desc: `test`},
width: 175,
height: 40,
bgColor: "white",
childNodes: [14, 15, 16]
},
{
id: 8,
position: { x: 40, y: 400 },
data: { label: roadmap_data.blocks[0].group1[0].label, desc: roadmap_data.blocks[0].group1[0].desc},
width: 175,
height: 40,
bgColor: "white",
clickCallback: node => selectedNode = node.id,
},
{
id: 9,
position: { x: 40, y: 450 },
data: { label: roadmap_data.blocks[0].group1[1].label, desc: roadmap_data.blocks[0].group1[1].desc},
width: 175,
height: 40,
bgColor: "white",
clickCallback: node => selectedNode = node.id,
},
{
id: 10,
position: { x: 40, y: 500 },
data: { label: roadmap_data.blocks[0].group1[2].label, desc: roadmap_data.blocks[0].group1[2].desc},
width: 175,
height: 40,
bgColor: "white",
clickCallback: node => selectedNode = node.id,
},
{
id: 11,
position: { x: 40, y: 650 },
data: { label: roadmap_data.blocks[0].group2[0].label, desc: roadmap_data.blocks[0].group2[0].desc},
width: 175,
height: 40,
bgColor: "white",
clickCallback: node => selectedNode = node.id,
},
{
id: 12,
position: { x: 40, y: 700 },
data: { label: roadmap_data.blocks[0].group2[1].label, desc: roadmap_data.blocks[0].group2[1].desc},
width: 175,
height: 40,
bgColor: "white",
clickCallback: node => selectedNode = node.id,
},
{
id: 13,
position: { x: 40, y: 750 },
data: { label: roadmap_data.blocks[0].group2[2].label, desc: roadmap_data.blocks[0].group2[1].desc},
width: 175,
height: 40,
bgColor: "white",
clickCallback: node => selectedNode = node.id,
},
{
id: 14,
position: { x: 40, y: 900 },
data: { label: roadmap_data.blocks[0].group3[0].label, desc: roadmap_data.blocks[0].group3[0].desc},
width: 175,
height: 40,
bgColor: "white",
clickCallback: node => selectedNode = node.id,
},
{
id: 15,
position: { x: 40, y: 950 },
data: { label: roadmap_data.blocks[0].group3[1].label}, desc: roadmap_data.blocks[0].group3[1].desc,
width: 175,
height: 40,
bgColor: "white",
clickCallback: node => selectedNode = node.id,
},
{
id: 16,
position: { x: 40, y: 1000 },
data: { label: roadmap_data.blocks[0].group3[2].label, desc: roadmap_data.blocks[0].group3[2].desc},
width: 175,
height: 40,
bgColor: "white",
clickCallback: node => selectedNode = node.id,
},
];
const initialEdges = [
{ id: "e1-2", source: 1, target: 2, label: roadmap_data.blocks[0].label},
{ id: "e1-3", source: 1, target: 3, label: roadmap_data.blocks[1].label},
{ id: "e1-4", source: 1, target: 4, label: roadmap_data.blocks[2].label},
{ id: "e2-5", source: 2, target: 5},
{ id: "e2-6", source: 2, target: 6},
{ id: "e2-7", source: 2, target: 7},
{ id: "5-8", source: 5, target: 8},
{ id: "5-9", source: 5, target: 9},
{ id: "5-10", source: 5, target: 10},
{ id: "6-11", source: 6, target: 11},
{ id: "6-12", source: 6, target: 12},
{ id: "6-13", source: 6, target: 13},
{ id: "7-14", source: 7, target: 14},
{ id: "7-15", source: 7, target: 15},
{ id: "7-16", source: 7, target: 16},
// { id: "e4-11", source: 4, target: 11},
// { id: "e4-12", source: 4, target: 12},
// { id: "e4-13", source: 4, target: 13},
];
new_roadmap.set(initialNodes)
</script>
<button class="inline-block py-2 px-6 bg-gray-800 text-white rounded-lg absolute right-2" on:click={()=>roadmap_edit = true}>{'Enable Editing'}</button>
<div class="w-full margin-auto flex items-center justify-center">
<Svelvet
width={1000}
height={1200}
nodes={initialNodes}
edges={initialEdges}
movement={false}
nodeCreate={roadmap_edit}
editable={roadmap_edit}
background
/>
</div>
<span>
</span>
<sl-drawer open={selectedNode} class="drawer-overview" style="--size: 50vw;">
{#if selectedNode}
{#if $roadmap_progress[topic] && $roadmap_progress[topic][selectedNode.label] === 'done'}
<sl-button variant="danger" on:click={e => saveProgress(topic, selectedNode.label, 'pending')}>Mark as Pending</sl-button>
{:else}
<sl-button variant="success" on:click={e => saveProgress(topic, selectedNode.label, 'done')}>Mark as Done</sl-button>
{/if}
<div class="mt-8 prose">
{@html marked(selectedNode? initialNodes[selectedNode-1].data.desc : "", { renderer })}
</div>
{/if}
<sl-button slot="footer" variant="primary" on:click={e => selectedNode = null}>Close</sl-button>
</sl-drawer>

493
src/roadmap_data.js 100644
Wyświetl plik

@ -0,0 +1,493 @@
export const roadmap_data = {
start: {label: "Computer and Internet Basics"},
blocks: [
{
label: "Learn Golang Basics",
group1: [
{
label: "Basic Syntax",
desc: `
# Basic Syntax
Learn about the basic syntax of Go, such as how the go programs are executed, package imports, main function, and so on. Visit the resources listed below
### Resources:
- READ: [Go Tutorial: Getting started](https://go.dev/doc/tutorial/getting-started)
- READ: [Go by Example: Hello World](https://gobyexample.com/hello-world)
- READ: [W3schools : Go Syntax](https://www.w3schools.com/go/go_syntax.php)
`
},
{
label: "Variables and declaration",
desc: `
# Variables in Go
Variable is the name given to a memory location to store a value of a specific [type](https://golangbot.com/types/). Go provides multiple ways to declare and use variables.
### Resources:
- READ: [Go Variables](https://go.dev/tour/basics/8)
- READ: [Go by Example: Variables](https://gobyexample.com/variables)
- READ: [w3schools Go variables](https://www.w3schools.com/go/go_variables.php)
`
},
{
label: "Data types",
desc: `
# Data Types
Go is a statically typed programming language, which means each variable has a type defined at first and can only hold values with that type. There are two categories of types in Go: basics types and composite types.
To learn more about types in Go, visit these resources :
### Resources:
- READ: [Basic data types](https://www.w3schools.com/go/go_data_types.php)
- READ: [Tour of Go: types](https://go.dev/tour/basics/11)
- READ: [Go types with examples](https://golangbyexample.com/all-data-types-in-golang-with-examples/)
`
},
],
group2: [
{
label: "Conditional statements: if, switch",
desc: `
# Conditional Statements
Conditional statements are used to run code only if a certain condition is true; go supports :
- \`if\` statements
- \`if / else\` statements
- \`switch\` \`case\` statements
### Resources:
- READ: [Effective Go: if statement](https://go.dev/doc/effective_go#if)
- READ: [Basic conditional patterns](https://yourbasic.org/golang/if-else-statement/)
- READ: [Go by Example: If-Else](https://gobyexample.com/if-else)
- READ: [Golang programs if else](https://www.golangprograms.com/golang-if-else-statements.html)
- READ: [Golang programs switch case](https://www.golangprograms.com/golang-switch-case-statements.html)
`
},
{
label: "Looping: for, range",
desc: `
# For Loop
Go has only one looping construct, the \`for\` loop. The basic \`for\` loop has three components separated by semicolons:
- the init statement: executed before the first iteration
- the condition expression: evaluated before every iteration
- the post statement: executed at the end of every iteration
### Resources:
- READ: [For Loop in Golang](https://go.dev/tour/flowcontrol/1)
- READ: [Effective Go: For loop](https://go.dev/doc/effective_go#for)
- READ: [Go by Example: For loop](https://gobyexample.com/for)
- READ: [5 basic for loop patterns](https://yourbasic.org/golang/for-loop/)
# Range
\`Range\` is used with \`For Loops\` to iterate over each element in arrays, strings and other data structures .
### Resources:
- READ: [Go Ranges](https://go.dev/tour/moretypes/16)
- READ: [Go by Example: Range](https://gobyexample.com/range)
- READ: [Go ranges basic patterns](https://yourbasic.org/golang/for-loop-range-array-slice-map-channel/)
`
},
{
label: "Errors, Panic, Recover",
desc: `
# Errors/Panic/Recover
In lieu of adding exception handlers, the Go creators exploited Gos ability to return multiple values. The most commonly used Go technique for issuing errors is to return the error as the last value in a return.
A panic typically means something went unexpectedly wrong. Mostly used to fail fast on errors that shouldnt occur during normal operation, or that we arent prepared to handle gracefully.
Panic recovery in Go depends on a feature of the language called deferred functions. Go has the ability to guarantee the execution of a function at the moment its parent function returns. This happens regardless of whether the reason for the parent functions return is a return statement, the end of the function block, or a panic.
### Resources:
- READ: [Error handling and Go](https://go.dev/blog/error-handling-and-go)
- READ: [Go Defer, Panic and Recover](https://go.dev/blog/defer-panic-and-recover)
- READ: [Effective error handling in Go](https://earthly.dev/blog/golang-errors/)
`
},
],
group3: [
{
label: "Functions, multiple/named returns",
desc: `
# Functions
Discover how functions work in Go, the list of resources below will cover :
- How to define and call functions in Go?
- Named returns in Go?
- Handle multiple return types.
- Different types of functions in Go.
### Resources:
- READ: [Go by Example: Functions](https://gobyexample.com/functions)
- READ: [Functions in go](https://www.golangprograms.com/go-language/functions.html)
`
},
{
label: "Packages, imports and exports",
desc: `
# Packages
Packages are the most powerful part of the Go language. The purpose of a package is to design and maintain a large number of programs by grouping related features together into single units so that they can be easy to maintain and understand and independent of the other package programs. This modularity allows them to share and reuse. In Go language, every package is defined with a different name and that name is close to their functionality like strings package and it contains methods and functions that only related to strings.
### Resources:
- READ: [How to create a package in Go](https://www.golang-book.com/books/intro/11)
- READ: [How to manage external dependencies in Go](https://go.dev/doc/modules/managing-dependencies)
- EXPLORE: [Go Packages explorer](https://pkg.go.dev/)
- Official Website: [Standard library](https://pkg.go.dev/std)
- READ: [Packages in Golang](https://www.geeksforgeeks.org/packages-in-golang/)
- READ: [Go Packages](https://www.programiz.com/golang/packages)
`
},
{
label: "Type casting, Type inference",
desc: `
# Type Casting
Go doesn't support automatic type conversion, but it allows type casting, which is the process of explicitly changing the variable type. To learn more about typecasting, visit these resources :
### Resources:
- READ: [Geeks for Geeks: Type casting](https://www.geeksforgeeks.org/type-casting-or-type-conversion-in-golang/)
- READ: [Tour of Go: Type Casting Basics](https://go.dev/tour/basics/13)
- READ: [Go Docs: Type Casting](https://golangdocs.com/type-casting-in-golang)
# Type Inference
Type inference gives go the capability to detect the type of a value without being explicitly indicated , hence the possibility to declare variables without providing its type at first
### Resources:
- READ: [Go Variables: Type Inference](https://www.callicoder.com/golang-variables-zero-values-type-inference/#type-inference)
- READ: [Tour of Go: Type Inference](https://go.dev/tour/basics/14)
`
},
{
label: "Arrays, Slices, Maps",
desc: `
# Arrays
In Go an \`array\` is a collection of elements of the same type with a **fixed** size defined when the array is created.
### Resources:
- Official Website: [Go Arrays](https://go.dev/tour/moretypes/6)
- READ: [Effective Go: Arrays](https://go.dev/doc/effective_go#arrays)
- WATCH: [Learn Go Programming - Arrays (by freeCodeCamp on YouTube)](https://youtu.be/YS4e4q9oBaU?t=6473)
# Slices
Slices are similar to arrays but are more powerful and flexible. Like arrays, slices are also used to store multiple values of the same type in a single variable. However, unlike arrays, the length of a slice can grow and shrink as you see fit.
### Resources:
- Official Website: [Go Slices](https://go.dev/tour/moretypes/7)
- READ: [Effective Go: Slices](https://go.dev/doc/effective_go#slices)
- READ: [Slices in Go](https://www.w3schools.com/go/go_slices.php)
- WATCH: [Learn Go Programming - Slices (by freeCodeCamp on YouTube)](https://youtu.be/YS4e4q9oBaU?t=6473)
# Maps
Maps are the data structure in Go, where we use whenever we want to have mappings between key:value pairs. They have flexibility in terms of removing or adding elements into them. Maps do not allow duplicate entries while data are kept unordered.
### Resources:
- Official Website: [Go Maps](https://go.dev/tour/moretypes/19)
- READ: [Effective Go: Maps](https://go.dev/doc/effective_go#maps)
- READ: [Maps in Go](https://www.w3schools.com/go/go_maps.php)
- WATCH: [Golang Tutorial #15 - Maps (by Tech With Tim on YouTube)](https://www.youtube.com/watch?v=yJE2RC37BF4)
`
},
{
label: "make(), structs",
desc: `
# Make
Golang's built-in function make, helps us create and initialize slices, maps and channels, depending on the arguments that are provided to the function.
### Resources:
- READ: [Effective Go: Allocation with make](https://go.dev/doc/effective_go#allocation_make)
- READ: [Create a slice with make](https://www.golangprograms.com/how-to-create-slice-using-make-function-in-golang.html)
- READ: [Create a map with make](https://www.golangprograms.com/golang-package-examples/how-to-create-map-using-the-make-function-in-go.html)
- READ: [Create a channel with make](https://www.programiz.com/golang/channel#channel)
# Structs
Structs are user-defined types that help us create a collection of data describing a single entity.
### Resources:
- Official Website: [Go Structs](https://go.dev/tour/moretypes/2)
- READ: [Go by Example: Structs](https://gobyexample.com/structs)
- WATCH: [Structs in Go](https://www.youtube.com/watch?v=NMTN543WVQY)
`
},
]
},
{
label: "Go Deeper",
group1: [
{
label: "Go Modules",
desc: `
# Modules
Go modules are a group of related packages that are versioned and distributed together. They specify the requirements of our project, list all the required dependencies, and help us keep track of the specific versions of installed dependencies.
Modules are identified by a module path that is declared in the first line of the go.mod file in our project.
### Resources:
- Official Website: [Go Modules](https://go.dev/blog/using-go-modules)
- WATCH: [Go Modules](https://www.youtube.com/watch?v=9cV1KESTJRc)
- READ: [DigitalOcean: How to use Go Modules](https://www.digitalocean.com/community/tutorials/how-to-use-go-modules)
- WATCH: [Go Modules Explained in 5 Minutes (by Golang Dojo on YouTube)](https://youtu.be/7xSxIwWJ9R4)
- READ: [How to create a module in Go](https://go.dev/doc/tutorial/create-module)
- READ: [How to use modules in Go](https://go.dev/blog/using-go-modules)
- READ: [How to modify existing projects to use Go modules](https://jfrog.com/blog/converting-projects-for-go-modules/)
`
},
{
label: "Marshalling and unmarshalling JSON",
desc: `
# Working with json
JSON (JavaScript Object Notation) is a simple data interchange format. Syntactically it resembles the objects and lists of JavaScript. It is most commonly used for communication between web back-ends and JavaScript programs running in the browser, but it is used in many other places, too.
### Resources:
- Official Website: [JSON](https://go.dev/blog/json)
- READ: [Guide to JSON in Golang](https://www.sohamkamani.com/golang/json/)
- READ: [JSON to GO](https://mholt.github.io/json-to-go/)
`
},
],
group2: [
{
label: "Types, type assertions, switches",
desc: `
# Types and type assertions
Type assertions in Golang provide access to the exact type of variable of an interface.
### Resources:
- Official Website: [Types Assertions](https://go.dev/tour/methods/15)
- READ: [Type Assertion](https://www.geeksforgeeks.org/type-assertions-in-golang/)
`
},
{
label: "Interfaces, context",
desc: `
# Interfaces
An interface in Go, is a type that defines a set of methods. If we have a type (e.g. struct) that implements that set of methods, then we have a type that implements this interface.
### Resources:
- Official Website: [Go Interfaces](https://go.dev/tour/methods/9)
- READ: [Effective Go: Interfaces](https://go.dev/doc/effective_go#interfaces)
- READ: [Go by Example: Interfaces](https://gobyexample.com/interfaces)
- WATCH: [Golang Tutorial #22 - Interfaces (by Tech With Tim on YouTube)](https://www.youtube.com/watch?v=lh_Uv2imp14)
- WATCH: [Learn Go Interfaces](https://www.youtube.com/watch?v=KB3ysH8cupY)
- WATCH: [Understanding Go Interfaces](https://www.youtube.com/watch?v=qJKQZKGZgf0)
# Context
The \`context\` package provides a standard way to solve the problem of managing the state during a request. The package satisfies the need for request-scoped data and provides a standardized way to handle: Deadlines, Cancellation Signals, etc.
### Resources:
- Official Website: [Go Context](https://pkg.go.dev/context)
- READ: [Go by Example: Context](https://gobyexample.com/context)
- READ: [Digital Ocean: How to Use Contexts in Go](https://www.digitalocean.com/community/tutorials/how-to-use-contexts-in-go)
- WATCH: [Context in Go](https://www.youtube.com/watch?v=LSzR0VEraWw)
- WATCH: [Understanding Contexts in Go](https://youtu.be/h2RdcrMLQAo)
`
},
],
group3: [
{
label: "Goroutines, channels",
desc: `
# Goroutines
Goroutines allow us to write concurrent programs in Go. Things like web servers handling thousands of requests or a website rendering new pages while also concurrently making network requests are a few example of concurrency.
In Go, each of these concurrent tasks are called \`Goroutines\`.
### Resources:
- Official Website: [Goroutines](https://go.dev/tour/concurrency/1)
- READ: [Effective Go: Goroutines](https://go.dev/doc/effective_go#goroutines)
- READ: [Goroutines in Golang](https://www.geeksforgeeks.org/goroutines-concurrency-in-golang)
- WATCH: [GoRoutines](https://www.youtube.com/watch?v=LvgVSSpwND8)
- WATCH: [Understanding Concurrency](https://www.youtube.com/watch?v=V-0ifUKCkBI)
- READ: [Go by Example: Goroutines](https://gobyexample.com/goroutines)
- WATCH: [Golang Goroutine Basics You MUST Learn! (by Golang Dojo on YouTube)](https://youtu.be/oHIbeTmmTaA)
# Channels
Channels are the pipes that connect concurrent goroutines. You can send values into channels from one goroutine and receive those values into another goroutine.
Channels are a typed conduit through which you can send and receive values with the channel operator, \`<-\` .
### Resources:
- Official Website: [Channels](https://go.dev/tour/concurrency/2)
- READ: [Effective Go: Channels](https://go.dev/doc/effective_go#channels)
- READ: [Go by Example: Channels](https://gobyexample.com/channels)
- READ: [Channels in Golang](https://golangbot.com/channels/)
- WATCH: [Channels](https://www.youtube.com/watch?v=e4bu9g-bYtg)
- READ: [GeeksForGeeks: Channel in Golang](https://www.geeksforgeeks.org/channel-in-golang/)
- WATCH: [Golang Channel Basics You must Know!](https://youtu.be/LgCmPHqAuf4)
`
},
{
label: "Buffer, Select",
desc: `
# Buffer
The \`buffer\` belongs to the byte package of the Go language, and we can use these package to manipulate the byte of the string.
### Resources:
- Official Website: [Buffer Examples](https://pkg.go.dev/bytes#example-Buffer)
- READ: [Buffer](https://www.educba.com/golang-buffer/)
- WATCH: [Buffers in Golang](https://www.youtube.com/watch?v=NoDRq6Twkts)
# Select
The \`select\` statement lets a goroutine wait on multiple communication operations.
A \`select\` blocks until one of its cases can run, then it executes that case. It chooses one at random if multiple are ready. The \`select\` statement is just like switch statement, but in the select statement, case statement refers to communication, i.e. sent or receive operation on the channel.
### Resources:
- Official Website: [Select](https://go.dev/tour/concurrency/5)
- READ: [Go by Example: Select](https://gobyexample.com/select)
- READ: [Select in Golang](https://www.geeksforgeeks.org/select-statement-in-go-language/)
- WATCH: [Select Statement](https://www.youtube.com/watch?v=1c7ttSJDMAI)
`
},
{
label: "Mutex",
desc: `
# Mutex
Go allows us to run code concurrently using goroutines. However, when concurrent processes access the same piece of data, it can lead to [race conditions](https://www.sohamkamani.com/golang/data-races/). Mutexes are data structures provided by the [sync](https://pkg.go.dev/sync/) package. They can help us place a lock on different sections of data so that only one goroutine can access it at a time.
- READ: [Using a Mutex in Go with Examples](https://www.sohamkamani.com/golang/mutex/)
`
},
]
},
{
label: "Applications",
group1: [
{
label: "Logging",
desc: `
# Logging
Go has built-in features to make it easier for programmers to implement logging. Third parties have also built additional tools to make logging easier.
### Resources:
- READ: [Logging in Go: Choosing a System and Using it](https://www.honeybadger.io/blog/golang-logging/)
- READ: [Logging in Golang How to Start](https://www.loggly.com/use-cases/logging-in-golang-how-to-start/)
`
},
{
label: "Building CLIs",
desc: `
# Building CLI Applications
Command line interfaces (CLIs), unlike graphical user interfaces (GUIs), are text-only. Cloud and infrastructure applications are primarily CLI-based due to their easy automation and remote capabilities.
Go applications are built into a single self contained binary making installing Go applications trivial; specifically, programs written in Go run on any system without requiring any existing libraries, runtimes, or dependencies. And programs written in Go have an immediate startup timesimilar to C or C++ but unobtainable with other programming languages.
### Resources:
- READ: [Command-line Interfaces (CLIs)](https://go.dev/solutions/clis)
`
},
],
group2: [
{
label: "ORMs",
desc: `
# ORMs
Objectrelational mapping (ORM, O/RM, and O/R mapping tool) in computer science is a programming technique for converting data between type systems using object-oriented programming languages. This creates, in effect, a "virtual object database", hence a layer of abstraction, that can be used from within the programming language.
Most common ORM library in Go is [GORM](https://gorm.io/).
`
},
{
label: "Web frameworks",
desc: `
# Web Frameworks
There are several famous web frameworks for Go. Most common ones being:
* Beego
* Gin
* Revel
* Echo
### Resources:
- READ: [Comparison of Web Frameworks](https://github.com/diyan/go-web-framework-comparison)
`
},
],
group3: [
{
label: "Real time communication",
desc: `
# Real time communication
Work in progress.
`
},
{
label: "API Clients",
desc: `
# API Clients
An API client is a set of tools and protocols that operate from an application on a computer. They help you to bypass some operations when developing a web application rather than reinventing the wheel every time. Using a client API is a great way to speed up the development process.
### Resources:
- READ: [API Clients](https://rapidapi.com/blog/api-glossary/client/)
`
},
{
label: "Tools for Microservices",
desc: `
# Microservices
Microservices are an architectural approach to software development that allows the creation of a distributed application from deployable services that allow communication through a well-defined API. Being a solution to monoliths.
### Resources:
- READ: [Introduction to microservices](https://developer.ibm.com/learningpaths/get-started-application-modernization/intro-microservices/introduction/)
- READ: [Microservice Patterns and Resources by Chris Richardson](https://microservices.io/index.html)
- READ: [Microservices AntiPatterns and Pitfalls - Mark Richards](https://www.oreilly.com/content/microservices-antipatterns-and-pitfalls/)
- READ: [Building Microservices, 2nd Edition - Sam Newman](https://samnewman.io/books/building_microservices_2nd_edition/)
`
},
]
},
],
edges: [
{path: "M 10,30 A 20,20 0,0,1 50,30 A 20,20 0,0,1 90,30 Q 90,60 50,90 Q 10,60 10,30 z", style: "primary"},
{path: "M 10,10 L 90,90 V 10 H 50", style: "secondary"},
],
end: {label: "Now go make cool things with Golang!"}
}

Wyświetl plik

@ -23,7 +23,9 @@ const config = {
}
},
plugins: [],
plugins: [
require('@tailwindcss/typography'),
],
};
module.exports = config;