rest

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2020 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

Package rest contains all methods and middleware for working web server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitMetrics

func InitMetrics(namespace string, flatSwaggerJSON json.RawMessage)

InitMetrics must be called once before using this package. It registers and initializes metrics used by this package.

func New

func New(application app.App, logger *zap.Logger, options ...Option) (*restapi.Server, error)

New returns Swagger server configured to listen on the TCP network.

func User

func User(u *app.User) *models.User

User conversion userApp.User => models.User.

func Users

func Users(u []app.User) []*models.User

Users conversion []userApp.User => []*models.User.

Types

type Option

type Option func(*config)

Option for run server.

func SetBasePath

func SetBasePath(basePath string) Option

SetBasePath sets the base path to handlers. Default: /api/v1.

func SetHost

func SetHost(host string) Option

SetHost sets server host. Default: localhost.

func SetPort

func SetPort(port int) Option

SetPort sets server port. Default: 8080.

Directories

Path Synopsis
Package generated contains generated code based on go-swagger.
Package generated contains generated code based on go-swagger.
restapi
Package restapi Service boilerplate.
Package restapi Service boilerplate.

Jump to

Keyboard shortcuts

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