server

package
v0.0.0-...-17ece98 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server handles HTTP requests.

func New

func New(cnf config.ServerConfig, service Service) *Server

New returns a new instance of the Forma server.

func (*Server) GetV1

func (s *Server) GetV1(rw http.ResponseWriter, req *http.Request)

GetV1 is responsible for `GET /api/v1/{Schema.ID}` request handling. Deprecated: TODO issue#version3.0 use SchemaEditor and gRPC gateway instead

func (*Server) Input

func (s *Server) Input(rw http.ResponseWriter, req *http.Request)

Input is responsible for `POST /api/v1/{Schema.ID}` request handling.

type Service

type Service interface {
	// HandleGetV1 handles an input request.
	// Deprecated: TODO issue#version3.0 use SchemaEditor and gRPC gateway instead
	HandleGetV1(context.Context, v1.GetRequest) v1.GetResponse
	// HandleInput handles an input request.
	HandleInput(context.Context, v1.PostRequest) v1.PostResponse
}

Service defines the behavior of the Forma service.

Directories

Path Synopsis
chi

Jump to

Keyboard shortcuts

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