Documentation
¶
Overview ¶
Package frontend implements the Device Lease service API.
Index ¶
- func InstallServices(s *Server, srv *server.Server)
- func NewDBClient(ctx context.Context, dbconf *database.DatabaseConfig) (*database.Client, error)
- func SetUpBQClient(ctx context.Context, server *Server, cloudProject string) error
- func SetUpPubSubClient(ctx context.Context, server *Server, cloudProject string) error
- type Server
- func (s *Server) BulkLeaseDevices(ctx context.Context, r *api.BulkLeaseDevicesRequest) (*api.BulkLeaseDevicesResponse, error)
- func (s *Server) ExtendLease(ctx context.Context, r *api.ExtendLeaseRequest) (*api.ExtendLeaseResponse, error)
- func (s *Server) GetDevice(ctx context.Context, r *api.GetDeviceRequest) (*api.Device, error)
- func (s *Server) LeaseDevice(ctx context.Context, r *api.LeaseDeviceRequest) (*api.LeaseDeviceResponse, error)
- func (s *Server) ListDevices(ctx context.Context, r *api.ListDevicesRequest) (*api.ListDevicesResponse, error)
- func (s *Server) ReleaseDevice(ctx context.Context, r *api.ReleaseDeviceRequest) (*api.ReleaseDeviceResponse, error)
- type ServiceClients
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InstallServices ¶
InstallServices takes a DeviceLeaseServiceServer and exposes it to a LUCI prpc.Server.
func NewDBClient ¶
SetUpDBClient sets up a reusable database client for the server
func SetUpBQClient ¶
SetUpBQClient sets up a reusable BigQuery client for the server
Types ¶
type Server ¶
type Server struct { api.UnimplementedDeviceLeaseServiceServer ServiceClients ServiceClients // contains filtered or unexported fields }
Server is a struct implements the pb.DeviceLeaseServiceServer.
func (*Server) BulkLeaseDevices ¶
func (s *Server) BulkLeaseDevices(ctx context.Context, r *api.BulkLeaseDevicesRequest) (*api.BulkLeaseDevicesResponse, error)
BulkLeaseDevices takes a BulkLeaseDevicesRequest and leases a corresponding device.
BulkLeaseDevices currently only supported leasing with DUT ID.
func (*Server) ExtendLease ¶
func (s *Server) ExtendLease(ctx context.Context, r *api.ExtendLeaseRequest) (*api.ExtendLeaseResponse, error)
ExtendLease attempts to extend the lease on a device by ExtendLeaseRequest.
func (*Server) LeaseDevice ¶
func (s *Server) LeaseDevice(ctx context.Context, r *api.LeaseDeviceRequest) (*api.LeaseDeviceResponse, error)
LeaseDevice takes a LeaseDeviceRequest and leases a corresponding device.
func (*Server) ListDevices ¶
func (s *Server) ListDevices(ctx context.Context, r *api.ListDevicesRequest) (*api.ListDevicesResponse, error)
ListDevices takes a ListDevicesRequest and returns a list of corresponding devices.
func (*Server) ReleaseDevice ¶
func (s *Server) ReleaseDevice(ctx context.Context, r *api.ReleaseDeviceRequest) (*api.ReleaseDeviceResponse, error)
ReleaseDevice releases the leased device.
type ServiceClients ¶
type ServiceClients struct { DBClient *database.Client PubSubClient external.PubSubClient UFSClient ufsAPI.FleetClient BQClient *bigquery.Client }
ServiceClients contains all relevant service clients for Device Manager Service.