server

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PebbleConfigJSON contains the configration of Pebble.
	PebbleConfigJSON = "testdata/pebble-config.json"
	// DNSPort is the port pebble uses for DNS queries.
	DNSPort = "9053"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	ACMEDirectoryURL string
	HTTPAPIAddr      string
	DataDir          string
	Logger           log.Logger
	// contains filtered or unexported fields
}

Server is acmeproxy's public server.

Server runs the ACME Agent responsible of obtaining certificates and storing them for later retrieval. Users connect to the server through its public API to retrieve their certificates.

The zero value of Server represents a valid instance. Server may start a multitude of Go routines.

func (*Server) Shutdown

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

Shutdown performs a graceful shutdown of the Server. Once the server has been shut down, it cannot be started again.

func (*Server) Start

func (s *Server) Start() error

Start starts the Server without blocking.

A Server can be started only once. Re-starting an already started server -- even if it has been stopped in the meantime by calling Shutdown -- leads to an error.

type TestFixture

type TestFixture struct {
	DataDir string
	Pebble  *testsupport.Pebble
	Server  *Server
	// contains filtered or unexported fields
}

TestFixture wraps everything required to test Server.

Use NewTestFixture to create a working instance.

func NewTestFixture

func NewTestFixture(t *testing.T) *TestFixture

NewTestFixture creates a new test fixture ready for use.

func (*TestFixture) Close

func (fx *TestFixture) Close() error

Close destroys all data structures and directories associated with this TestFixture.

func (*TestFixture) MustStartServer

func (fx *TestFixture) MustStartServer(t *testing.T)

MustStartServer calls fx.Server.Start and fails the test if Start returns an error.

Jump to

Keyboard shortcuts

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