package module
v0.0.0-...-82f96e9 Latest Latest

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 17 Imported by: 0




This section is empty.


View Source
var (
	ErrMissPrivateKey            = errors.New("certificate: private key miss")
	ErrMissPublicKey             = errors.New("certificate: public key miss")
	ErrNotEffective              = errors.New("certificate: is not effective yet")
	ErrExpired                   = errors.New("certificate: has been expired")
	ErrKeyPairTypeNotMatch       = errors.New("certificate: private key type does not match public key type")
	ErrKeyPairNotMatch           = errors.New("certificate: private key does not match public key")
	ErrUnknownPublicKeyAlgorithm = errors.New("certificate: unknown public key algorithm")
	ErrUnknownPrivateKeyType     = errors.New("certificate: unknown private key type")


func GetCertificate

func GetCertificate(data []byte) (*tls.Certificate, error)

func GetCertificateBytes

func GetCertificateBytes(tlscert *tls.Certificate) ([]byte, error)


type Server

type Server struct {
	// contains filtered or unexported fields

func New

func New(options ServerOptions) *Server

func (*Server) Logger

func (s *Server) Logger(log *log.Logger)

Logger 设置logger

func (*Server) Quit

func (s *Server) Quit()

Quit 主动退出

func (*Server) Serve

func (s *Server) Serve(ctx context.Context, mux http.Handler) error

Serve 开始服务

func (*Server) WaitForExit

func (s *Server) WaitForExit(ctx context.Context)

WaitForExit 等待退出

type ServerOptions

type ServerOptions struct {
	Listen string
	HTTPS  struct {
		Enabled     bool
		Listen      string
		SSLRedirect bool
		HSTS        bool
		CertFile    string
		Auto        bool
		Domains     []string
		CertDIR     string
		Email       string

type Wait

type Wait struct {
	// contains filtered or unexported fields

func (*Wait) Add

func (w *Wait) Add(delta int)

func (*Wait) Done

func (w *Wait) Done()

func (*Wait) Set

func (w *Wait) Set(count int)

func (*Wait) Wait

func (w *Wait) Wait(ctx context.Context)

Jump to

Keyboard shortcuts

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