gateway

package
v0.0.0-...-b496eca Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Overview

Package gateway implements the HTTP gateway for Horizon. It is implemented as a library to allow for easy customisation.

templ: version: v0.2.747

templ: version: v0.2.747

templ: version: v0.2.747

Index

Constants

View Source
const HeaderNamespace = "Hz-Namespace"

Variables

View Source
var (
	IconCodeBracketSquare = "code-bracket-square"
	IconComputerDesktop   = "computer-desktop"
	IconRectangleStack    = "rectangle-stack"
	IconUsers             = "users"
)

Functions

This section is empty.

Types

type DefaultHandler

type DefaultHandler struct {
	Conn *nats.Conn
}

func (*DefaultHandler) GetHome

func (d *DefaultHandler) GetHome(w http.ResponseWriter, r *http.Request)

func (*DefaultHandler) GetNamespaces

func (d *DefaultHandler) GetNamespaces(w http.ResponseWriter, r *http.Request)

func (*DefaultHandler) GetNamespacesNew

func (d *DefaultHandler) GetNamespacesNew(
	w http.ResponseWriter,
	r *http.Request,
)

func (*DefaultHandler) PostNamespaces

func (d *DefaultHandler) PostNamespaces(
	w http.ResponseWriter,
	r *http.Request,
)

type GatewayHandler

type GatewayHandler interface {
	GetHome(w http.ResponseWriter, r *http.Request)
	GetNamespaces(w http.ResponseWriter, r *http.Request)
	GetNamespacesNew(w http.ResponseWriter, r *http.Request)
	PostNamespaces(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.

func (*NATSHTTPTransport) RoundTrip

func (t *NATSHTTPTransport) RoundTrip(r *http.Request) (*http.Response, error)

type NamespaceHandler

type NamespaceHandler struct {
	Middleware chi.Middlewares
	Conn       *nats.Conn
	Auth       *auth.Auth
	Portals    map[string]hz.Portal
}

func (*NamespaceHandler) Router

func (h *NamespaceHandler) Router() *chi.Mux

type OIDCConfig

type OIDCConfig struct {
	Issuer       string
	ClientID     string
	ClientSecret string
	RedirectURL  string
	Scopes       []string
}

type ObjectsHandler

type ObjectsHandler struct {
	Conn *nats.Conn
}

type Server

type Server struct {
	Conn       *nats.Conn
	Auth       *auth.Auth
	HTTPServer *http.Server
	// contains filtered or unexported fields
}

func Start

func Start(
	ctx context.Context,
	conn *nats.Conn,
	auth *auth.Auth,
	opts ...ServerOption,
) (*Server, error)

func (*Server) Close

func (s *Server) Close() error

type ServerOption

type ServerOption func(*serverOptions)

func WithDummyAuthUsers

func WithDummyAuthUsers(users ...storage.User) ServerOption

func WithOIDCConfig

func WithOIDCConfig(oidc OIDCConfig) ServerOption

func WithPort

func WithPort(port int) ServerOption

Directories

Path Synopsis
Package dummyoidc provides a dummy OIDC server/provider for dev and testing purposes.
Package dummyoidc provides a dummy OIDC server/provider for dev and testing purposes.

Jump to

Keyboard shortcuts

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