Documentation ¶
Overview ¶
HEROTS HERald Of The Swarm
Package for fast TLS server creation.
Index ¶
Constants ¶
View Source
const ( LoadKeyPairError = "herots: load key pair error" LoadClientCaCertError = "herots srv: load client CA cert error" StartServerError = "herots srv: start tls server error" NoKeyPairLoad = "herots: no load key pair (use LoadKeyPair func)" AcceptConnError = "herots srv: connection accept error" )
predefined errors messages
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct { // Server host. // By default server use "127.0.0.1". Host string // Server port. // By default server use "9000". Port int // Message level provides the opportunity to choose // what print to the output. // 0 - no messages // 1 - errors // 2 - info messages // 3 - all ("1" + "2") // By default server use "2". MessageLevel int // See http://golang.org/pkg/crypto/tls/#ClientAuthType // By default server use tls.RequireAnyClientCert TLSAuthType tls.ClientAuthType }
A Options structure is used to configure a TLS server.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) AddClientCACert ¶
Add client CA certificate to x509.CertPool (tls.Config.ClientCAs).
By default server add cert from server public/private key pair (LoadKeyPair) to cert pool.
func (*Server) LoadKeyPair ¶
Func for load certificate and private key pair.
Public/private key pair require as PEM encoded data.
func (*Server) SetMessagesDst ¶
Provides the opportunity to choose own destination for herots messages (errors, info, etc).
By default server use os.Stdout.
Click to show internal directories.
Click to hide internal directories.