Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPServer ¶
type HTTPServer struct {
// contains filtered or unexported fields
}
HTTPServer repreents a HTTP or HTTPS server
func NewServer ¶
func NewServer(c *ServerConfig, handler http.Handler) (*HTTPServer, error)
NewServer create a Server instance
func (*HTTPServer) Shutdown ¶
func (s *HTTPServer) Shutdown(ctx context.Context) error
Shutdown closes the https server gracefully
func (*HTTPServer) Start ¶
func (s *HTTPServer) Start() error
Start starts the https server and listens for new incoming requests
type ServerConfig ¶
type ServerConfig struct { Port int TLSEnabled bool // Timeouts ReadTimeout time.Duration WriteTimeout time.Duration IdleTimeout time.Duration // Certs TrustStore string // List of trusted Client CA certificates ServerKey string // Server's Private key ServerCert string // Server's Certificate ServerCaCerts string // Server's CA certificate chain }
ServerConfig represents the configuration of the crosswork Config
func (*ServerConfig) GetServerCaCerts ¶
func (sc *ServerConfig) GetServerCaCerts() ([]byte, error)
func (*ServerConfig) GetServerCert ¶
func (sc *ServerConfig) GetServerCert() ([]byte, error)
func (*ServerConfig) GetServerKey ¶
func (sc *ServerConfig) GetServerKey() ([]byte, error)
func (*ServerConfig) GetTrustStore ¶
func (sc *ServerConfig) GetTrustStore() ([]byte, error)
Click to show internal directories.
Click to hide internal directories.