Documentation
¶
Index ¶
- Constants
- func AccessLogsEndpoint(tail int, follow bool) string
- func ActualStateEndpoint(project string, environment string) string
- func BackupsEndpoint(project string, environment string, volume string, backupID string) string
- func DiscoveryExportsEndpoint(environment string) string
- func EnvBundleEndpoint(project string, environment string) string
- func ExecEndpoint() string
- func ImageBuildEndpoint(image string, dockerfile ...string) string
- func ImageBuildEndpointWithAuth(image string, dockerfile ...string) string
- func ImageBuildEndpointWithOptions(image string, dockerfile string, withAuth bool) string
- func ImageExistsEndpoint(image string) string
- func JobsApplyEndpoint() string
- func LeaseEndpoint(project string, environment string) string
- func LogsEndpoint(project string, environment string, service string, tail int, follow bool) string
- func MetricsEndpoint(collect bool) string
- func ProxyFileEndpoint(name string) string
- func RequestJSON(client RequestExecutor, socket string, method string, endpoint string, ...) (string, error)
- func RequestJSONWithContext(ctx context.Context, client RequestExecutor, socket string, method string, ...) (string, error)
- func RequestJSONWithTimeout(client RequestExecutor, socket string, method string, endpoint string, ...) (string, error)
- func RequestJSONWithTimeoutContext(ctx context.Context, client RequestExecutor, socket string, method string, ...) (string, error)
- func StateEndpoint(project string, environment string, document string) string
- func StateNodeEndpoint(project string, environment string, document string, node string) string
- func StateRevisionEndpoint(project string, environment string, document string, revisionID string) string
- func StatsEndpoint(project string, environment string, service string, all bool) string
- func StreamOutput(client StreamExecutor, socket string, endpoint string, stdout io.Writer, ...) error
- func StreamOutputWithContext(ctx context.Context, client StreamExecutor, socket string, endpoint string, ...) error
- func StreamRequest(client RequestExecutor, socket string, method string, endpoint string, ...) (string, error)
- func StreamRequestOutputWithContext(ctx context.Context, client StreamExecutor, socket string, method string, ...) error
- func StreamRequestWithContext(ctx context.Context, client RequestExecutor, socket string, method string, ...) (string, error)
- type RequestExecutor
- type StreamExecutor
- type UnixSocketDialer
- type UpgradedStream
Constants ¶
const ( JSONRequestTimeout = 2 * time.Minute StreamRequestTimeout = 30 * time.Minute )
const DefaultSocket = "/run/tako/takod.sock"
Variables ¶
This section is empty.
Functions ¶
func AccessLogsEndpoint ¶
func ActualStateEndpoint ¶
func BackupsEndpoint ¶
func DiscoveryExportsEndpoint ¶ added in v0.4.35
func EnvBundleEndpoint ¶
func ExecEndpoint ¶ added in v0.8.0
func ExecEndpoint() string
func ImageBuildEndpoint ¶
func ImageBuildEndpointWithAuth ¶ added in v0.8.0
ImageBuildEndpointWithAuth marks the build request body as carrying a registry-auth JSON preamble line ahead of the tar stream. The flag is the only auth-related value in the URL; credentials ride the body.
func ImageBuildEndpointWithOptions ¶
ImageBuildEndpointWithOptions marks the body as carrying a JSON options preamble before the build-context archive. Build arg values stay out of URLs.
func ImageExistsEndpoint ¶ added in v0.5.4
func JobsApplyEndpoint ¶ added in v0.8.0
func JobsApplyEndpoint() string
ExecEndpoint returns the takod exec endpoint path.
func LeaseEndpoint ¶
func LogsEndpoint ¶
func MetricsEndpoint ¶
func ProxyFileEndpoint ¶
func RequestJSON ¶
func RequestJSONWithContext ¶ added in v0.7.0
func RequestJSONWithTimeout ¶ added in v0.4.1
func RequestJSONWithTimeoutContext ¶ added in v0.7.0
func StateNodeEndpoint ¶
func StateRevisionEndpoint ¶
func StatsEndpoint ¶
func StreamOutput ¶
func StreamOutputWithContext ¶ added in v0.7.0
func StreamRequest ¶
func StreamRequestOutputWithContext ¶ added in v0.8.0
func StreamRequestOutputWithContext(ctx context.Context, client StreamExecutor, socket string, method string, endpoint string, body io.Reader, stdout io.Writer, stderr io.Writer) error
StreamRequestOutputWithContext sends a request body and streams the chunked response live to stdout/stderr (no buffering, no status marker) — the POST counterpart of StreamOutputWithContext. Clients without stdin streaming get the body embedded base64-encoded in the remote command.
Types ¶
type RequestExecutor ¶
type StreamExecutor ¶
type UnixSocketDialer ¶ added in v0.8.1
type UnixSocketDialer interface {
DialUnixSocket(ctx context.Context, path string) (net.Conn, error)
}
UnixSocketDialer opens a full-duplex connection to a Unix socket on the takod node, typically through an SSH direct-streamlocal channel.
type UpgradedStream ¶ added in v0.8.1
UpgradedStream is a hijacked takod connection speaking the ptystream frame protocol. Reader buffers bytes that arrived with the handshake response; always read frames from Reader, never from Conn directly.
func UpgradeStream ¶ added in v0.8.1
func UpgradeStream(ctx context.Context, dialer UnixSocketDialer, socket string, endpoint string, value any) (*UpgradedStream, error)
UpgradeStream dials the takod socket, POSTs value to endpoint with an Upgrade: tako-pty/1 handshake, and returns the connection as a raw frame stream once the server switches protocols. A non-101 response is returned as an error carrying the response body.
func (*UpgradedStream) Close ¶ added in v0.8.1
func (s *UpgradedStream) Close() error
Close closes the underlying connection.