httpserver

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func COPYCHAN

func COPYCHAN[T any](done <-chan struct{}, src chan T) (
	generator func() (tap chan T, destructor func()),
)

func CreateWsHandleFunc

func CreateWsHandleFunc(ctx context.Context, subsystem WsSubsystem) func(conn *websocket.Conn)

func GoogleOAUTH2

func GoogleOAUTH2(ctx context.Context) func(http.ResponseWriter, *http.Request)

TODO put this to youtube package

func RenderWidgets

func RenderWidgets(w http.ResponseWriter, r *http.Request)

Types

type BaseWidget

type BaseWidget interface{ Base() *widget.BaseWidget }

type HTTPServer

type HTTPServer struct {
	Server             *http.Server
	HandlersToRegister map[string]http.Handler
}

func New

func New(ctx context.Context) (*HTTPServer, error)

func (*HTTPServer) GetBaseUrl

func (s *HTTPServer) GetBaseUrl(host string) string

func (*HTTPServer) InitStage1

func (s *HTTPServer) InitStage1(ctx context.Context) error

func (*HTTPServer) Mux

func (s *HTTPServer) Mux(ctx context.Context) http.Handler

func (*HTTPServer) RegisterHandler

func (s *HTTPServer) RegisterHandler(path string, handler http.Handler)

type LoggingHandler

type LoggingHandler struct{ http.Handler }

func (*LoggingHandler) ServeHTTP

func (h *LoggingHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type WsSubsystem

type WsSubsystem interface {
	Dispatch(ctx context.Context, b string) error // receive event from obs browser html
	SendChan() chan string                        // channel from server to page
}

WsSubsystem - subsystem with chan for websocket

Jump to

Keyboard shortcuts

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