server/client/socket_builder.go

32 lines
562 B
Go
Raw Normal View History

2017-11-30 09:13:58 +00:00
package client
import (
"crypto/tls"
"net"
"time"
cuc "git.loafle.net/commons_go/util/context"
)
type SocketBuilder interface {
SocketContext(parent cuc.Context) SocketContext
SocketHandler() SocketHandler
GetNetwork() string
GetAddress() string
GetTLSConfig() *tls.Config
GetKeepAlive() time.Duration
GetTimeout() time.Duration
GetLocalAddress() net.Addr
// Validate is check handler value
// If you override ths method, must call
//
// func (sh *SocketHandlers) Validate() {
// sh.SocketHandlers.Validate()
// ...
// }
Validate()
}