webdav

package
v0.3.22 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package webdav discovers gowebdav servers advertised on the local network via mDNS and exposes them as transfer targets. gowebdav registers itself under the "_gowebdav._tcp" service type (see github.com/joshkerr/gowebdav), so no central registry is needed: mDNS multicast on the LAN is the registry.

Index

Constants

View Source
const (
	// ServiceType is the mDNS service type gowebdav registers under.
	ServiceType = "_gowebdav._tcp"
	// ServiceDomain is the mDNS domain used for discovery.
	ServiceDomain = "local."
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Target

type Target struct {
	Name      string   // mDNS instance name (gowebdav -name flag, or hostname)
	Host      string   // resolved hostname (e.g. "office.local.")
	Port      int      // server port
	Addresses []string // IPv4 + IPv6 addresses
	Scheme    string   // "http" or "https" (from the scheme= TXT record)
}

Target represents a gowebdav server discovered on the local network.

func Discover

func Discover(ctx context.Context, timeout time.Duration) ([]*Target, error)

Discover finds gowebdav servers on the local network, blocking until the timeout elapses. It mirrors the discovery approach used for goplexcli's own stream servers (internal/stream.Discover).

func (*Target) BaseURL

func (t *Target) BaseURL() string

BaseURL returns the WebDAV base URL for the target, preferring the first IPv4 address. IPv6 addresses are wrapped in brackets. Returns an empty string if the target has no addresses.

Jump to

Keyboard shortcuts

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