expose

package
v0.67.3 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ManagementClient

type ManagementClient interface {
	CreateExpose(ctx context.Context, req mgm.ExposeRequest) (*mgm.ExposeResponse, error)
	RenewExpose(ctx context.Context, domain string) error
	StopExpose(ctx context.Context, domain string) error
}

type Manager

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

Manager handles expose session lifecycle via the management client.

func NewManager

func NewManager(ctx context.Context, mgmClient ManagementClient) *Manager

NewManager creates a new expose Manager using the given management client.

func (*Manager) Expose

func (m *Manager) Expose(ctx context.Context, req Request) (*Response, error)

Expose creates a new expose session via the management server.

func (*Manager) KeepAlive

func (m *Manager) KeepAlive(ctx context.Context, domain string) error

KeepAlive periodically renews the expose session for the given domain until the context is canceled or an error occurs. It is part of the embed API surface and exposed via a type alias.

type ProtocolType added in v0.67.2

type ProtocolType int

ProtocolType represents the protocol used for exposing a service.

const (
	// ProtocolHTTP exposes the service as HTTP.
	ProtocolHTTP ProtocolType = 0
	// ProtocolHTTPS exposes the service as HTTPS.
	ProtocolHTTPS ProtocolType = 1
	// ProtocolTCP exposes the service as TCP.
	ProtocolTCP ProtocolType = 2
	// ProtocolUDP exposes the service as UDP.
	ProtocolUDP ProtocolType = 3
	// ProtocolTLS exposes the service as TLS.
	ProtocolTLS ProtocolType = 4
)

func ParseProtocolType added in v0.67.2

func ParseProtocolType(s string) (ProtocolType, error)

ParseProtocolType parses a protocol string into a ProtocolType.

type Request

type Request struct {
	NamePrefix string
	Domain     string
	Port       uint16
	Protocol   ProtocolType
	Pin        string
	Password   string
	UserGroups []string
	ListenPort uint16
}

Request holds the parameters for exposing a local service via the management server. It is part of the embed API surface and exposed via a type alias.

func NewRequest

func NewRequest(req *daemonProto.ExposeServiceRequest) *Request

NewRequest converts a daemon ExposeServiceRequest to a management ExposeServiceRequest.

type Response

type Response struct {
	ServiceName      string
	ServiceURL       string
	Domain           string
	PortAutoAssigned bool
}

Response holds the response from exposing a service.

Jump to

Keyboard shortcuts

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