svcproxy

package
v1.40.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package svcproxy provides an HTTP proxy which allows the daemon to serve HTTP requests on behalf of services within the app and forward then to the appropriate process.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SvcProxy

type SvcProxy struct {
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, logger zerolog.Logger) (*SvcProxy, error)

New creates a new service proxy and it starts listening on a random port

You must call Close() on the returned service proxy when you are done with it.

func (*SvcProxy) Close

func (p *SvcProxy) Close()

Close stops running the service proxy

func (*SvcProxy) RegisterGateway

func (p *SvcProxy) RegisterGateway(name string, addr netip.AddrPort) string

func (*SvcProxy) RegisterService

func (p *SvcProxy) RegisterService(name string, addr netip.AddrPort) string

RegisterService registers a service with the proxy and returns the BaseURL to be used to access the service.

func (*SvcProxy) ServeHTTP

func (p *SvcProxy) ServeHTTP(w http.ResponseWriter, req *http.Request)

ServeHTTP implements the http.Handler interface

Jump to

Keyboard shortcuts

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