Documentation ¶
Index ¶
- Variables
- type FakeInstance
- type FakeRuntimeService
- func (r *FakeRuntimeService) AttachDisk(ctx context.Context, req *iri.AttachDiskRequest) (*iri.AttachDiskResponse, error)
- func (r *FakeRuntimeService) AttachNetworkInterface(ctx context.Context, req *iri.AttachNetworkInterfaceRequest) (*iri.AttachNetworkInterfaceResponse, error)
- func (r *FakeRuntimeService) CreateInstance(ctx context.Context, req *iri.CreateInstanceRequest) (*iri.CreateInstanceResponse, error)
- func (r *FakeRuntimeService) DeleteInstance(ctx context.Context, req *iri.DeleteInstanceRequest) (*iri.DeleteInstanceResponse, error)
- func (r *FakeRuntimeService) DetachDisk(ctx context.Context, req *iri.DetachDiskRequest) (*iri.DetachDiskResponse, error)
- func (r *FakeRuntimeService) DetachNetworkInterface(ctx context.Context, req *iri.DetachNetworkInterfaceRequest) (*iri.DetachNetworkInterfaceResponse, error)
- func (r *FakeRuntimeService) Exec(ctx context.Context, req *iri.ExecRequest) (*iri.ExecResponse, error)
- func (r *FakeRuntimeService) GetFirstInstanceByLabel(label, value string) (*FakeInstance, error)
- func (r *FakeRuntimeService) GetInstance(id string) (*FakeInstance, error)
- func (r *FakeRuntimeService) ListInstances(ctx context.Context, req *iri.ListInstancesRequest) (*iri.ListInstancesResponse, error)
- func (r *FakeRuntimeService) SetGetExecURL(f func(req *iri.ExecRequest) string)
- func (r *FakeRuntimeService) SetInstances(instances []*FakeInstance)
- func (r *FakeRuntimeService) SetStatus(capacity, allocatable *iri.RuntimeResources)
- func (r *FakeRuntimeService) Status(ctx context.Context, req *iri.StatusRequest) (*iri.StatusResponse, error)
- func (r *FakeRuntimeService) UpdateInstance(inst *FakeInstance) error
- func (r *FakeRuntimeService) UpdateInstanceAnnotations(ctx context.Context, req *iri.UpdateInstanceAnnotationsRequest) (*iri.UpdateInstanceAnnotationsResponse, error)
- func (r *FakeRuntimeService) UpdateInstancePower(ctx context.Context, req *iri.UpdateInstancePowerRequest) (*iri.UpdateInstancePowerResponse, error)
- func (r *FakeRuntimeService) Version(ctx context.Context, req *iri.VersionRequest) (*iri.VersionResponse, error)
- type FakeStatus
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Version is the version of the fake runtime. Version = "0.1.0" // RuntimeName is the name of the fake runtime. RuntimeName = "fakeRuntime" )
Functions ¶
This section is empty.
Types ¶
type FakeInstance ¶
type FakeRuntimeService ¶
type FakeRuntimeService struct { sync.RWMutex Instances map[string]*FakeInstance Capacity *iri.RuntimeResources Allocatable *iri.RuntimeResources GetExecURL func(req *iri.ExecRequest) string }
func NewFakeRuntimeService ¶
func NewFakeRuntimeService() *FakeRuntimeService
func (*FakeRuntimeService) AttachDisk ¶
func (r *FakeRuntimeService) AttachDisk(ctx context.Context, req *iri.AttachDiskRequest) (*iri.AttachDiskResponse, error)
func (*FakeRuntimeService) AttachNetworkInterface ¶
func (r *FakeRuntimeService) AttachNetworkInterface(ctx context.Context, req *iri.AttachNetworkInterfaceRequest) (*iri.AttachNetworkInterfaceResponse, error)
func (*FakeRuntimeService) CreateInstance ¶
func (r *FakeRuntimeService) CreateInstance(ctx context.Context, req *iri.CreateInstanceRequest) (*iri.CreateInstanceResponse, error)
func (*FakeRuntimeService) DeleteInstance ¶
func (r *FakeRuntimeService) DeleteInstance(ctx context.Context, req *iri.DeleteInstanceRequest) (*iri.DeleteInstanceResponse, error)
func (*FakeRuntimeService) DetachDisk ¶
func (r *FakeRuntimeService) DetachDisk(ctx context.Context, req *iri.DetachDiskRequest) (*iri.DetachDiskResponse, error)
func (*FakeRuntimeService) DetachNetworkInterface ¶
func (r *FakeRuntimeService) DetachNetworkInterface(ctx context.Context, req *iri.DetachNetworkInterfaceRequest) (*iri.DetachNetworkInterfaceResponse, error)
func (*FakeRuntimeService) Exec ¶
func (r *FakeRuntimeService) Exec(ctx context.Context, req *iri.ExecRequest) (*iri.ExecResponse, error)
func (*FakeRuntimeService) GetFirstInstanceByLabel ¶
func (r *FakeRuntimeService) GetFirstInstanceByLabel(label, value string) (*FakeInstance, error)
func (*FakeRuntimeService) GetInstance ¶
func (r *FakeRuntimeService) GetInstance(id string) (*FakeInstance, error)
func (*FakeRuntimeService) ListInstances ¶
func (r *FakeRuntimeService) ListInstances(ctx context.Context, req *iri.ListInstancesRequest) (*iri.ListInstancesResponse, error)
func (*FakeRuntimeService) SetGetExecURL ¶
func (r *FakeRuntimeService) SetGetExecURL(f func(req *iri.ExecRequest) string)
func (*FakeRuntimeService) SetInstances ¶
func (r *FakeRuntimeService) SetInstances(instances []*FakeInstance)
func (*FakeRuntimeService) SetStatus ¶
func (r *FakeRuntimeService) SetStatus(capacity, allocatable *iri.RuntimeResources)
func (*FakeRuntimeService) Status ¶
func (r *FakeRuntimeService) Status(ctx context.Context, req *iri.StatusRequest) (*iri.StatusResponse, error)
func (*FakeRuntimeService) UpdateInstance ¶
func (r *FakeRuntimeService) UpdateInstance(inst *FakeInstance) error
func (*FakeRuntimeService) UpdateInstanceAnnotations ¶
func (r *FakeRuntimeService) UpdateInstanceAnnotations(ctx context.Context, req *iri.UpdateInstanceAnnotationsRequest) (*iri.UpdateInstanceAnnotationsResponse, error)
func (*FakeRuntimeService) UpdateInstancePower ¶
func (r *FakeRuntimeService) UpdateInstancePower(ctx context.Context, req *iri.UpdateInstancePowerRequest) (*iri.UpdateInstancePowerResponse, error)
func (*FakeRuntimeService) Version ¶
func (r *FakeRuntimeService) Version(ctx context.Context, req *iri.VersionRequest) (*iri.VersionResponse, error)
type FakeStatus ¶
type FakeStatus struct { Capacity iri.RuntimeResources Allocatable iri.RuntimeResources }
Click to show internal directories.
Click to hide internal directories.