Documentation
¶
Index ¶
- func CloneForStream(c *http.Client) *http.Client
- func ControlPlaneHTTPError(resp *http.Response) error
- func ExpandPath(path string) string
- func FollowRunRenderOptions(baseURL *url.URL, output io.Writer) runs.TextRenderOptions
- func MakeAuthenticatedRequest(ctx context.Context, method, endpoint string, body io.Reader) (*http.Request, error)
- func ParseFlagSet(fs *flag.FlagSet, args []string, printUsage func()) error
- func PrintCommandUsage(w io.Writer, parts ...string)
- func ReadFileRooted(path string) ([]byte, error)
- func ResolveControlPlaneHTTP(_ context.Context) (*url.URL, *http.Client, error)
- func ResolveControlPlaneToken() (string, error)
- func ResolveIdentityPath(v StringValue) (string, error)
- func ResolvePloydBinaryPath(v StringValue) (string, error)
- func SplitRemoteRepoSelector(selector string) (string, string)
- func SupportsOSC8(w io.Writer) bool
- func ValidateFileReadable(path string) error
- func ValidateSSHPort(port int) error
- func WantsHelp(args []string) bool
- type BoolValue
- type IntValue
- type ResolvedRemoteRepo
- type StringSlice
- type StringValue
- type StringsValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloneForStream ¶
cloneForStream returns a shallow copy of the provided HTTP client with Timeout disabled (0). Used for SSE calls which should not have a global client timeout.
func ControlPlaneHTTPError ¶
controlPlaneHTTPError summarises a non-2xx control-plane response.
func ExpandPath ¶
func FollowRunRenderOptions ¶
FollowRunRenderOptions returns shared render options for follow-mode output.
func MakeAuthenticatedRequest ¶
func MakeAuthenticatedRequest(ctx context.Context, method, endpoint string, body io.Reader) (*http.Request, error)
makeAuthenticatedRequest creates an HTTP request with bearer token authorization. This helper should be used for all API calls that require authentication.
func ParseFlagSet ¶
ParseFlagSet handles shared FlagSet parse behavior for CLI handlers. It prints usage via printUsage on parse errors and treats --help/-h as success.
func PrintCommandUsage ¶
PrintCommandUsage prints a simple usage header for the given command path. It intentionally mirrors the strings used by help goldens under testdata/.
func ReadFileRooted ¶
func ResolveControlPlaneHTTP ¶
ResolveControlPlaneHTTP selects the base URL and HTTP client using PLOY_SERVER_URL and PLOY_AUTH_TOKEN. Returns a client configured for bearer token authentication.
func ResolveControlPlaneToken ¶
ResolveControlPlaneToken returns the configured bearer token. It is used for rendering browser-friendly artifact links with auth_token query parameters.
func ResolveIdentityPath ¶
func ResolveIdentityPath(v StringValue) (string, error)
ResolveIdentityPath chooses a default SSH identity when not explicitly set.
func ResolvePloydBinaryPath ¶
func ResolvePloydBinaryPath(v StringValue) (string, error)
ResolvePloydBinaryPath locates the ployd binary adjacent to the CLI.
func SplitRemoteRepoSelector ¶
func SupportsOSC8 ¶
func ValidateFileReadable ¶
ValidateFileReadable checks if a file exists and is readable.
func ValidateSSHPort ¶
ValidateSSHPort checks if a port number is in a valid range.
func WantsHelp ¶
wantsHelp checks whether the given argument list represents a help request. It returns true if the sole argument is "--help" or "-h", which is the pattern used by command routers that manually parse arguments (DisableFlagParsing: true) to detect and respond to help flags before dispatching to subcommands.
Types ¶
type ResolvedRemoteRepo ¶
ResolvedRemoteRepo is the control-plane resolution of a repo selector such as namespace/repo:branch.
type StringSlice ¶
type StringSlice []string
StringSlice is a simple flag.Value for collecting repeated values.
func (*StringSlice) Set ¶
func (s *StringSlice) Set(v string) error
func (*StringSlice) String ¶
func (s *StringSlice) String() string
type StringValue ¶
StringValue implements flag.Value with a marker for whether it was set.
func (*StringValue) Set ¶
func (v *StringValue) Set(s string) error
func (*StringValue) String ¶
func (v *StringValue) String() string
type StringsValue ¶
type StringsValue struct {
Values []string
}
StringsValue implements flag.Value for accumulating multiple string flag values.
func (*StringsValue) Set ¶
func (v *StringsValue) Set(s string) error
func (*StringsValue) String ¶
func (v *StringsValue) String() string