Documentation ¶
Index ¶
- Variables
- func WithServerInterface(ctx context.Context) context.Context
- func WithTestingContext(ctx context.Context) context.Context
- type CfgInterfaceFactory
- type CrosInventoryClient
- type CrosInventoryInterfaceFactory
- type GitInterfaceFactory
- type InterfaceFactory
- func (es *InterfaceFactory) NewCfgInterface(ctx context.Context) luciconfig.Interface
- func (es *InterfaceFactory) NewCrosInventoryInterfaceFactory(ctx context.Context, host string) (CrosInventoryClient, error)
- func (es *InterfaceFactory) NewGitInterface(ctx context.Context, gitilesHost, project, branch string) (git.ClientInterface, error)
- func (es *InterfaceFactory) NewMachineDBInterfaceFactory(ctx context.Context, host string) (crimson.CrimsonClient, error)
- func (es *InterfaceFactory) NewSheetInterface(ctx context.Context) (sheet.ClientInterface, error)
- type MachineDBInterfaceFactory
- type SheetInterfaceFactory
Constants ¶
This section is empty.
Variables ¶
var InterfaceFactoryKey = util.Key("ufs external-server-interface key")
InterfaceFactoryKey is the key used to store instance of InterfaceFactory in context.
Functions ¶
func WithServerInterface ¶
WithServerInterface adds the external server interface to context.
Types ¶
type CfgInterfaceFactory ¶
type CfgInterfaceFactory func(ctx context.Context) luciconfig.Interface
CfgInterfaceFactory is a contsructor for a luciconfig.Interface For potential unittest usage
type CrosInventoryClient ¶
type CrosInventoryClient interface { ListCrosDevicesLabConfig(ctx context.Context, in *invV2Api.ListCrosDevicesLabConfigRequest, opts ...grpc.CallOption) (*invV2Api.ListCrosDevicesLabConfigResponse, error) DeviceConfigsExists(ctx context.Context, in *invV2Api.DeviceConfigsExistsRequest, opts ...grpc.CallOption) (*invV2Api.DeviceConfigsExistsResponse, error) GetManufacturingConfig(ctx context.Context, in *invV2Api.GetManufacturingConfigRequest, opts ...grpc.CallOption) (*manufacturing.Config, error) GetDeviceConfig(ctx context.Context, in *invV2Api.GetDeviceConfigRequest, opts ...grpc.CallOption) (*device.Config, error) GetHwidData(ctx context.Context, in *invV2Api.GetHwidDataRequest, opts ...grpc.CallOption) (*invV2Api.HwidData, error) }
CrosInventoryClient refers to the fake inventory v2 client
type CrosInventoryInterfaceFactory ¶
type CrosInventoryInterfaceFactory func(ctx context.Context, host string) (CrosInventoryClient, error)
CrosInventoryInterfaceFactory is a constructor for a invV2Api.InventoryClient
type GitInterfaceFactory ¶
type GitInterfaceFactory func(ctx context.Context, gitilesHost, project, branch string) (git.ClientInterface, error)
GitInterfaceFactory is a constructor for a git.ClientInterface
type InterfaceFactory ¶
type InterfaceFactory struct {
// contains filtered or unexported fields
}
InterfaceFactory provides a collection of interfaces to external clients.
func GetServerInterface ¶
func GetServerInterface(ctx context.Context) (*InterfaceFactory, error)
GetServerInterface retrieves the ExternalServerInterface from context.
func (*InterfaceFactory) NewCfgInterface ¶
func (es *InterfaceFactory) NewCfgInterface(ctx context.Context) luciconfig.Interface
NewCfgInterface creates a new config interface.
func (*InterfaceFactory) NewCrosInventoryInterfaceFactory ¶
func (es *InterfaceFactory) NewCrosInventoryInterfaceFactory(ctx context.Context, host string) (CrosInventoryClient, error)
NewCrosInventoryInterfaceFactory creates a new CrosInventoryInterface.
func (*InterfaceFactory) NewGitInterface ¶
func (es *InterfaceFactory) NewGitInterface(ctx context.Context, gitilesHost, project, branch string) (git.ClientInterface, error)
NewGitInterface creates a new git interface.
func (*InterfaceFactory) NewMachineDBInterfaceFactory ¶
func (es *InterfaceFactory) NewMachineDBInterfaceFactory(ctx context.Context, host string) (crimson.CrimsonClient, error)
NewMachineDBInterfaceFactory creates a new machine DB interface.
func (*InterfaceFactory) NewSheetInterface ¶
func (es *InterfaceFactory) NewSheetInterface(ctx context.Context) (sheet.ClientInterface, error)
NewSheetInterface creates a new Sheet interface.
type MachineDBInterfaceFactory ¶
type MachineDBInterfaceFactory func(ctx context.Context, host string) (crimson.CrimsonClient, error)
MachineDBInterfaceFactory is a constructor for a crimson.CrimsonClient For potential unittest usage
type SheetInterfaceFactory ¶
type SheetInterfaceFactory func(ctx context.Context) (sheet.ClientInterface, error)
SheetInterfaceFactory is a constructor for a sheet.ClientInterface