Documentation
¶
Overview ¶
Package chpolicy stores the process-wide ClickHouse dial policy that clickhousequery.SetDialPolicy installs and the driver's dialer reads.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Install ¶
Install validates p and makes it the process policy. It fails when a policy is already installed.
func ResetForTest ¶
func ResetForTest()
ResetForTest clears the installed policy, so the install-once check holds under go test -count=N. It panics outside a test binary, so production code can never clear the dial policy.
Types ¶
type Policy ¶
type Policy struct {
Blocked []netip.Prefix
// AllowLoopback admits loopback answers. Test builds only.
AllowLoopback bool
// AllowPlainHTTP admits secure=false. Test builds only.
AllowPlainHTTP bool
}
Policy holds the operator block list and two relaxations for test builds only. Production code never sets AllowLoopback or AllowPlainHTTP.
Click to show internal directories.
Click to hide internal directories.