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 ¶
const Binary = "cloudflared"
Binary is the executable devrun shells out to.
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 ¶
var ErrNotInstalled = errors.New("cloudflared is not installed")
ErrNotInstalled is returned by Find when the binary is not on PATH.
Functions ¶
func Find ¶
Find locates the cloudflared binary. The error names both forks rather than assuming the user wants to install anything.
func FirstLine ¶
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 ¶
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 ¶
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.