dialer.go

v0.3.0
Doc Versions Source
1
package local
2
3
import (
4
	"context"
5
6
	"go.bigb.es/auxilia/legatus"
7
)
8
9
// Dialer is a legatus.Dialer that hands out local Conns. The host argument is
10
// ignored — every Dial targets this machine — so a workstation-local flow can run
11
// through the Runner against a synthetic host.
12
type Dialer struct{}
13
14
var _ legatus.Dialer = (*Dialer)(nil)
15
16
// NewDialer returns a local Dialer.
17
func NewDialer() *Dialer { return &Dialer{} }
18
19
// Dial returns a local Conn, ignoring h.
20
func (d *Dialer) Dial(_ context.Context, _ *legatus.Host) (legatus.Conn, error) {
21
	return NewConn(), nil
22
}
23

Source Files