Documentation ¶
Overview ¶
Package repotest provides utilities for testing.
The server provides a testing server that can be set up and torn down quickly.
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 an implementation of a repository server for testing.
func NewServer ¶
NewServer creates a repository server for testing.
docroot should be a temp dir managed by the caller.
This will start the server, serving files off of the docroot.
Use CopyCharts to move charts into the repository and then index them for service.
func NewTempServer ¶
NewTempServer creates a server inside of a temp dir.
If the passed in string is not "", it will be treated as a shell glob, and files will be copied from that path to the server's docroot.
The caller is responsible for destroying the temp directory as well as stopping the server.
func (*Server) CopyCharts ¶
CopyCharts takes a glob expression and copies those charts to the server root.
func (*Server) CreateIndex ¶
CreateIndex will read docroot and generate an index.yaml file.
func (*Server) LinkIndices ¶
LinkIndices links the index created with CreateIndex and makes a symbolic link to the repositories/cache directory.
This makes it possible to simulate a local cache of a repository.