takanawa

package module
v0.0.0-...-99b33a3 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2020 License: MIT Imports: 1 Imported by: 0

README

高輪 − Takanawa

GitHub Actions Docker Cloud Build Status codecov

Takanawa is a reverse proxy for HTTP services for development.

Usage

For example, execute the following command to proxy / to UI server and /api to the API server:

$ takanawa --access-log=common \
    http://localhost:3000 --change-origin \
    http://localhost:8080/v1 --change-origin --path=/api

Takanawa runs on port 5000.

Requirements

  • Go 1.11+

Installation

$ go get -u github.com/kou64yama/takanawa

Docker

$ docker run -p 5000:5000 kou64yama/takanawa --access-log=common \
    http://localhost:3000 --change-origin \
    http://localhost:8080/v1 --change-origin --path=/api

License

Copyright 2020 Yamada Koji. This source code is licensed under the MIT license.

Documentation

Overview

Package takanawa is the HTTP/HTTPS reverse proxy utilities.

Index

Constants

View Source
const (
	HeaderTakanawaRequestID             = "X-Takanawa-Request-Id"
	HeaderAccessControlAllowOrigin      = "Access-Control-Allow-Origin"
	HeaderAccessControlAllowMethods     = "Access-Control-Allow-Methods"
	HeaderAccessControlAllowHeaders     = "Access-Control-Allow-Headers"
	HeaderAccessControlExposeHeaders    = "Access-Control-Expose-Headers"
	HeaderAccessControlAllowCredentials = "Access-Control-Allow-Credentials"
)

HTTP headers.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextKey

type ContextKey string

The ContextKey is the type of context key.

var (
	ContextTakanawaRequestID ContextKey
)

Context keys.

type Middleware

type Middleware interface {
	Apply(http.Handler) http.Handler
}

A Middleware transforms http.Handler.

func ComposeMiddleware

func ComposeMiddleware(mids ...Middleware) Middleware

ComposeMiddleware composes mids.

type MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

The MiddlewareFunc type is an adapter to allow the use of ordinary functions as takanawa middleware.

func (MiddlewareFunc) Apply

func (f MiddlewareFunc) Apply(next http.Handler) http.Handler

Apply calls f(next)

Directories

Path Synopsis
cmd
internal
Package middleware is the middlewares of takanawa.
Package middleware is the middlewares of takanawa.

Jump to

Keyboard shortcuts

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