goblog

command module
v0.0.0-...-209e33c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2023 License: GPL-3.0 Imports: 1 Imported by: 0

README

goblog

A blog system used for recording ideas and analyzing these articles via AI algorithms.

Architecture

                        +--------+
WebUI        ---->      |        |  ---->  mysql
                        |        |
pprof        ---->      | goblog |  ---->  redis
                        |        |
Test Suite   ---->      |        |  ---->  data center (AI analysis)
                        +--------+

WebUI

view a post edit a post analysis analyze one post analysis result
view edit analysis rawpost result

Tech Detail

It contains endpoints, performance, cache, sql tables, etc.

TO DO LIST

  • machine learning code
  • basic test case via go
  • record leveled logs to a file
  • support middleware
  • support cache for mysql
  • rate limit of the visit
  • access limit of database
  • pprof investigation
  • fix bottleneck of the database create/update operation
  • garbage collection performance
  • other performance issue

Prerequisites

  • mysql: 8.0.27
  • redis: 6.2.6
  • hzget/analysis: 1.0

You can change to others for corresponding service. Just only make very little code changes.

Configuration

config/config.json

Run the code from within the host

If prerequisites services are available, modify the config file and run the command go run . :

   $ go build
   $ ./goblog
   PONG <nil>
   Connected!

After that, visit the url via a web browser: http://localhost:8080/

Run the code from within a container

The user can run containers of goblog, mysql, redis and analysis.

  • run all containers with docker-compose.yaml: docker-compose up -d goblog
  • get goblog logs docker-compose logs -f goblog

Testing

Test cases are in these *_test.go files inside blog dir. The user can run with go test commands to test specific funcs or run a benchmark test.

There're also test case by which the client start a real http connection.

  • automate test case
  • manually test via curl command line

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL