router

package
v0.6.76 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: AGPL-3.0, Apache-2.0, MIT Imports: 17 Imported by: ? 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 router reaches devbox daemons through Substrate's atenet-router: gRPC (devbox.v1.Daemon) and HTTP (terminal, VNC and preview WebSockets) over mTLS, with the target actor in the ate-target-actor header. A request to a suspended actor resumes it, so callers check the instance state first.

Index

Constants

View Source
const (
	// TargetHeader selects the actor, as "<atespace>/<name>".
	TargetHeader = "ate-target-actor"
	// DefaultAddress is atenet-router's in-cluster HTTPS Service.
	DefaultAddress = "atenet-router.ate-system.svc:443"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Address is host:port, DefaultAddress when empty.
	Address string
	// CredentialBundle is a PEM file with the gateway's pod-identity key and certificate chain
	// (podidentity.podcert.ate.dev/credential-bundle.pem). Re-read on every handshake.
	CredentialBundle string
	// TrustBundle verifies the router's serving certificate (servicedns-ca.podcert.ate.dev/trust-bundle.pem).
	TrustBundle string
	// ServerName overrides the TLS server name, the Address host by default.
	ServerName string
	// Insecure dials without TLS (tests and local development).
	Insecure bool
}

Config locates atenet-router and the gateway's identity.

type Router

type Router struct {
	// contains filtered or unexported fields
}

Router is a connection to atenet-router.

func Dial

func Dial(cfg Config) (*Router, error)

Dial connects to atenet-router.

func New

func New(conn grpc.ClientConnInterface, rt http.RoundTripper, baseURL string) *Router

New wraps an existing connection and HTTP transport (tests).

func (*Router) Close

func (r *Router) Close() error

func (*Router) Daemon

func (r *Router) Daemon(actor string) devboxv1.DaemonClient

Daemon returns a client for the daemon of an actor ("<atespace>/<name>"). Calls carry the request token of the incoming call they serve, if any.

func (*Router) NewRequest

func (r *Router) NewRequest(ctx context.Context, actor, method, pathAndQuery string) (*http.Request, error)

NewRequest builds an HTTP request to an actor's daemon; send it with RoundTrip.

func (*Router) RoundTrip

func (r *Router) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip sends a request built by NewRequest.

Jump to

Keyboard shortcuts

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