Back to godoc.org

Package fake

v0.0.0-...-bd98d2d
Latest Go to latest

The highest tagged major version is .

Published: Sep 19, 2020 | License: BSD-3-Clause | Module: chromium.googlesource.com/infra/infra.git

Index

func GetMockDUT

func GetMockDUT() *invV2Api.ListCrosDevicesLabConfigResponse_LabConfig

GetMockDUT returns a mock lab config with ChromeOS DUT

func GetMockLabstation

func GetMockLabstation() *invV2Api.ListCrosDevicesLabConfigResponse_LabConfig

GetMockLabstation returns a mock lab config with ChromeOS Labstation

func GitData

func GitData(path string) (string, error)

GitData mocks a git file content based on a given filepath

func SheetData

func SheetData(path string) (*sheets.Spreadsheet, error)

SheetData returns the fake sheet get API response for other testers

type CrimsonClient

type CrimsonClient struct {
	Machines      []*crimson.Machine
	Nics          []*crimson.NIC
	PhysicalHosts []*crimson.PhysicalHost
	Vms           []*crimson.VM
	Dracs         []*crimson.DRAC
}

CrimsonClient mocks the crimsonClient

func (*CrimsonClient) CreateDRAC

func (c *CrimsonClient) CreateDRAC(ctx context.Context, in *crimson.CreateDRACRequest, opts ...grpc.CallOption) (*crimson.DRAC, error)

CreateDRAC mocks the CreateDRAC of crimsonClient

func (*CrimsonClient) CreateMachine

func (c *CrimsonClient) CreateMachine(ctx context.Context, in *crimson.CreateMachineRequest, opts ...grpc.CallOption) (*crimson.Machine, error)

CreateMachine mocks the CreateMachine of crimsonClient

func (*CrimsonClient) CreateNIC

func (c *CrimsonClient) CreateNIC(ctx context.Context, in *crimson.CreateNICRequest, opts ...grpc.CallOption) (*crimson.NIC, error)

CreateNIC mocks the CreateNIC of crimsonClient

func (*CrimsonClient) CreatePhysicalHost

func (c *CrimsonClient) CreatePhysicalHost(ctx context.Context, in *crimson.CreatePhysicalHostRequest, opts ...grpc.CallOption) (*crimson.PhysicalHost, error)

CreatePhysicalHost mocks the CreatePhysicalHost of crimsonClient

func (*CrimsonClient) CreateVM

func (c *CrimsonClient) CreateVM(ctx context.Context, in *crimson.CreateVMRequest, opts ...grpc.CallOption) (*crimson.VM, error)

CreateVM mocks the CreateVM of crimsonClient

func (*CrimsonClient) DeleteHost

func (c *CrimsonClient) DeleteHost(ctx context.Context, in *crimson.DeleteHostRequest, opts ...grpc.CallOption) (*empty.Empty, error)

DeleteHost mocks the DeleteHost of crimsonClient

func (*CrimsonClient) DeleteMachine

func (c *CrimsonClient) DeleteMachine(ctx context.Context, in *crimson.DeleteMachineRequest, opts ...grpc.CallOption) (*empty.Empty, error)

DeleteMachine mocks the DeleteMachine of crimsonClient

func (*CrimsonClient) DeleteNIC

func (c *CrimsonClient) DeleteNIC(ctx context.Context, in *crimson.DeleteNICRequest, opts ...grpc.CallOption) (*empty.Empty, error)

DeleteNIC mocks the DeleteNIC of crimsonClient

func (*CrimsonClient) FindVMSlots

func (c *CrimsonClient) FindVMSlots(ctx context.Context, in *crimson.FindVMSlotsRequest, opts ...grpc.CallOption) (*crimson.FindVMSlotsResponse, error)

FindVMSlots mocks the FindVMSlots of crimsonClient

func (*CrimsonClient) ListDRACs

func (c *CrimsonClient) ListDRACs(ctx context.Context, in *crimson.ListDRACsRequest, opts ...grpc.CallOption) (*crimson.ListDRACsResponse, error)

ListDRACs mocks the ListDRACs of crimsonClient

func (*CrimsonClient) ListDatacenters

func (c *CrimsonClient) ListDatacenters(ctx context.Context, in *crimson.ListDatacentersRequest, opts ...grpc.CallOption) (*crimson.ListDatacentersResponse, error)

ListDatacenters mocks the ListDatacenters of crimsonClient

func (*CrimsonClient) ListFreeIPs

func (c *CrimsonClient) ListFreeIPs(ctx context.Context, in *crimson.ListFreeIPsRequest, opts ...grpc.CallOption) (*crimson.ListIPsResponse, error)

ListFreeIPs mocks the ListFreeIPs of crimsonClient

func (*CrimsonClient) ListKVMs

func (c *CrimsonClient) ListKVMs(ctx context.Context, in *crimson.ListKVMsRequest, opts ...grpc.CallOption) (*crimson.ListKVMsResponse, error)

ListKVMs mocks the ListKVMs of crimsonClient

func (*CrimsonClient) ListMachines

func (c *CrimsonClient) ListMachines(ctx context.Context, in *crimson.ListMachinesRequest, opts ...grpc.CallOption) (*crimson.ListMachinesResponse, error)

ListMachines mocks the ListMachines of crimsonClient

func (*CrimsonClient) ListNICs

func (c *CrimsonClient) ListNICs(ctx context.Context, in *crimson.ListNICsRequest, opts ...grpc.CallOption) (*crimson.ListNICsResponse, error)

ListNICs mocks the ListNICs of crimsonClient

func (*CrimsonClient) ListOSes

func (c *CrimsonClient) ListOSes(ctx context.Context, in *crimson.ListOSesRequest, opts ...grpc.CallOption) (*crimson.ListOSesResponse, error)

ListOSes mocks the ListOSes of crimsonClient

func (*CrimsonClient) ListPhysicalHosts

func (c *CrimsonClient) ListPhysicalHosts(ctx context.Context, in *crimson.ListPhysicalHostsRequest, opts ...grpc.CallOption) (*crimson.ListPhysicalHostsResponse, error)

ListPhysicalHosts mocks the ListPhysicalHosts of crimsonClient

func (*CrimsonClient) ListPlatforms

func (c *CrimsonClient) ListPlatforms(ctx context.Context, in *crimson.ListPlatformsRequest, opts ...grpc.CallOption) (*crimson.ListPlatformsResponse, error)

ListPlatforms mocks the ListPlatforms of crimsonClient

func (*CrimsonClient) ListRacks

func (c *CrimsonClient) ListRacks(ctx context.Context, in *crimson.ListRacksRequest, opts ...grpc.CallOption) (*crimson.ListRacksResponse, error)

ListRacks mocks the ListRacks of crimsonClient

func (*CrimsonClient) ListSwitches

func (c *CrimsonClient) ListSwitches(ctx context.Context, in *crimson.ListSwitchesRequest, opts ...grpc.CallOption) (*crimson.ListSwitchesResponse, error)

ListSwitches mocks the ListSwitches of crimsonClient

func (*CrimsonClient) ListVLANs

func (c *CrimsonClient) ListVLANs(ctx context.Context, in *crimson.ListVLANsRequest, opts ...grpc.CallOption) (*crimson.ListVLANsResponse, error)

ListVLANs mocks the ListVLANs of crimsonClient

func (*CrimsonClient) ListVMs

func (c *CrimsonClient) ListVMs(ctx context.Context, in *crimson.ListVMsRequest, opts ...grpc.CallOption) (*crimson.ListVMsResponse, error)

ListVMs mocks the ListVMs of crimsonClient

func (*CrimsonClient) RenameMachine

func (c *CrimsonClient) RenameMachine(ctx context.Context, in *crimson.RenameMachineRequest, opts ...grpc.CallOption) (*crimson.Machine, error)

RenameMachine mocks the RenameMachine of crimsonClient

func (*CrimsonClient) UpdateDRAC

func (c *CrimsonClient) UpdateDRAC(ctx context.Context, in *crimson.UpdateDRACRequest, opts ...grpc.CallOption) (*crimson.DRAC, error)

UpdateDRAC mocks the UpdateDRAC of crimsonClient

func (*CrimsonClient) UpdateMachine

func (c *CrimsonClient) UpdateMachine(ctx context.Context, in *crimson.UpdateMachineRequest, opts ...grpc.CallOption) (*crimson.Machine, error)

UpdateMachine mocks the UpdateMachine of crimsonClient

func (*CrimsonClient) UpdateNIC

func (c *CrimsonClient) UpdateNIC(ctx context.Context, in *crimson.UpdateNICRequest, opts ...grpc.CallOption) (*crimson.NIC, error)

UpdateNIC mocks the UpdateNIC of crimsonClient

func (*CrimsonClient) UpdatePhysicalHost

func (c *CrimsonClient) UpdatePhysicalHost(ctx context.Context, in *crimson.UpdatePhysicalHostRequest, opts ...grpc.CallOption) (*crimson.PhysicalHost, error)

UpdatePhysicalHost mocks the UpdatePhysicalHost of crimsonClient

func (*CrimsonClient) UpdateVM

func (c *CrimsonClient) UpdateVM(ctx context.Context, in *crimson.UpdateVMRequest, opts ...grpc.CallOption) (*crimson.VM, error)

UpdateVM mocks the UpdateVM of crimsonClient

type GitClient

type GitClient struct {
}

GitClient mocks the git.ClientInterface

func (*GitClient) GetFile

func (gc *GitClient) GetFile(ctx context.Context, path string) (string, error)

GetFile mocks git.ClientInterface.GetFile()

func (*GitClient) SwitchProject

func (gc *GitClient) SwitchProject(ctx context.Context, project string) error

SwitchProject mocks git.ClientInterface.SwitchProject()

type InventoryClient

type InventoryClient struct {
}

InventoryClient mocks the inventory v2 client

func (*InventoryClient) ListCrosDevicesLabConfig

func (ic *InventoryClient) ListCrosDevicesLabConfig(ctx context.Context, in *invV2Api.ListCrosDevicesLabConfigRequest, opts ...grpc.CallOption) (*invV2Api.ListCrosDevicesLabConfigResponse, error)

ListCrosDevicesLabConfig mock the invV2Api.InventoryClient's ListCrosDevicesLabConfig

type LuciConfigClient

type LuciConfigClient struct {
}

LuciConfigClient mocks the luciconfig.Interface

func (*LuciConfigClient) GetConfig

func (c *LuciConfigClient) GetConfig(ctx context.Context, configSet luciconfig.Set, path string, metaOnly bool) (*luciconfig.Config, error)

GetConfig returns a config at a path in a config set

func (*LuciConfigClient) GetConfigByHash

func (c *LuciConfigClient) GetConfigByHash(ctx context.Context, contentHash string) (string, error)

GetConfigByHash returns the contents of a config

func (*LuciConfigClient) GetConfigSetLocation

func (c *LuciConfigClient) GetConfigSetLocation(ctx context.Context, configSet luciconfig.Set) (*url.URL, error)

GetConfigSetLocation returns the URL location of a config set.

func (*LuciConfigClient) GetProjectConfigs

func (c *LuciConfigClient) GetProjectConfigs(ctx context.Context, path string, metaOnly bool) ([]luciconfig.Config, error)

GetProjectConfigs returns all the configs at the given path

func (*LuciConfigClient) GetProjects

func (c *LuciConfigClient) GetProjects(ctx context.Context) ([]luciconfig.Project, error)

GetProjects returns all the registered projects in the configuration service.

func (*LuciConfigClient) GetRefConfigs

func (c *LuciConfigClient) GetRefConfigs(ctx context.Context, path string, metaOnly bool) ([]luciconfig.Config, error)

GetRefConfigs returns the config at the given path

func (*LuciConfigClient) GetRefs

func (c *LuciConfigClient) GetRefs(ctx context.Context, projectID string) ([]string, error)

GetRefs returns the list of refs for a project.

func (*LuciConfigClient) ListFiles

func (c *LuciConfigClient) ListFiles(ctx context.Context, configSet luciconfig.Set) ([]string, error)

ListFiles returns the list of files for a config set.

type SheetClient

type SheetClient struct {
}

SheetClient mocks the sheet.ClientInterface

func (*SheetClient) Get

func (sc *SheetClient) Get(ctx context.Context, sheetID string, ranges []string) (*sheets.Spreadsheet, error)

Get mocks the sheet.ClientInterface.Get()

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier