Rename machine index to target index
This commit is contained in:
parent
16f3ba3574
commit
551aa2970f
@ -1,41 +0,0 @@
|
||||
package core
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/hashicorp/go-hclog"
|
||||
"github.com/hashicorp/vagrant-plugin-sdk/core"
|
||||
"github.com/hashicorp/vagrant/internal/serverclient"
|
||||
)
|
||||
|
||||
// MachineIndex represents
|
||||
type MachineIndex struct {
|
||||
ctx context.Context
|
||||
logger hclog.Logger
|
||||
|
||||
client *serverclient.VagrantClient
|
||||
// The below are resources we need to close when Close is called, if non-nil
|
||||
closers []func() error
|
||||
}
|
||||
|
||||
func (m *MachineIndex) Delete(machine core.Machine) (err error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MachineIndex) Get(uuid string) (entry core.Machine, err error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (m *MachineIndex) Includes(uuid string) (exists bool, err error) {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
func (m *MachineIndex) Set(entry core.Machine) (updatedEntry core.Machine, err error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (m *MachineIndex) Recover(entry core.Machine) (updatedEntry core.Machine, err error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
var _ core.MachineIndex = (*MachineIndex)(nil)
|
||||
@ -105,13 +105,13 @@ func (p *Project) Host() (host core.Host, err error) {
|
||||
}
|
||||
|
||||
// MachineIndex implements core.Project
|
||||
func (p *Project) MachineIndex() (index core.MachineIndex, err error) {
|
||||
index = &MachineIndex{
|
||||
func (p *Project) TargetIndex() (index core.TargetIndex, err error) {
|
||||
index = &TargetIndex{
|
||||
ctx: p.ctx,
|
||||
logger: p.logger,
|
||||
client: p.Client(),
|
||||
}
|
||||
return index, nil
|
||||
return
|
||||
}
|
||||
|
||||
// MachineNames implements core.Project
|
||||
|
||||
41
internal/core/target_index.go
Normal file
41
internal/core/target_index.go
Normal file
@ -0,0 +1,41 @@
|
||||
package core
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/hashicorp/go-hclog"
|
||||
"github.com/hashicorp/vagrant-plugin-sdk/core"
|
||||
"github.com/hashicorp/vagrant/internal/serverclient"
|
||||
)
|
||||
|
||||
// TargetIndex represents
|
||||
type TargetIndex struct {
|
||||
ctx context.Context
|
||||
logger hclog.Logger
|
||||
|
||||
client *serverclient.VagrantClient
|
||||
// The below are resources we need to close when Close is called, if non-nil
|
||||
closers []func() error
|
||||
}
|
||||
|
||||
func (m *TargetIndex) Delete(machine core.Machine) (err error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *TargetIndex) Get(uuid string) (entry core.Machine, err error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (m *TargetIndex) Includes(uuid string) (exists bool, err error) {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
func (m *TargetIndex) Set(entry core.Machine) (updatedEntry core.Machine, err error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (m *TargetIndex) Recover(entry core.Machine) (updatedEntry core.Machine, err error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
var _ core.TargetIndex = (*TargetIndex)(nil)
|
||||
Loading…
x
Reference in New Issue
Block a user