webapi

package
v0.0.0-...-44af80e Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2018 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package webapi Web API

This is the API for the application.

Swagger 2.0 Spec - generated by [go-swagger](https://github.com/go-swagger/go-swagger)

Schemes: http Host: localhost:8080 BasePath: / Version: 2.0

Consumes: - application/x-www-form-urlencoded

Produces: - application/json

SecurityDefinitions: token:

type: apiKey
name: Authorization
in: header
description: "The following syntax must be used in the Authorization header: Bearer TOKEN"

swagger:meta

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Database

func Database(dbc database.Connection, l logger.ILog) *database.DBW

Database returns the database connection.

func Handlers

func Handlers(config *AppConfig, l logger.ILog, r *router.Mux) (*http.Server, *http.Server)

Handlers returns the HTTP and HTTPS handlers.

func Routes

func Routes(core component.Core) *router.Mux

Routes will set up the components and return the router.

func Services

func Services(config *AppConfig, l logger.ILog) component.Core

Services will set up the production services.

Types

type AppConfig

type AppConfig struct {
	Database database.Connection    `json:"Database"`
	Server   server.Config          `json:"Server"`
	JWT      webtoken.Configuration `json:"JWT"`
}

AppConfig contains the application settings with JSON tags.

func (*AppConfig) ParseJSON

func (c *AppConfig) ParseJSON(b []byte) error

ParseJSON unmarshals the JSON bytes to the struct.

Directories

Path Synopsis
cmd
internal
jwt
pkg
env
Package env will fill a struct from environment variables.
Package env will fill a struct from environment variables.
logger
Package logger standardizes the logging functions available to your team.
Package logger standardizes the logging functions available to your team.
passhash
Package passhash provides password hashing functionality using bcrypt.
Package passhash provides password hashing functionality using bcrypt.

Jump to

Keyboard shortcuts

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