inspect

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CertInfoJSON

func CertInfoJSON(info *CertInfo) ([]byte, error)

func URLInfoJSON

func URLInfoJSON(info *URLInfo) ([]byte, error)

URLInfoJSON returns the URL info as formatted JSON.

func URLInfoTable

func URLInfoTable(info *URLInfo) string

URLInfoTable returns a formatted table-style string.

Types

type CertInfo

type CertInfo struct {
	Subject            string    `json:"subject"`
	Issuer             string    `json:"issuer"`
	NotBefore          time.Time `json:"not_before"`
	NotAfter           time.Time `json:"not_after"`
	SerialNumber       string    `json:"serial_number"`
	SignatureAlgorithm string    `json:"signature_algorithm"`
	DNSNames           []string  `json:"dns_names,omitempty"`
	IsExpired          bool      `json:"is_expired"`
}

CertInfo holds decoded X.509 certificate information.

func CertDecode

func CertDecode(input []byte) (*CertInfo, error)

type URLInfo

type URLInfo struct {
	Scheme   string              `json:"scheme"`
	Host     string              `json:"host"`
	Port     string              `json:"port,omitempty"`
	Path     string              `json:"path,omitempty"`
	Query    map[string][]string `json:"query,omitempty"`
	Fragment string              `json:"fragment,omitempty"`
	User     string              `json:"user,omitempty"`
}

URLInfo holds parsed URL components.

func ParseURL

func ParseURL(input string) (*URLInfo, error)

ParseURL parses a URL string into its components.

Jump to

Keyboard shortcuts

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