Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SimpleDialTLSConfig ¶
SimpleDialTLSConfig returns a client-side TLS configuration with sane defaults (e.g. TLS version, ciphers and mutual authentication).
The cert parameter must be a public/private key pair, typically loaded from disk using tls.LoadX509KeyPair().
The pool parameter can be used to specify a custom signing CA (e.g. for self-signed certificates).
When server and client both use the same certificate, the same key pair and pool should be passed to SimpleListenTLSConfig() in order to generate the server-side config.
The returned config can be used as "client" parameter for the WithTLS App option, or as "config" parameter for the client.DialFuncWithTLS() helper.
func SimpleListenTLSConfig ¶
SimpleListenTLSConfig returns a server-side TLS configuration with sane defaults (e.g. TLS version, ciphers and mutual authentication).
The cert parameter must be a public/private key pair, typically loaded from disk using tls.LoadX509KeyPair().
The pool parameter can be used to specify a custom signing CA (e.g. for self-signed certificates).
When server and client both use the same certificate, the same key pair and pool should be passed to SimpleDialTLSConfig() in order to generate the client-side config.
The returned config can be used as "listen" parameter for the WithTLS option.
func SimpleTLSConfig ¶
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
type Option ¶
type Option func(*options)
Option can be used to tweak app parameters.
func WithAddress ¶
WithAddress sets the network address of the application node.
Other application nodes must be able to connect to this application node using the given address.
If the application node is not the first one in the cluster, the address must match the value that was passed to the App.Add() method upon registration.
If not given the first non-loopback IP address of any of the system network interfaces will be used, with port 9000.
The address must be stable across application restarts.
func WithCluster ¶
WithCluster must be used when starting a newly added application node for the first time.
It should contain the addresses of one or more applications nodes which are already part of the cluster.
func WithLogFunc ¶
WithLogFunc sets a custom log function.
func WithTLS ¶
WithTLS enables TLS encryption of network traffic.
The "listen" parameter must hold the TLS configuration to use when accepting incoming connections clients or application nodes.
The "dial" parameter must hold the TLS configuration to use when establishing outgoing connections to other application nodes.