Documentation
¶
Index ¶
Constants ¶
View Source
const ( OKPath = "/ok" OKMessage = "bridge is ready" ProxyPath = "/htproxy" )
View Source
const ConnectionCheckPort = "4321"
ConnectionCheckPort is used in connection check from API.
Variables ¶
This section is empty.
Functions ¶
func NewHTTPHandler ¶
func NewHTTPHandler(c *HTTPHandlerConfig) http.Handler
NewHTTPHandler is a handler for handling any requests.
func NewHTTPServer ¶ added in v1.0.5
func ServeCheckConnectionServer ¶ added in v1.0.5
func ServeCheckConnectionServer()
ServeCheckConnectionServer serves http server that is used in connection check from API.
This server is no required to handle graceful because used only the connection check from API.
Serve with goroutine.
Types ¶
type Env ¶
type Env struct { // Port is port to listen HTTP server. Default is 8080. // This value should be other than 4321. because "127.0.0.1:4321" is used in connection checking. Port string `` /* 154-byte string literal not displayed */ // 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.