cliutil
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Index¶
Constants¶
const AWSIPRangesURL = "https://ip-ranges.amazonaws.com/ip-ranges.json"
Variables¶
This section is empty.
Functions¶
funcDiscardAfterClose¶
func DiscardAfterClose(wcio.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, canbe cleaned up without race conditions from still-active loggers.
funcHostname¶added inv2.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.
funcNewLicenseFormatter¶added inv2.24.0
func NewLicenseFormatter() *cliui.OutputFormatter
NewLicenseFormatter returns a new license formatter.The formatter will return a table and JSON output.
funcWarnMatchedProvisioners¶added inv2.18.1
func WarnMatchedProvisioners(wio.Writer, mp *codersdk.MatchedProvisioners, jobcodersdk.ProvisionerJob)
WarnMatchedProvisioners warns the user if there are no provisioners thatmatch the requested tags for a given provisioner job.If the job is not pending, it is ignored.
Types¶
typeAWSIPRanges¶added inv2.15.0
funcFetchAWSIPRanges¶added inv2.15.0
func FetchAWSIPRanges(ctxcontext.Context, urlstring) (*AWSIPRanges,error)
typeQueue¶added inv2.24.0
type Queue[Tany] struct {// contains filtered or unexported fields}
Queue is a FIFO queue with a fixed size. If the size is exceeded, the firstitem is dropped.
func (*Queue[T])Close¶added inv2.24.0
func (q *Queue[T]) Close()
Close aborts any pending pops and makes future pushes error.
func (*Queue[T])Pop¶added inv2.24.0
Pop removes and returns the first item from the queue, waiting until there issomething to pop if necessary. If closed, returns false.
func (*Queue[T])WithPredicate¶added inv2.24.0
WithPredicate adds the given predicate function, which can control what ispushed to the queue.
typeStatusQueue¶added inv2.24.0
type StatusQueue struct {Queue[reportTask]// contains filtered or unexported fields}
statusQueue is a Queue that:1. Only pushes items that are not duplicates.2. Preserves the existing message and URI when one a message is not provided.3. Ignores "working" updates from the status watcher.
func (*StatusQueue)Push¶added inv2.24.0
func (q *StatusQueue) Push(report reportTask)error