frontend

package
v0.0.0-...-c537dde Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2025 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Overview

Package frontend implements the Device Lease service API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstallServices

func InstallServices(s *Server, srv *server.Server)

InstallServices takes a DeviceLeaseServiceServer and exposes it to a LUCI prpc.Server.

func NewDBClient

func NewDBClient(ctx context.Context, dbconf *database.DatabaseConfig) (*database.Client, error)

SetUpDBClient sets up a reusable database client for the server

func SetUpBQClient

func SetUpBQClient(ctx context.Context, server *Server, cloudProject string) error

SetUpBQClient sets up a reusable BigQuery client for the server

func SetUpPubSubClient

func SetUpPubSubClient(ctx context.Context, server *Server, cloudProject string) error

SetUpPubSubClient sets up a reusable PubSub 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 NewServer

func NewServer() *Server

NewServer returns a new Server.

func (*Server) BulkLeaseDevices

BulkLeaseDevices takes a BulkLeaseDevicesRequest and leases a corresponding device.

BulkLeaseDevices currently only supported leasing with DUT ID.

func (*Server) ExtendLease

ExtendLease attempts to extend the lease on a device by ExtendLeaseRequest.

func (*Server) GetDevice

func (s *Server) GetDevice(ctx context.Context, r *api.GetDeviceRequest) (*api.Device, error)

GetDevice takes a GetDeviceRequest and returns a corresponding device.

func (*Server) LeaseDevice

LeaseDevice takes a LeaseDeviceRequest and leases a corresponding device.

func (*Server) ListDevices

ListDevices takes a ListDevicesRequest and returns a list of corresponding devices.

func (*Server) ReleaseDevice

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL