Documentation ¶
Index ¶
- Constants
- func AddToURLPath(baseURL url.URL, path string) url.URL
- func AddrToURL(addr *kronospb.NodeAddr, secure bool) url.URL
- func CloseWithErrorLog(ctx context.Context, o io.Closer)
- func NodeAddr(addr string) (*kronospb.NodeAddr, error)
- func NodeAddrToString(addr *kronospb.NodeAddr) string
- func SSLCreds(certsDir string) (credentials.TransportCredentials, error)
- func TLSInfo(certsDir string) transport.TLSInfo
- func ValidateTimeInConsensus(ctx context.Context, maxDiffAllowed time.Duration, ...) error
- type StoppableListener
Constants ¶
View Source
const ( // CACert is the file name for CA certificate CACert = "ca.crt" // NodeCert is the file name for Node certificate NodeCert = "node.crt" // NodeKey is the file name for Node Key NodeKey = "node.key" )
Variables ¶
This section is empty.
Functions ¶
func AddToURLPath ¶
AddToURLPath resolves baseURL to the given path.
func CloseWithErrorLog ¶
CloseWithErrorLog closes the given closer and logs the error. There are lint checks which prevent defer close() if close() returns an error, this closer is useful in such cases.
func NodeAddrToString ¶
func NodeAddrToString(addr *kronospb.NodeAddr) string
NodeAddrToString joins host and port and returns the address in the form of "127.0.0.1:5766"
func SSLCreds ¶
func SSLCreds(certsDir string) (credentials.TransportCredentials, error)
SSLCreds returns credentials by reading keys and certificates from certsDir
Types ¶
type StoppableListener ¶
type StoppableListener struct { *net.TCPListener // contains filtered or unexported fields }
StoppableListener sets TCP keep-alive timeouts on accepted connections. It stops listening when stopC is closed.
func NewStoppableListener ¶
func NewStoppableListener(addr string, stopc <-chan struct{}) (*StoppableListener, error)
NewStoppableListener returns an instance of StoppableListener
Click to show internal directories.
Click to hide internal directories.