Documentation ¶
Index ¶
- Constants
- func NewReader(r io.Reader) io.Reader
- type Connection
- type DispatchFunc
- type FakeConnection
- func (httpConn *FakeConnection) GetConnStatus() Status
- func (httpConn *FakeConnection) Install(eventType exe.Event_Type, dispatch DispatchFunc) error
- func (httpConn *FakeConnection) Recv() (*exe.Event, error)
- func (httpConn *FakeConnection) Send(call *exe.Call, keepAlive bool) error
- func (httpConn *FakeConnection) Start(endpoint string, path string) error
- func (httpConn *FakeConnection) Stop(graceful bool)
- func (httpConn *FakeConnection) TLSConfig(config *tls.Config, handshakeTimeout time.Duration)
- type HTTPConnection
- func (httpConn *HTTPConnection) GetConnStatus() Status
- func (httpConn *HTTPConnection) Install(eventType exe.Event_Type, dispatch DispatchFunc) error
- func (httpConn *HTTPConnection) Recv() (*exe.Event, error)
- func (httpConn *HTTPConnection) Send(call *exe.Call, keepAlive bool) error
- func (httpConn *HTTPConnection) Start(endpoint string, path string) error
- func (httpConn *HTTPConnection) Stop(graceful bool)
- func (httpConn *HTTPConnection) TLSConfig(config *tls.Config, handshakeTimeout time.Duration)
- type HandleFunc
- type Message
- type Status
Constants ¶
const ( //Event_CONNECTION_CLOSE connection close event type Event_CONNECTION_CLOSE exe.Event_Type = 1024 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Connection ¶
type Connection interface { //Install mount an handler based on incoming message name. Install(eventType exe.Event_Type, dispatch DispatchFunc) error //TLSConfig setting TLS Connection to remote server TLSConfig(config *tls.Config, handshakeTimeout time.Duration) //Start starts the Connection to remote server. Start(endpoint string, path string) error //Stop kills the transporter. Stop(graceful bool) //Send sends message to remote process. Will stop sending when Connection is stopped. //if aliveLoop is true, keep connection alive for incomming package Send(call *exe.Call, aliveLoop bool) error //Recv receives message initialtively Recv() (*exe.Event, error) //GetConnStatus return connection status GetConnStatus() Status }
Connection maintain http connection with Mesos slave
type DispatchFunc ¶
DispatchFunc dispatch event message to HandleFunc
type FakeConnection ¶
type FakeConnection struct {
// contains filtered or unexported fields
}
FakeConnection is a proxy Connection for testing Executor message register, runTaskGroup, shutdown
func (*FakeConnection) GetConnStatus ¶
func (httpConn *FakeConnection) GetConnStatus() Status
GetConnStatus return connection status
func (*FakeConnection) Install ¶
func (httpConn *FakeConnection) Install(eventType exe.Event_Type, dispatch DispatchFunc) error
Install mount an handler based on incoming message name.
func (*FakeConnection) Recv ¶
func (httpConn *FakeConnection) Recv() (*exe.Event, error)
Recv receives message initialtively
func (*FakeConnection) Send ¶
func (httpConn *FakeConnection) Send(call *exe.Call, keepAlive bool) error
Send sends message to remote process. Will stop sending when Connection is stopped. if aliveLoop is true, keep connection alive for incomming package, when new message coming, dispatch message to installed callback handlerFunc
func (*FakeConnection) Start ¶
func (httpConn *FakeConnection) Start(endpoint string, path string) error
Start starts the Connection to remote server. endpoint: remote endpoint url info, like mesos-slave:8080, mesos-slave:8080 path: remote, like /v1/executor
func (*FakeConnection) Stop ¶
func (httpConn *FakeConnection) Stop(graceful bool)
Stop kills the transporter.
type HTTPConnection ¶
type HTTPConnection struct {
// contains filtered or unexported fields
}
HTTPConnection implement Connection interface communicate mesos slave
func (*HTTPConnection) GetConnStatus ¶
func (httpConn *HTTPConnection) GetConnStatus() Status
GetConnStatus return connection status
func (*HTTPConnection) Install ¶
func (httpConn *HTTPConnection) Install(eventType exe.Event_Type, dispatch DispatchFunc) error
Install mount an handler based on incoming message name.
func (*HTTPConnection) Recv ¶
func (httpConn *HTTPConnection) Recv() (*exe.Event, error)
Recv receives message initialtively
func (*HTTPConnection) Send ¶
func (httpConn *HTTPConnection) Send(call *exe.Call, keepAlive bool) error
Send sends message to remote process. Will stop sending when Connection is stopped. if aliveLoop is true, keep connection alive for incomming package, when new message coming, dispatch message to installed callback handlerFunc
func (*HTTPConnection) Start ¶
func (httpConn *HTTPConnection) Start(endpoint string, path string) error
Start starts the Connection to remote server. endpoint: remote endpoint url info, like mesos-slave:8080, mesos-slave:8080 path: remote, like /v1/executor
func (*HTTPConnection) Stop ¶
func (httpConn *HTTPConnection) Stop(graceful bool)
Stop kills the transporter.
type HandleFunc ¶
HandleFunc handlefunc is call back for receiving message from: Message from server msg: receiving message