lxd

package
v0.0.0-...-683b059 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Overview

Package lxd is a fake lxd simplestreams server that serves container images for Crostini tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server is a simplestreams HTTP server that serves lxd images for tests. It serves images from a given directory only, and ignores the leading part of the path in URLs, only serving files based on matching filename. You should have valid lxd.tar.xz and rootfs.squashfs files in the given directory.

func NewServer

func NewServer(ctx context.Context, metadataPath, rootfsPath string) (*Server, error)

NewServer creates a new simplestreams lxd container server serving images from the specified directory.

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(ctx context.Context) (string, error)

ListenAndServe starts the server listening in a new goroutine. Ensure that you call Shutdown to terminate the goroutine.

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the server after all connections have completed.

Jump to

Keyboard shortcuts

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