util

package
v0.0.0-...-1a24cbd Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package util 生成Http响应内容

Package util 正则化处理

Package util tls 配置处理

Package util

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateCaCertificate

func GenerateCaCertificate(rootCrt *tls.Certificate, host string) (*tls.Certificate, error)

GenerateCaCertificate 生成Ca证书 tls 配置生成 参考 github.com/ouqiang/goproxy

func GenerateCert

func GenerateCert(fileType string, organization string, country string, province string, locality string, organizationalUnit string, commonName string, dnsDomain string)

GenerateCert 生成根证书

func GenerateTlsConfig

func GenerateTlsConfig(host string) (*tls.Config, error)

GenerateTlsConfig 生成tls配置

func HttpContext

func HttpContext(data string) []byte

HttpContext 生成http响应

func LoadCertificateTls

func LoadCertificateTls(crtPath string, keyPath string) (*tls.Certificate, error)

LoadCertificateTls 加载证书 通过tls.load加载证书

func LoadCertificateX509Data

func LoadCertificateX509Data(crtPath string, keyPath string) (*x509.Certificate, string, error)

LoadCertificateX509Data 加载证书私钥数据 通过os加载证书数据

func NewRequest

func NewRequest(r *http.Request) (*http.Request, error)

func ResponseToBytes

func ResponseToBytes(response *http.Response) ([]byte, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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