article

package module
v0.0.0-...-6852176 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2022 License: MIT Imports: 11 Imported by: 0

README

(REST API) Go app for publishing and working with articles

The following concepts are applied in the app:

  • Development of Web Applications in Go, following the REST API design.
  • Using gin-gonic/gin framework.
  • Clean Architecture approach in building application structure (dependency injection)
  • Using Postgres database. Generation of migration files.
  • Using the database using the library sqlx.
  • Application configuration using spf13/viper library. Working with .env environment variables.
  • Authorization and authentication using a stateless approach (JWT).
  • Graceful Shutdown.
  • Run from Docker.
build app:
make build
run app:
make run
run tests:
make test

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MigrateSchema

func MigrateSchema(cfg *ConfigDB, label string) error

func NewPdb

func NewPdb(cfg *ConfigDB) (*sqlx.DB, error)

Types

type AddrHttp

type AddrHttp struct {
	Addr string
	Port int
}

type ConfigDB

type ConfigDB struct {
	Username string
	Host     string
	Port     int
	Dbname   string
	Sslmode  string
	Password string
}

type Serv

type Serv struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(handler http.Handler, addrHttp AddrHttp) *Serv

func (*Serv) Run

func (s *Serv) Run() error

func (*Serv) Shutdown

func (s *Serv) Shutdown(ctx context.Context) error

Directories

Path Synopsis
pkg
service/mocks
Package mock_service is a generated GoMock package.
Package mock_service is a generated GoMock package.

Jump to

Keyboard shortcuts

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