Skip to content
Nguyen Minh Duc edited this page Jun 18, 2022 · 64 revisions

overview

  • GO libraries to develop micro services

Microservice Architect

Microservice Architect

A typical micro service

A typical micro service Hexagonal Architecture

Libraries of core-go

Collection of libraries of core-go

Databases

Database

Storage

storage

Cross-cutting concerns

cross-cutting concerns

  • We provide many libraries to minimize effort for cross-cutting concerns, which can be used by an AOP framework
  • We do not implement an AOP framework

Evaluate effort for cross-cutting concerns

Effort for cross-cutting concerns

Health Check

health

Logging

Providers

Standardize API for logging, support 2 libraries:

Request Tracing

  • middleware: Log request and response at http middleware, allow to configure dynamic field names
  • client: Log request and response at http client, allow to configure dynamic field names

Audit Log

  • Support for CRUD, search (not required in every application)

Security

Sample is go-admin

  • Identity and Access Management: Authorization at middleware, support http (mux, chi), gin, echo
  • Crypto
  • JWT

Caching

Memory Cache

  • Time To Live: automatically clean up the expired objects in the memory cache
  • Maximum size: When the memory exceeds the max size (which is configurable), it automatically remove the oldest object.

Redis

Support 2 libraries

Validator

Check required, email, url, min, max, country code, phone number, regular expression...

Search

Samples are go-admin, go-backoffice and go-location

  • Generate the model by URL
  • Paging
  • Sort

Build a dynamic query for these providers

  • SQL
  • Mongo
  • Dynamodb
  • Firestore
  • Elasticsearch

Communication

Email

Email

  • Build some standard interfaces, which can be shared by multiple providers: SMTP and Sendgrid
  • The sample is go-authentication

Message Queue

Message Queue

Support these providers
Support 2 reusable business flows
  • Consume message and handle one by one
  • Consume message and handle by batch

Reusable business components

Reusable business components

authentication

Authentication

  • authenticator
  • ldap authenticator
  • 2 factor authentication

oauth2

oauth2

sign up

sign up

sign up with password

  • sign up with password
  • verify account (without password)

sign up without password

  • sign up without password
  • verify account (require to input password)

password

password

  • forgot password
  • change password (also support change password 2 factors)
  • reset password