socket

package
v0.0.0-...-092e436 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Overview

Package socket provides primitives for running HTTP over unix domain sockets transport.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUniquePath

func GetUniquePath(prefix string) (string, error)

GetUniquePath returns path that has nothing on it.

func ProxyHTTP

func ProxyHTTP(socketPath string) http.Handler

ProxyHTTP proxies all requests to the specified socket path.

Types

type HTTPServer

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

func NewHTTPServer

func NewHTTPServer(path string, h http.Handler) *HTTPServer

func (*HTTPServer) Start

func (s *HTTPServer) Start() error

Start starts a HTTP server that listens on the configured socket path.

func (*HTTPServer) Stop

func (s *HTTPServer) Stop() error

Stop releases all resources allocated by the server. It also takes care of removing the socket file from the file system.

Jump to

Keyboard shortcuts

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