Documentation
¶
Overview ¶
package tnl publishes an application-owned HTTP handler as an ephemeral service.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrPublisherScope = publisheridentity.ErrScope
var ErrPublisherSelection = publisheridentity.ErrSelection
Functions ¶
This section is empty.
Types ¶
type ExportedCertificate ¶
type ExportedCertificate struct {
Certificate ServiceCertificate
ExpiresAt time.Time
}
func (ExportedCertificate) GoString ¶
func (ExportedCertificate) GoString() string
func (ExportedCertificate) String ¶
func (ExportedCertificate) String() string
type Options ¶
type Options struct {
// Certificate supplies visitor TLS material; nil selects managed issuance.
// the callback is polled for replacement and must honor cancellation.
Certificate func(context.Context) (ServiceCertificate, error)
// NoTelemetry opts this publication out without changing saved preferences.
NoTelemetry bool
RequirePostQuantum bool
EnrollmentKey string
PublisherIdentityID string
PublisherCredentialFile string
PublisherIdentity *PublisherIdentity
ServerURL string
StateDir string
HTTPClient *http.Client
AccessMode controlv1.VisitorAccessMode
IP []string
Limits Limits
StateProtection StateProtection
// expiresat is an optional fixed service deadline, not a renewable duration.
ExpiresAt *time.Time
// Public defaults to true. set it to false for connector-only access.
Public *bool
}
type PublisherIdentity ¶
type PublisherIdentity struct {
// contains filtered or unexported fields
}
PublisherIdentity holds one signing identity and selected namespace grant. prepare it once to reuse it across independent ad-hoc invocations.
func PreparePublisherIdentity ¶
func PreparePublisherIdentity(ctx context.Context, options Options) (*PublisherIdentity, error)
PreparePublisherIdentity loads a selected namespace identity using protected local state. it closes the database before returning; Open opens its own certificate state for the duration of each publication.
type ServiceCertificate ¶
ServiceCertificate contains publisher-held PEM, never target TLS settings. returned buffers transfer to the publication owner and are cleared after use.
func (ServiceCertificate) GoString ¶
func (ServiceCertificate) GoString() string
func (ServiceCertificate) String ¶
func (ServiceCertificate) String() string
type StateProtection ¶
type StateProtection string
const ( ProtectionFile StateProtection = "file" ProtectionKeychain StateProtection = "keychain" )
type Tunnel ¶
type Tunnel struct {
// contains filtered or unexported fields
}
Tunnel owns its local listener, service run, and exact service allocation.
func Open ¶
Open binds an HTTP handler and returns after its service is routable. visitors need current permission unless AccessMode is explicitly anonymous.
func (*Tunnel) Close ¶
Close drains publication and removes the exact service. repeated calls are safe.
func (*Tunnel) Endpoint ¶
func (t *Tunnel) Endpoint() controlv1.ServiceEndpoint
Endpoint returns the service hostname, port, and reachability.
func (*Tunnel) ExportCertificate ¶
func (t *Tunnel) ExportCertificate(ctx context.Context) (ExportedCertificate, error)
ExportCertificate copies the current installed certificate and matching key. it does not fetch or renew material. the caller owns the returned buffers.