Skip to content

Commit

Permalink
Rename vat.NetConfig to vat.Config.
Browse files Browse the repository at this point in the history
  • Loading branch information
lthibault committed Jun 1, 2024
1 parent 51748ab commit ba6e174
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions system/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ func (m *Module) SocketConfig(mod api.Module) SocketConfig {
}
}

// Boot returns the system's bootstrap client. This capability is
// analogous to the "root" user in a Unix system.
func (m *Module) Boot(mod api.Module) capnp.Client {
socket := m.SocketConfig(mod).Build()
server := Proc_NewServer(socket)
Expand Down
10 changes: 5 additions & 5 deletions vat/vat.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ type Bootable interface {
Boot(api.Module) capnp.Client
}

type NetConfig struct {
type Config struct {
Host host.Host
Proto protocol.ID
DialTimeout time.Duration
}

func (c NetConfig) Build(ctx context.Context) Network {
func (c Config) Build(ctx context.Context) Network {
if c.DialTimeout <= 0 {
c.DialTimeout = time.Second * 10
}
Expand All @@ -38,14 +38,14 @@ func (c NetConfig) Build(ctx context.Context) Network {
}.Listen(ctx, c.Proto)

return Network{
NetConfig: c,
Listener: l,
Config: c,
Listener: l,
}
}

type Network struct {
Host host.Host
NetConfig
Config
Listener
}

Expand Down
2 changes: 1 addition & 1 deletion vat/vat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func TestNetConfig(t *testing.T) {

h := test_libp2p.NewMockHost(ctrl)

net := vat.NetConfig{
net := vat.Config{
Host: h,
}.Build(ctx)

Expand Down
2 changes: 1 addition & 1 deletion ww.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func (c Cluster) ServeVat(ctx context.Context, root path.Path) error {
client := sys.Boot(mod)
defer client.Release()

net := vat.NetConfig{
net := vat.Config{
Host: c.Host,
Proto: vat.ProtoFromModule(mod),
}.Build(ctx)
Expand Down

0 comments on commit ba6e174

Please sign in to comment.