Documentation ¶
Overview ¶
Package gateway implements the HTTP gateway for Horizon. It is implemented as a library to allow for easy customisation.
Index ¶
- Constants
- type AccountsHandler
- type DefaultHandler
- func (d *DefaultHandler) GetAccounts(w http.ResponseWriter, r *http.Request)
- func (d *DefaultHandler) GetAccountsNew(w http.ResponseWriter, r *http.Request)
- func (d *DefaultHandler) GetHome(w http.ResponseWriter, r *http.Request)
- func (d *DefaultHandler) PostAccounts(w http.ResponseWriter, r *http.Request)
- type GatewayHandler
- type NATSHTTPTransport
- type OIDCConfig
- type ObjectsHandler
- type Server
- type ServerOption
Constants ¶
View Source
const HeaderAccount = "Hz-Account"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountsHandler ¶
type AccountsHandler struct { Middleware chi.Middlewares Conn *nats.Conn Auth *auth.Auth Portals map[string]hz.Portal }
func (*AccountsHandler) Router ¶
func (h *AccountsHandler) Router() *chi.Mux
type DefaultHandler ¶
type DefaultHandler struct {
Conn *nats.Conn
}
func (*DefaultHandler) GetAccounts ¶
func (d *DefaultHandler) GetAccounts(w http.ResponseWriter, r *http.Request)
GetAccounts implements GatewayHandler.
func (*DefaultHandler) GetAccountsNew ¶
func (d *DefaultHandler) GetAccountsNew( w http.ResponseWriter, r *http.Request, )
GetAccountsNew implements GatewayHandler.
func (*DefaultHandler) GetHome ¶
func (d *DefaultHandler) GetHome(w http.ResponseWriter, r *http.Request)
func (*DefaultHandler) PostAccounts ¶
func (d *DefaultHandler) PostAccounts(w http.ResponseWriter, r *http.Request)
PostAccounts implements GatewayHandler.
type GatewayHandler ¶
type GatewayHandler interface { GetHome(w http.ResponseWriter, r *http.Request) GetAccounts(w http.ResponseWriter, r *http.Request) GetAccountsNew(w http.ResponseWriter, r *http.Request) PostAccounts(w http.ResponseWriter, r *http.Request) }
type NATSHTTPTransport ¶
type NATSHTTPTransport struct {
// contains filtered or unexported fields
}
NATSHTTPTransport is an http.RoundTripper that transports HTTP requests over NATS.
It is used together with httputil.ReverseProxy to create an HTTP reverse proxy that transports requests over NATS.
type OIDCConfig ¶
type ObjectsHandler ¶
type ObjectsHandler struct {
Conn *nats.Conn
}
type ServerOption ¶
type ServerOption func(*serverOptions)
func WithDummyAuthDefault ¶
func WithDummyAuthDefault(b bool) ServerOption
func WithDummyAuthUsers ¶
func WithDummyAuthUsers(users ...storage.User) ServerOption
func WithOIDCConfig ¶
func WithOIDCConfig(oidc OIDCConfig) ServerOption
func WithPort ¶
func WithPort(port int) ServerOption
Source Files ¶
Click to show internal directories.
Click to hide internal directories.