Movatterモバイル変換


[0]ホーム

URL:


cliutil

package
v2.24.2Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2025 License:AGPL-3.0Imports:14Imported by:0

Details

Repository

github.com/coder/coder

Links

Documentation

Index

Constants

View Source
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.

funcHostnameadded 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.

funcNewLicenseFormatteradded inv2.24.0

func NewLicenseFormatter() *cliui.OutputFormatter

NewLicenseFormatter returns a new license formatter.The formatter will return a table and JSON output.

funcWarnMatchedProvisionersadded 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

typeAWSIPRangesadded inv2.15.0

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

funcFetchAWSIPRangesadded inv2.15.0

func FetchAWSIPRanges(ctxcontext.Context, urlstring) (*AWSIPRanges,error)

func (*AWSIPRanges)CheckIPadded inv2.15.0

func (r *AWSIPRanges) CheckIP(ipnetip.Addr)bool

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

typeQueueadded 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.

funcNewQueueadded inv2.24.0

func NewQueue[Tany](sizeint) *Queue[T]

NewQueue creates a queue with the given size.

func (*Queue[T])Closeadded inv2.24.0

func (q *Queue[T]) Close()

Close aborts any pending pops and makes future pushes error.

func (*Queue[T])Lenadded inv2.24.0

func (q *Queue[T]) Len()int

func (*Queue[T])Popadded inv2.24.0

func (q *Queue[T]) Pop() (T,bool)

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])Pushadded inv2.24.0

func (q *Queue[T]) Push(x T)error

Push adds an item to the queue. If closed, returns an error.

func (*Queue[T])WithPredicateadded inv2.24.0

func (q *Queue[T]) WithPredicate(pred func(x T) (T,bool)) *Queue[T]

WithPredicate adds the given predicate function, which can control what ispushed to the queue.

typeStatusQueueadded 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)Pushadded inv2.24.0

func (q *StatusQueue) Push(report reportTask)error

Source Files

View all Source files

Directories

PathSynopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp