endpoints

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2020 License: Apache-2.0 Imports: 29 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Addresses to bind the servers to
	TCPAddr *net.TCPAddr
	UDSAddr *net.UnixAddr

	// A hook allowing the consumer to customize the gRPC server before it starts.
	GRPCHook func(*grpc.Server) error

	// The svid rotator used to obtain the latest server credentials
	SVIDObserver svid.Observer

	// The server's configured trust domain. Used for validation, server SVID, etc.
	TrustDomain url.URL

	// Plugin catalog
	Catalog catalog.Catalog

	// Server CA for signing SVIDs
	ServerCA ca.ServerCA

	// Allow agentless spiffeIds when doing node attestation
	AllowAgentlessNodeAttestors bool

	// Bundle endpoint address
	BundleEndpointAddress *net.TCPAddr

	// Bundle endpoint ACME configuration. If unset, SPIFFE auth will be used.
	BundleEndpointACME *bundle.ACMEConfig

	Log     logrus.FieldLogger
	Metrics telemetry.Metrics
}

Config is a configuration for endpoints

type Endpoints

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

func New

func New(c *Config) *Endpoints

New creates new endpoints struct

func (*Endpoints) ListenAndServe

func (e *Endpoints) ListenAndServe(ctx context.Context) error

ListenAndServe starts all maintenance routines and endpoints, then blocks until the context is cancelled or there is an error encountered listening on one of the servers.

type Server

type Server interface {
	// ListenAndServe starts all endpoints, and blocks for as long as the
	// underlying servers are still running. Returns an error if any of the
	// endpoints encounter one. ListenAndServe will return an
	ListenAndServe(ctx context.Context) error
}

Server manages gRPC and HTTP endpoint lifecycle

Directories

Path Synopsis
internal/acmetest
nolint // forked code
nolint // forked code
internal/autocert
nolint // forked code nolint // forked code nolint // forked code
nolint // forked code nolint // forked code nolint // forked code

Jump to

Keyboard shortcuts

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