Skip to content
View snowwyd's full-sized avatar
😉
Learning hard
😉
Learning hard
  • Moscow Aviation Institute
  • Russia, Moscow

Block or report snowwyd

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don't include any personal information such as legal names or email addresses. Markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
snowwyd/README.md

Hi, I'm Evteev Daniel!

package main

import (
	"fmt"
	"net/http"

	"github.com/gin-gonic/gin"
)

type greeter interface {
	greet() string
}

func newGreeter(isForStudent bool) greeter {
	if isForStudent {
		return &mentor{firstName: "Daniel", lastName: "Evteev"}
	}
	return &gitHubUser{nickname: "qyteboii a.k.a snowwyd"}
}

type mentor struct {
	firstName, lastName string
}

func (m *mentor) greet() string {
	return fmt.Sprintf("Hi, I'm %s %s - your Golang mentor!", m.firstName, m.lastName)
}

type gitHubUser struct {
	nickname string
}

func (ghu *gitHubUser) greet() string {
	return fmt.Sprintf("Hi, I'm %s, nice to meet your eyes on this text yo!", ghu.nickname)
}

type greetRequest struct {
	IsStudent bool `json:"is_student"`
}

func greet(c *gin.Context) {
	var req greetRequest
	c.ShouldBindJSON(&req)

	greeter := newGreeter(req.IsStudent)
	c.JSON(http.StatusOK, gin.H{"greeting_text": greeter.greet()})
}

func main() {
	router := gin.Default()
	router.POST("/greet", greet)

	if err := router.Run("localhost:809"); err != nil {
		panic(err)
	}
}

Activity

I'm currently working on

  • Huge mastery project
  • Security Signature Utility
  • Go mentorship site

Learning now

  • Huge Go expert roadmap
  • Obsidian features
  • GitHub Pages syntax

Contact me


Pinned Loading

  1. ConstructHub ConstructHub Public

    Diploma project with Glebonchik, YanZa and Deb

    Go 3 1

  2. messenger messenger Public

    messenger project with deoxce

    TypeScript 3

  3. PySide_CAD PySide_CAD Public

    CAD project with YanZa, Rim Yroto, Wezder

    Python