Documentation
¶
Index ¶
Constants ¶
View Source
const ( OKPath = "/ok" OKMessage = "bridge is ready" ProxyPath = "/htproxy" )
Variables ¶
This section is empty.
Functions ¶
func NewHTTPHandler ¶
func NewHTTPHandler(c *HTTPHandlerConfig) http.Handler
NewHTTPHandler is a handler for handling any requests.
Types ¶
type Env ¶
type Env struct { // Port is port to listen HTTP server. Default is 8080. Port string `envconfig:"PORT" default:"8080" description:"bridge を HTTP としてサーブするために利用します。"` // LogLevel is INFO or DEBUG. Default is "INFO". LogLevel string `envconfig:"LOG_LEVEL" default:"INFO"` // APIURL is an url of basemachina. APIURL string `envconfig:"BASEMACHINA_API_URL" default:"https://api.basemachina.com"` // FetchInterval is interval to fetch FetchInterval time.Duration `envconfig:"FETCH_INTERVAL" default:"1h" description:"認可処理に利用する公開鍵を更新する間隔です。"` // FetchTimeout is timeout to fetch FetchTimeout time.Duration `` /* 132-byte string literal not displayed */ // TenantID is ID of tenant TenantID string `` /* 180-byte string literal not displayed */ }
Env stores configuration settings extract from enviromental variables The practice getting from environmental variables comes from https://12factor.net.
type HTTPHandlerConfig ¶
type HTTPHandlerConfig struct { Logger logr.Logger PublicKeyGetter auth.PublicKeyGetter RegisterUserObject auth.TenantIDGetter TenantID string Middlewares []bridgehttp.Middleware }
HTTPHandlerConfig is a config to setup bridge http handler.
Click to show internal directories.
Click to hide internal directories.