Documentation ¶
Overview ¶
Package herots provide fast way to create TLS services: server and client.
Explanation of the name: HERald Of The Swarm
By the way - have a nice day :)
Index ¶
Constants ¶
const ( LoadKeyPairError = "load key pair error" NoKeyPairLoadError = "no load key pair (use LoadKeyPair func)" )
predefined errors messages
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client - primary struct for client implementation.
func (*Client) AddCertToRootCA ¶
AddCertToRootCA - function to load additional certificates to root CA pool.
func (*Client) LoadKeyPair ¶
LoadKeyPair - function for load certificate and private key pair.
Public/private key pair require as PEM encoded data.
type Options ¶
type Options struct { // Server host. // // Default: '127.0.0.1'. Host string // Server port. // // Default: '9000'. Port int // LogLevel provides the opportunity to choose the level of // information messages. // Each level includes the messages from the previous level. // 0 - no messages // 1 - notice // 2 - info // 3 - error // // Default: '0'. LogLevel int // LogDestination provides the opportunity to choose the own // destination for log messages (errors, info, etc). // // Default: 'os.Stdout'. LogDestination io.Writer // TLSAuthType - refer to http://golang.org/pkg/crypto/tls/#ClientAuthType // // This option ignored for client implementation. // // Default: tls.RequireAnyClientCert TLSAuthType tls.ClientAuthType }
Options - structure, which is used to configure a TLS server and client.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server - primary struct for server implementation.
func (*Server) AddClientCACert ¶
AddClientCACert - function for adding 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 ¶
LoadKeyPair - function for load certificate and private key pair.
Public/private key pair require as PEM encoded data.