Skip to content

IvanDrf/link-checker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Golang Link-Checker

App

Architecture

Microservice Architecture architecture
Architecture
A Clean, Onion architecture was used for each of the services.


architecture

Description

The application is a collection of microservices: auth, checker; http api-gateway, Telegram Bot. App allows you to register by email, confirm it and check an array of links with up to 100 links in one request, or you can use Telegram Bot, and the checking speed is very high, because the worker pool pattern is used to check links.

func WorkerPool(ctx context.Context, in chan string, out chan models.Link, workers int, checkLink CheckLinkFunc) {
	wg := new(sync.WaitGroup)

	workers = min(workers, maxGoroutines)

	wg.Add(workers)
	for range workers {
		go func() {
			defer wg.Done()
			for {
				select {
				case <-ctx.Done():
					return
				default:
					link, ok := <-in
					if !ok {
						return
					}

					worker(ctx, link, out, checkLink)
				}
			}
		}()
	}

	go func() {
		wg.Wait()
		close(out)
	}()
}

Documentation

The main documentation is located in the docs/ directory in english and russian.

All example config files are in dirs - 'config'

API-gateway

Documentation - docs

API routes

package server

func (s *Server) RegisterRoutes() {
	s.mux.HandleFunc("POST /api/register", s.api.Register)
	s.mux.HandleFunc("/api/verify/", s.api.VerifyEmail)
	s.mux.HandleFunc("POST /api/login", s.api.Login)
	s.mux.HandleFunc("POST /api/refresh", s.api.RefreshTokens)

	s.mux.HandleFunc("POST /api/check", s.middle.AuthMiddleware(s.api.CheckLinks))
}

AUTH

Proto file - auth.proto

CHECKER

Proto file - checker.proto

Contributing

Pull requests are welcome, but can only be merged if the code conforms to PEP 8 for Python and Google style guide for GO.

About

Microservice golang Link-Checker that allows you to check the activity of links

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages