tls

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSplitListener

func NewSplitListener(l net.Listener, config *tls.Config, logger log.Logger) net.Listener

Types

type Config

type Config struct {
	Addr string        `yaml:"address" json:"address"`
	TLS  server.Config `yaml:"tls" json:"tls"`
}

func (*Config) Validate

func (c *Config) Validate() error

type Conn

type Conn struct {
	net.Conn
	ConnectionType ConnectionType
	// contains filtered or unexported fields
}

func (*Conn) Read

func (c *Conn) Read(b []byte) (int, error)

type ConnectionType

type ConnectionType uint8
const (
	ConnectionTypeHTTP ConnectionType = iota
	ConnectionTypeTLS
)

type Server

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

Server handles gRPC requests to the service.

func New

func New(config Config, fileWatcher *fsnotify.Watcher, logger log.Logger) (*Server, error)

New instantiates a listening server. When passing addr with an unspecified port or ":", use Addr().

func (*Server) Accept

func (s *Server) Accept() (net.Conn, error)

func (*Server) AddCloseFunc

func (s *Server) AddCloseFunc(f func())

AddCloseFunc adds a function to be called by the Close method. This eliminates the need for wrapping the Server.

func (*Server) Addr

func (s *Server) Addr() net.Addr

func (*Server) Close

func (s *Server) Close() error

type SplitListener

type SplitListener struct {
	net.Listener
	// contains filtered or unexported fields
}

func (*SplitListener) Accept

func (l *SplitListener) Accept() (net.Conn, error)

Jump to

Keyboard shortcuts

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