SBWeb

command module
v0.0.0-...-dbbace4 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2018 License: LGPL-3.0 Imports: 6 Imported by: 0

README

Search&Build project

pipeline status coverage report Go Report Card GoDoc

Wiki

Check the Wiki page for more information!

Overview

Search&Build is a service that allows you to solve a wide spectre of building tasks easilly.
It's online marketplace of various building services: you can hire different specialists,
buy some services that connected to construction industry, you can even offer your own services
and use Search&Build to make your business more effective due to the wide reach of the target audience.

Install

go get -u bmstu.codes/developers34/SBWeb

More information is on wiki.

Interface

Information about interface is here.

Allowed addresses:

  • /ads GET
  • /ads/{id} GET
  • /users/{id} GET
  • /users/new POST
  • /users/login POST
  • /users/logout POST
  • /users/profile GET
  • /users/profile POST
  • /users/profile DELETE
  • /ads/new POST
  • /ads/edit/{id} POST
  • /ads/delete/{id} DELETE
  • /images/{filename} GET

Documentation

Overview

SBWeb is the web-service for course work of developers34 team. It's supposed to search and hire specialists of building industry.

Usage of application

Environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY must be specified. If environment variable PORT is specified then its value will override value of config API address. If environment variable REDIS_URL is specified then its value will override value of config SM DBAddress. If environment variable DATABASE_URL is specified then its value will override value of config DB DBAddress.

To run application you need to specify the "cfg" parameter that receives path to config file formatted as JSON.

Config has this structure:

{
  "DB": {
    "DBAddress": <Address of postgres database (string)>,
    "MaxOpenConns": <Number of maximum open connections to database (int)>
  },
  "SM": {
    "DBAddress": <Address of redis storage (string)>,
    "TockenLength": <Length of tocken that will be used as session tocken (int)>,
    "ExpirationTime": <Expiration time of a session in seconds (int)>
  },
  "API": {
    "Address": <Port where the server will be started (string)>,
    "ReadTimeout": <Maximum duration for reading the entire request, including the body (string with postfix 's')>,
    "WriteTimeout": <Maximum duration before timing out writes of the response (string with postfix 's')>,
    "IdleTimeout": <Maximum amount of time to wait for the next request when keep-alives are enabled (string with postfix 's')>
  },
  "IM": {
    "Bucket": <Name of the AWS S3 bucket where to store images (string)>,
    "ACL": <Permissions to images uploaded by application (string)>,
    "Region": <Region of the AWS S3 bucket (string)>
  }
}

Directories

Path Synopsis
pkg
api
Package api implements handling of different URL addresses of application.
Package api implements handling of different URL addresses of application.
api/mock_model
Package mock_model is a generated GoMock package.
Package mock_model is a generated GoMock package.
daemon
Package daemon contains functions to start the whole service.
Package daemon contains functions to start the whole service.
db
Package db implements model.db interface.
Package db implements model.db interface.
model
Package model describes an internal architecture of application.
Package model describes an internal architecture of application.
s3
Package s3 is used to implement model.IM interface.
Package s3 is used to implement model.IM interface.
sessionmanager
Package sessionmanager is used to implement model.SM interface.
Package sessionmanager is used to implement model.SM interface.

Jump to

Keyboard shortcuts

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