Documentation
¶
Index ¶
- Variables
- func GetGitilesClient(ctx context.Context, gitilesHost string) (gitiles.GitilesClient, error)
- func GetPubSub(c context.Context) *pubsub.Client
- func UsePubSub(c context.Context, projectID string) (context.Context, error)
- func WithServerInterface(ctx context.Context) context.Context
- func WithTestingContext(ctx context.Context) context.Context
- type DeviceConfigClient
- type DeviceConfigFactory
- type DualDeviceConfigClient
- type GitInterfaceFactory
- type GitTilesClient
- type GitTilesInterfaceFactory
- type HwidInterfaceFactory
- type InterfaceFactory
- func (es *InterfaceFactory) NewDeviceConfigInterfaceFactory(ctx context.Context) (DeviceConfigClient, error)
- func (es *InterfaceFactory) NewGitInterface(ctx context.Context, gitilesHost, project, branch string) (git.ClientInterface, error)
- func (es *InterfaceFactory) NewGitTilesInterface(ctx context.Context, gitilesHost string) (GitTilesClient, error)
- func (es *InterfaceFactory) NewHwidClientInterface(ctx context.Context) (hwid.ClientInterface, error)
- func (es *InterfaceFactory) NewSheetInterface(ctx context.Context) (sheet.ClientInterface, error)
- 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 GetGitilesClient ¶
GetGitilesClient returns the GitilesClient for the given host.
func WithServerInterface ¶
WithServerInterface adds the external server interface to context.
Types ¶
type DeviceConfigClient ¶
type DeviceConfigClient interface { GetDeviceConfig(ctx context.Context, cfgID *deviceconfig.ConfigId) (*deviceconfig.Config, error) DeviceConfigsExists(ctx context.Context, cfgIDs []*deviceconfig.ConfigId) ([]bool, error) }
DeviceConfigClient handles read operations for DeviceConfigs These functions match the functions in the configuration package, and if datastore is the only source for DeviceConfigs, consider deleting this code
type DeviceConfigFactory ¶
type DeviceConfigFactory func(ctx context.Context) (DeviceConfigClient, error)
DeviceConfigFactory is a constructor for a DeviceConfigClient
type DualDeviceConfigClient ¶
type DualDeviceConfigClient struct { }
DualDeviceConfigClient can use multiple sources to fetch device configs.
func (*DualDeviceConfigClient) DeviceConfigsExists ¶
func (c *DualDeviceConfigClient) DeviceConfigsExists(ctx context.Context, cfgIDs []*deviceconfig.ConfigId) ([]bool, error)
DeviceConfigsExists detects whether any number of configs exist.
The return is an array of booleans, where the ith boolean represents the existence of the ith config.
func (*DualDeviceConfigClient) GetDeviceConfig ¶
func (c *DualDeviceConfigClient) GetDeviceConfig(ctx context.Context, cfgID *deviceconfig.ConfigId) (*deviceconfig.Config, error)
GetDeviceConfig fetches a specific device config in UFS.
type GitInterfaceFactory ¶
type GitInterfaceFactory func(ctx context.Context, gitilesHost, project, branch string) (git.ClientInterface, error)
GitInterfaceFactory is a constructor for a git.ClientInterface
type GitTilesClient ¶
type GitTilesClient interface { Log(ctx context.Context, in *gitiles.LogRequest, opts ...grpc.CallOption) (*gitiles.LogResponse, error) DownloadFile(ctx context.Context, in *gitiles.DownloadFileRequest, opts ...grpc.CallOption) (*gitiles.DownloadFileResponse, error) }
GitTilesClient exposes a subset of gitiles.GitilesClient
type GitTilesInterfaceFactory ¶
type GitTilesInterfaceFactory func(ctx context.Context, gitilesHost string) (GitTilesClient, error)
GitTilesInterfaceFactory is a constructor for a gitiles.GitilesClient
type HwidInterfaceFactory ¶
type HwidInterfaceFactory func(ctx context.Context) (hwid.ClientInterface, error)
HwidInterfaceFactory is a constructor for a HWIDClient
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) NewDeviceConfigInterfaceFactory ¶
func (es *InterfaceFactory) NewDeviceConfigInterfaceFactory(ctx context.Context) (DeviceConfigClient, error)
NewDeviceConfigInterfaceFactory creates a new device config client
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) NewGitTilesInterface ¶
func (es *InterfaceFactory) NewGitTilesInterface(ctx context.Context, gitilesHost string) (GitTilesClient, error)
NewGitTilesInterface creates a new git interface.
func (*InterfaceFactory) NewHwidClientInterface ¶
func (es *InterfaceFactory) NewHwidClientInterface(ctx context.Context) (hwid.ClientInterface, error)
NewHwidClientInterface creates a new Hwid server client interface.
func (*InterfaceFactory) NewSheetInterface ¶
func (es *InterfaceFactory) NewSheetInterface(ctx context.Context) (sheet.ClientInterface, error)
NewSheetInterface creates a new Sheet interface.
type SheetInterfaceFactory ¶
type SheetInterfaceFactory func(ctx context.Context) (sheet.ClientInterface, error)
SheetInterfaceFactory is a constructor for a sheet.ClientInterface