server/client/socket_builder.go
crusader 1c8bef954e ing
2017-11-30 18:57:09 +09:00

34 lines
632 B
Go

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
Dial(dialer *net.Dialer, network, address string) (net.Conn, error)
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()
}