server-go/client/connector.go
crusader 9b450e0195 ing
2018-04-12 14:55:01 +09:00

34 lines
494 B
Go

package client
type Connector interface {
Connect() (readChan <-chan []byte, writeChan chan<- []byte, err error)
Disconnect() error
GetName() string
Clone() Connector
Validate() error
}
type Connectors struct {
Name string `json:"name"`
}
func (c *Connectors) GetName() string {
return c.Name
}
func (c *Connectors) Clone() *Connectors {
return &Connectors{
Name: c.Name,
}
}
func (c *Connectors) Validate() error {
if "" == c.Name {
c.Name = "Connector"
}
return nil
}