Skip to content

Package core/httpserver for HTTPServer

Summary

This is the design document of core/httpserver package which provides HTTPServer resource. HTTPServer can run HTTP ½/3 servers.

Motivation

HTTP server is required to work as an API gateway.

Goals

  • HTTPServer can run HTTP1 server.
    • TLS is configurable.
  • HTTPServer can run HTTP2 server.
  • HTTPServer can run HTTP3 server.

Non-Goals

Technical Design

HTTP server

HTTPServer runs a HTTP server. HTTPServer can run HTTP1, HTTP2 and HTTP3 server.

HTTPServer implements core.Runner interface. HTTPServer is intended to be run by registering to the Entrypoint resource.

type Runner interface {
  Run(context.Context) error
}

Following 3 types of servers can be run by configuring with the configuration.

Test Plan

Unit Tests

Unit tests are implemented and passed.

  • All functions and methods are covered.
  • Coverage objective 98%.

Integration Tests

Integration tests are implemented with these aspects.

  • HTTPServer works as a runner.
  • HTTPServer works with input configuration.
  • HTTPServer can run HTTP1 server with/without TLS.
  • HTTPServer can run HTTP2 server with TLS.
  • HTTPServer can run HTTP3 server.

e2e Tests

e2e tests are implemented with these aspects.

  • HTTPServer works as a runner.
  • HTTPServer works with input configuration.
  • HTTPServer can run HTTP1 server with/without TLS.
  • HTTPServer can run HTTP2 server with TLS.
  • HTTPServer can run HTTP3 server.

Fuzz Tests

Not planned.

Benchmark Tests

Not planned.

Chaos Tests

Not planned.

Future works

None.

References