transport

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package transport provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.9.0 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoggingMiddleware

func LoggingMiddleware(logger zerolog.Logger, next http.Handler) http.Handler

LoggingMiddleware logs every http requests

func NewBaseHTTPHandler

func NewBaseHTTPHandler(svc service.UserService) http.Handler

NewBaseHTTPHandler returns a base http.Handler without any configured middlewares

func NewHTTPHandler

func NewHTTPHandler(svc service.UserService, logger zerolog.Logger) http.Handler

NewHTTPHandler creates and returns a configured http.Handler

Types

type CreateUserJSONBody

type CreateUserJSONBody CreateUserRequest

CreateUserJSONBody defines parameters for CreateUser.

type CreateUserJSONRequestBody

type CreateUserJSONRequestBody CreateUserJSONBody

CreateUserJSONRequestBody defines body for CreateUser for application/json ContentType.

type CreateUserRequest

type CreateUserRequest struct {
	// Email address
	Email string `json:"email"`

	// User name
	Name string `json:"name"`

	// Password
	Password string `json:"password"`
}

CreateUserRequest defines model for CreateUserRequest.

type CreateUserResponse

type CreateUserResponse struct {
	Id string `json:"id"`
}

CreateUserResponse defines model for CreateUserResponse.

type FindUsersParams

type FindUsersParams struct {
	// User's email address
	Email string `json:"email"`
}

FindUsersParams defines parameters for FindUsers.

type InvalidParam

type InvalidParam struct {
	// Name of the property
	Name string `json:"name"`

	// Why is the property considered invalid
	Reason string `json:"reason"`
}

Represents an invalid property in a bad request

type Problem

type Problem struct {
	// A human readable explanation specific to this occurrence of the problem that is helpful to locate the problem and give advice on how to proceed. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized.
	Detail        string          `json:"detail"`
	InvalidParams *[]InvalidParam `json:"invalid-params,omitempty"`

	// The HTTP status code generated by the origin server for this occurrence of the problem.
	Status int32 `json:"status"`

	// A short summary of the problem type. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized.
	Title string `json:"title"`

	// A URI reference that uniquely identifies the problem type only in the context of the provided API. Opposed to the specification in RFC-7807, it is neither recommended to be dereferencable and point to a human-readable documentation nor globally unique for the problem type.
	Type *string `json:"type,omitempty"`
}

Problem defines model for Problem.

type User

type User struct {
	// Email address
	Email string `json:"email"`

	// User ID
	Id string `json:"id"`

	// User name
	Name string `json:"name"`
}

User defines model for User.

Jump to

Keyboard shortcuts

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