Documentation
¶
Index ¶
- Constants
- func ACMEDNSEndpoint(project, environment string) string
- 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 CertificatesEndpoint(domain 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 ImageExportEndpoint(image string, expectedImageID ...string) string
- func ImageImportEndpoint(image string, expectedImageID ...string) string
- func ImageInspectEndpoint(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 ParseACMEDNSError(server string, err error) error
- func ProxyFileEndpoint(name string) string
- func RequestJSON(client any, socket string, method string, endpoint string, value any) (string, error)
- func RequestJSONWithContext(ctx context.Context, client any, socket string, method string, endpoint string, ...) (string, error)
- func RequestJSONWithTimeout(client any, socket string, method string, endpoint string, value any, ...) (string, error)
- func RequestJSONWithTimeoutContext(ctx context.Context, client any, socket string, method string, endpoint string, ...) (string, error)
- func RequireCapability(ctx context.Context, client any, socket string, server string, required string, ...) error
- func ScopedCertificatesEndpoint(project, environment, domain string) string
- func ScopedImageBuildEndpoint(project, environment, image string, dockerfile ...string) string
- func ScopedImageBuildEndpointWithAuth(project, environment, image string, dockerfile ...string) string
- func ScopedImageBuildEndpointWithOptions(project, environment, image, dockerfile string, withAuth bool) string
- func ScopedImageImportEndpoint(project, environment, image string, expectedImageID ...string) string
- func ScopedProxyFileEndpoint(project, environment, name string) string
- 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 any, socket string, endpoint string, stdout io.Writer, stderr io.Writer) error
- func StreamOutputWithContext(ctx context.Context, client any, socket string, endpoint string, ...) error
- func StreamRequest(client any, socket string, method string, endpoint string, reader io.Reader) (string, error)
- func StreamRequestOutputWithContext(ctx context.Context, client any, socket string, method string, endpoint string, ...) error
- func StreamRequestWithContext(ctx context.Context, client any, socket string, method string, endpoint string, ...) (string, error)
- func WithOperationFence(ctx context.Context, fence *nodeidentity.OperationFence) context.Context
- func WithOperationFenceSource(ctx context.Context, source OperationFenceSource) context.Context
- type ACMECompletedCertificate
- type ACMECompletedOperation
- type ACMEOperationError
- type AgentClient
- func (c *AgentClient) CloseIdleConnections()
- func (c *AgentClient) DialUnixSocket(ctx context.Context, _ string) (net.Conn, error)
- func (c *AgentClient) RequestJSON(ctx context.Context, method string, endpoint string, value any) (string, error)
- func (c *AgentClient) RequestJSONWithTimeout(ctx context.Context, method string, endpoint string, value any, ...) (string, error)
- func (c *AgentClient) SetOperationFenceSource(source OperationFenceSource)
- func (c *AgentClient) Status(ctx context.Context) (*AgentStatus, error)
- func (c *AgentClient) StreamOutput(ctx context.Context, method string, endpoint string, input io.Reader, ...) error
- func (c *AgentClient) StreamRequest(ctx context.Context, method string, endpoint string, input io.Reader, ...) (string, error)
- func (c *AgentClient) UpgradeStream(ctx context.Context, endpoint string, value any) (*UpgradedStream, error)
- type AgentStatus
- type CapabilityRequiredError
- type HTTPError
- type LocalUnixSocketDialer
- type OperationFenceSource
- type RequestExecutor
- type StreamExecutor
- type UnixSocketDialer
- type UpgradedStream
Constants ¶
const ( DefaultSocket = "/run/tako/takod.sock" DefaultWorkerSocket = "/run/tako-platform/worker.sock" )
const ( JSONRequestTimeout = 2 * time.Minute StreamRequestTimeout = 30 * time.Minute )
const ACMEDNSRequestTimeout = 5 * time.Minute
Variables ¶
This section is empty.
Functions ¶
func ACMEDNSEndpoint ¶ added in v0.9.3
func AccessLogsEndpoint ¶
func ActualStateEndpoint ¶
func BackupsEndpoint ¶
func CertificatesEndpoint ¶ added in v0.9.2
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 ImageExportEndpoint ¶ added in v0.10.0
func ImageImportEndpoint ¶ added in v0.10.0
func ImageInspectEndpoint ¶ added in v0.10.0
func JobsApplyEndpoint ¶ added in v0.8.0
func JobsApplyEndpoint() string
ExecEndpoint returns the takod exec endpoint path.
func LeaseEndpoint ¶
func LogsEndpoint ¶
func MetricsEndpoint ¶
func ParseACMEDNSError ¶ added in v0.9.3
ParseACMEDNSError converts a structured takod error response into a stable typed error. Non-ACME and malformed responses retain their original type.
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 RequireCapability ¶ added in v0.9.2
func RequireCapability(ctx context.Context, client any, socket string, server string, required string, feature string) error
RequireCapability reads /v1/status and fails closed before a caller sends a payload or invokes an endpoint an older node would silently ignore.
func ScopedCertificatesEndpoint ¶ added in v0.10.0
func ScopedImageBuildEndpoint ¶ added in v0.10.0
func ScopedImageBuildEndpointWithAuth ¶ added in v0.10.0
func ScopedImageBuildEndpointWithOptions ¶ added in v0.10.0
func ScopedImageImportEndpoint ¶ added in v0.10.0
func ScopedProxyFileEndpoint ¶ added in v0.10.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 any, 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.
func StreamRequestWithContext ¶ added in v0.7.0
func WithOperationFence ¶ added in v0.10.0
func WithOperationFence(ctx context.Context, fence *nodeidentity.OperationFence) context.Context
WithOperationFence binds the controller-signed mutation authority to every structured request issued with the returned context.
func WithOperationFenceSource ¶ added in v0.10.0
func WithOperationFenceSource(ctx context.Context, source OperationFenceSource) context.Context
Types ¶
type ACMECompletedCertificate ¶ added in v0.9.3
type ACMECompletedOperation ¶ added in v0.9.3
type ACMECompletedOperation struct {
Domain string `json:"domain"`
Action string `json:"action"`
Certificate ACMECompletedCertificate `json:"certificate"`
}
type ACMEOperationError ¶ added in v0.9.3
type ACMEOperationError struct {
Server string
Code string
Domain string
RetryAfter time.Time
Completed []ACMECompletedOperation
Err error
}
ACMEOperationError preserves takod's issuance classification so a control plane can distinguish local cooldown and CA rate-limit responses from other deployment failures.
func (*ACMEOperationError) Error ¶ added in v0.9.3
func (e *ACMEOperationError) Error() string
func (*ACMEOperationError) Unwrap ¶ added in v0.9.3
func (e *ACMEOperationError) Unwrap() error
type AgentClient ¶ added in v0.10.0
type AgentClient struct {
// contains filtered or unexported fields
}
AgentClient sends structured HTTP directly to a takod Unix socket. Dialer may open a local Unix socket or an SSH direct-streamlocal channel; callers do not compose shell or curl commands.
func NewAgentClient ¶ added in v0.10.0
func NewAgentClient(dialer UnixSocketDialer, socket string) (*AgentClient, error)
NewAgentClient constructs a reusable structured takod client.
func NewLocalAgentClient ¶ added in v0.10.0
func NewLocalAgentClient(socket string) (*AgentClient, error)
NewLocalAgentClient constructs a direct, shell-free local takod client.
func NewLocalAgentClientForUID ¶ added in v0.10.0
func NewLocalAgentClientForUID(socket string, expectedUID uint32) (*AgentClient, error)
NewLocalAgentClientForUID authenticates a non-root protected worker ingress by its persisted operating-system UID.
func (*AgentClient) CloseIdleConnections ¶ added in v0.10.0
func (c *AgentClient) CloseIdleConnections()
CloseIdleConnections releases reusable local or SSH streamlocal channels.
func (*AgentClient) DialUnixSocket ¶ added in v0.10.0
DialUnixSocket exposes the client's already-authorized transport for protocol upgrades. The requested path is intentionally ignored: transport selection has already bound this client to either the protected worker ingress or the legacy takod socket, and a caller must not be able to bypass that decision by supplying a different path.
func (*AgentClient) RequestJSON ¶ added in v0.10.0
func (c *AgentClient) RequestJSON(ctx context.Context, method string, endpoint string, value any) (string, error)
RequestJSON performs a structured takod request and returns its response body. It preserves the existing HTTPError taxonomy without shell status markers.
func (*AgentClient) RequestJSONWithTimeout ¶ added in v0.10.0
func (c *AgentClient) RequestJSONWithTimeout(ctx context.Context, method string, endpoint string, value any, timeout time.Duration) (string, error)
RequestJSONWithTimeout is RequestJSON with an explicit request deadline.
func (*AgentClient) SetOperationFenceSource ¶ added in v0.10.0
func (c *AgentClient) SetOperationFenceSource(source OperationFenceSource)
SetOperationFenceSource supplies a request-time fallback for helpers that predate context-aware takod calls. An explicit context fence takes priority.
func (*AgentClient) Status ¶ added in v0.10.0
func (c *AgentClient) Status(ctx context.Context) (*AgentStatus, error)
Status returns and validates the immutable installation identity exposed by takod. A malformed identity cannot authorize a local transport decision.
func (*AgentClient) StreamOutput ¶ added in v0.10.0
func (c *AgentClient) StreamOutput(ctx context.Context, method string, endpoint string, input io.Reader, contentType string, output io.Writer, errorOutput io.Writer) error
StreamOutput performs a request and copies its response live to output. A non-success response is copied to errorOutput and returned as HTTPError.
func (*AgentClient) StreamRequest ¶ added in v0.10.0
func (c *AgentClient) StreamRequest(ctx context.Context, method string, endpoint string, input io.Reader, contentType string) (string, error)
StreamRequest sends input without buffering and returns a bounded response.
func (*AgentClient) UpgradeStream ¶ added in v0.10.0
func (c *AgentClient) UpgradeStream(ctx context.Context, endpoint string, value any) (*UpgradedStream, error)
UpgradeStream opens a structured upgraded takod connection using the same dialer and socket as normal requests.
type AgentStatus ¶ added in v0.10.0
type AgentStatus struct {
Runtime string `json:"runtime"`
Version string `json:"version"`
UpgradeProtocol int `json:"upgradeProtocol"`
MinimumUpgradeProtocol int `json:"minimumUpgradeProtocol"`
Capabilities []string `json:"capabilities,omitempty"`
Hostname string `json:"hostname"`
Identity *nodeidentity.Identity `json:"identity,omitempty"`
EnrollmentRoles []string `json:"enrollmentRoles,omitempty"`
Membership *nodeidentity.InventoryNode `json:"membership,omitempty"`
MembershipGeneration uint64 `json:"membershipGeneration,omitempty"`
}
AgentStatus contains the installation-level fields used to authenticate a local transport decision. Mutable project/environment metadata is intentionally not part of this trust decision.
func (AgentStatus) Validate ¶ added in v0.10.0
func (s AgentStatus) Validate() error
Validate defensively checks a status value before it is used as identity attestation. Callers must not rely on a particular IdentityProbe having obtained the value through AgentClient.Status.
type CapabilityRequiredError ¶ added in v0.9.2
CapabilityRequiredError rejects an operation before mutation when a target node agent does not advertise a capability required by the request.
func (*CapabilityRequiredError) Error ¶ added in v0.9.2
func (e *CapabilityRequiredError) Error() string
type HTTPError ¶ added in v0.9.2
HTTPError preserves a non-success takod response status so command adapters can map rejected input to their typed machine error taxonomy.
func (*HTTPError) HTTPStatus ¶ added in v0.10.0
HTTPStatus allows durable operation adapters to distinguish a known upstream HTTP rejection from an uncertain transport failure.
type LocalUnixSocketDialer ¶ added in v0.10.0
type LocalUnixSocketDialer struct {
// ExpectedUID is the operating-system UID that must own the connected
// takod process. The zero value intentionally requires root.
ExpectedUID uint32
}
LocalUnixSocketDialer opens a Unix socket in the current network namespace.
func (LocalUnixSocketDialer) DialUnixSocket ¶ added in v0.10.0
type OperationFenceSource ¶ added in v0.10.0
type OperationFenceSource interface {
OperationFence() *nodeidentity.OperationFence
}
OperationFenceSource returns the latest renewed controller fence at request time. RemoteLeaseSet implements this so long operations do not keep sending the signature from their initial lease window.
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.