Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTLSConfig ¶
func CreateTLSConfig(config Config, opts ...TLSConfigOption) (*tls.Config, error)
CreateTLSConfig will create a tls.Config given the config and options. This will return an error if there is a problem loading the required certificate files. If the WithMTLS option is specified, a client CA cert is required.
Types ¶
type Config ¶
type Config interface { // Addr returns that network address the server listens to. Addr() string // Cert returns the file name of the PEM encoded public key. Cert() string // Key returns the file name of the PEM encoded private key. Key() string // CACert returns the file name of the PEM encoded public key of the client CA. CACert() string }
Config contains the information necessary to create a server.
type Server ¶
type Server interface { // Serve is the entry point for a service and will be run it a goroutine. // It is passed a channel to communicate the result. Serve(result chan<- error) // Stop stops the server. Stop() }
Server abstracts a server.
type TLSConfigOption ¶
type TLSConfigOption interface {
// contains filtered or unexported methods
}
TLSConfigOption provides options for configuring the creation of a tls.Config.
func WithMTLS ¶
func WithMTLS() TLSConfigOption
WithMTLS will setup the tls.Config to require and verify client connections.
Directories ¶
Path | Synopsis |
---|---|
mock
Package mockgrpc is a generated GoMock package.
|
Package mockgrpc is a generated GoMock package. |
mock
Package mockhttp is a generated GoMock package.
|
Package mockhttp is a generated GoMock package. |
Package mockserver is a generated GoMock package.
|
Package mockserver is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.