cloudflared

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cloudflared drives the cloudflared binary. It is deliberately not a provider abstraction: there is one provider, and inventing an interface for it would be guessing at the shape of a second.

Nothing here imports cloudflared as a library, so it stays out of go.mod and out of the binary. If you never publish, it is never even looked for.

Index

Constants

View Source
const Binary = "cloudflared"

Binary is the executable devrun shells out to.

View Source
const NotInstalledHelp = `` /* 370-byte string literal not displayed */

NotInstalledHelp is the guidance that goes with ErrNotInstalled. It names both ways forward, because installing cloudflared is only one of them: publishing is optional, and the gateway is an ordinary HTTP server that anything can front.

Variables

View Source
var ErrNotInstalled = errors.New("cloudflared is not installed")

ErrNotInstalled is returned by Find when the binary is not on PATH.

Functions

func Find

func Find() (string, error)

Find locates the cloudflared binary. The error names both forks rather than assuming the user wants to install anything.

func FirstLine

func FirstLine(s string) string

FirstLine is the opening non-blank line of some output — where a failing process says why, ahead of any stack or fallout. Shared because the daemon reads cloudflared's log and the gateway child's stderr the same way.

func HasTunnel

func HasTunnel(ctx context.Context, bin, name string) (found, known bool)

HasTunnel reports whether name is one of the account's tunnels, and whether the question could be answered at all. A false "known" means unverified — not absent.

func List

func List(ctx context.Context, bin string) ([]string, error)

List returns the names of the account's tunnels.

It makes an authenticated API call using ~/.cloudflared/cert.pem, so it fails for anyone who has not run `cloudflared tunnel login`. That is not a reason to block: callers use this to catch a typo before cloudflared does, and an unverifiable name should go through unchecked rather than stop a publish. Every failure is reported as an error for the caller to degrade on.

Types

This section is empty.

Jump to

Keyboard shortcuts

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