tls

package
v0.0.0-...-e560ebb Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Overview

Package tls provides utilities to manage a Test Library Services server running in the background for a phosphorus command.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackgroundTLS

type BackgroundTLS struct {
	Client *grpc.ClientConn
	// contains filtered or unexported fields
}

BackgroundTLS represents a TLS server and a client for using it.

func NewBackgroundTLS

func NewBackgroundTLS() (*BackgroundTLS, error)

NewBackgroundTLS runs a TLS server in the background and create a gRPC client to it.

On success, the caller must call BackgroundTLS.Close() to clean up resources.

func (*BackgroundTLS) CacheForDut

func (b *BackgroundTLS) CacheForDut(ctx context.Context, imageURL, dutName string) (string, error)

CacheForDut queries the underlying TLW server to find a healthy devserver with a cached version of the given chromeOS image, and returns the URL of the cached image on the devserver.

func (*BackgroundTLS) Close

func (b *BackgroundTLS) Close() error

Close cleans up resources associated with the BackgroundTLS.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server holds local state for a TLS server running in the background.

func StartBackground

func StartBackground(tlwAddress string) (*Server, error)

StartBackground starts a new TLS server in the background.

On success, caller is responsible for calling Server.Stop() to stop the server and free up resources.

func (*Server) Address

func (s *Server) Address() string

Address returns the address that this server is listening at.

func (*Server) Stop

func (s *Server) Stop()

Stop stops the server and frees up resources.

Stop tries to gracefully shutdown the TLS server, which may be a somewhat slow operation.

Jump to

Keyboard shortcuts

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