Thanks to visit codestin.com
Credit goes to pkg.go.dev

cliutil

package
v2.21.3 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2025 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const AWSIPRangesURL = "https://ip-ranges.amazonaws.com/ip-ranges.json"

Variables

This section is empty.

Functions

func DiscardAfterClose

func DiscardAfterClose(wc io.WriteCloser) io.WriteCloser

DiscardAfterClose is an io.WriteCloser that discards writes after it is closed without errors. It is useful as a target for a slog.Sink such that an underlying WriteCloser, like a file, can be cleaned up without race conditions from still-active loggers.

func Hostname added in v2.5.0

func Hostname() string

Hostname returns the hostname of the machine, lowercased, with any trailing domain suffix stripped. It is cached after the first call. If the hostname cannot be determined, for any reason, localhost will be returned instead.

func WarnMatchedProvisioners added in v2.18.1

func WarnMatchedProvisioners(w io.Writer, mp *codersdk.MatchedProvisioners, job codersdk.ProvisionerJob)

WarnMatchedProvisioners warns the user if there are no provisioners that match the requested tags for a given provisioner job. If the job is not pending, it is ignored.

Types

type AWSIPRanges added in v2.15.0

type AWSIPRanges struct {
	V4 []netip.Prefix
	V6 []netip.Prefix
}

func FetchAWSIPRanges added in v2.15.0

func FetchAWSIPRanges(ctx context.Context, url string) (*AWSIPRanges, error)

func (*AWSIPRanges) CheckIP added in v2.15.0

func (r *AWSIPRanges) CheckIP(ip netip.Addr) bool

CheckIP checks if the given IP address is an AWS IP.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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