healthprobe

package
v1.28.2 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServerNameEnv = "HEALTHCHECK_SERVER_NAME"
	CACertFileEnv = "HEALTHCHECK_CA_CERT_FILE"

	DefaultMaxBodyBytes int64 = 64 << 10
)

Variables

View Source
var (
	ErrBodyTooLarge     = errors.New("healthprobe: response body exceeds limit")
	ErrHostNotAllowed   = errors.New("healthprobe: host not in allowlist")
	ErrPrivateNetwork   = errors.New("healthprobe: target resolves to a private or loopback address")
	ErrTooManyRedirects = errors.New("healthprobe: too many redirects")
)

Functions

func CheckURL

func CheckURL(rawURL string) error

https는 H3(QUIC)로, http는 HTTP/1.1로 1회 GET 후 2xx 여부를 검사한다.

func CheckURLInternal

func CheckURLInternal(rawURL string) error

func FetchURL

func FetchURL(rawURL string) ([]byte, error)

func FetchURLInternal

func FetchURLInternal(rawURL string) ([]byte, error)

func FetchURLWithHeadersInternal

func FetchURLWithHeadersInternal(rawURL string, headers map[string]string) ([]byte, error)

func RunMain

func RunMain(args []string, stdout, stderr io.Writer) int

RunMain은 헬스체크 CLI 진입점이다. args는 os.Args(프로그램명 포함)이며 프로세스 종료 코드를 반환한다. CLI는 운영자가 통제하는 자기 서비스 loopback/내부망 probe라 SSRF 기본 차단을 우회한다.

Types

type FetchOptions

type FetchOptions struct {
	AllowedHosts             []string
	AllowPrivateNetworks     bool
	MaxBodyBytes             int64
	FollowRedirects          bool
	ForwardHeadersOnRedirect bool
}

Jump to

Keyboard shortcuts

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