service

package
v0.0.0-...-724bf7d Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HostPattern

type HostPattern string

HostPattern hostname pattern type

func (HostPattern) Match

func (p HostPattern) Match(v string) bool

Match check if given hostname match host

type Hosts

type Hosts struct {
	Patterns []HostPattern
}

Hosts hostname list middleware struct

func (Hosts) ServeMiddleware

func (h Hosts) ServeMiddleware(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)

ServeMiddleware server hostname list middleware

type ListenerConfig

type ListenerConfig struct {
	//Net net interface,"tcp" for example.
	Net string
	//Addr network addr.
	Addr string
}

ListenerConfig listener config struct

func (*ListenerConfig) Clone

func (c *ListenerConfig) Clone() *ListenerConfig

func (*ListenerConfig) Listen

func (c *ListenerConfig) Listen() (net.Listener, error)

Listen listen net and addr in config. Return net listener and any error if raised.

type ListenerOption

type ListenerOption interface {
	Listen() (net.Listener, error)
}

ListenerOption listener option

type TLSConfig

type TLSConfig struct {
	//TLS whether use tls
	TLS bool
	//TLSCertPath tls cert file path
	TLSCertPath string
	//TLSKeyPath tls key file path
	TLSKeyPath string
}

TLSConfig tls config

func (*TLSConfig) Clone

func (c *TLSConfig) Clone() *TLSConfig

func (*TLSConfig) ServerIsTLSEnabeld

func (c *TLSConfig) ServerIsTLSEnabeld() bool

ServerIsTLSEnabeld return is server tls enabled

func (*TLSConfig) ServerTLSCertPath

func (c *TLSConfig) ServerTLSCertPath() string

ServerTLSCertPath return server tls cert path

func (*TLSConfig) ServerTLSKeyPath

func (c *TLSConfig) ServerTLSKeyPath() string

ServerTLSKeyPath resturn serve tls key path

type TLSOption

type TLSOption interface {
	//ServerIsTLSEnabeld return is server tls enabled
	ServerTLSEnabeld() bool
	//ServerTLSCertPath return server tls cert path
	ServerTLSCertPath() string
	//ServerTLSKeyPath resturn serve tls key path
	ServerTLSKeyPath() string
}

TLSOption server tls option interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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