Documentation
¶
Overview ¶
- Copyright (c) 2021. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
- Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
- Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
- Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
- Vestibulum commodo. Ut rhoncus gravida arcu. *
io 通信控制模块 管理所有的需要热重启的监听管理(端口监听), 只允许master执行新增, 序列化成描述信息+文件描述符列表,在fork worker时传递给worker, worker只允许使用传入进来的端口
Index ¶
- Variables
- func ResolveTCPAddr(ip string, port int) *net.TCPAddr
- type Controller
- func (c *Controller) All() []*tListener
- func (c *Controller) Close()
- func (c *Controller) Encode(startIndex int) ([]byte, []*os.File, error)
- func (c *Controller) Export(startIndex int) ([]*PbTraffic, []*os.File)
- func (c *Controller) IsStop() bool
- func (c *Controller) ListenTcp(ip string, port int) (net.Listener, error)
- func (c *Controller) Reset(ports []int) (bool, error)
- type EmptyTraffic
- type IController
- type ITraffic
- type PbTraffic
- func (*PbTraffic) Descriptor() ([]byte, []int)deprecated
- func (x *PbTraffic) GetAddr() string
- func (x *PbTraffic) GetFD() uint64
- func (x *PbTraffic) GetNetwork() string
- func (*PbTraffic) ProtoMessage()
- func (x *PbTraffic) ProtoReflect() protoreflect.Message
- func (x *PbTraffic) Reset()
- func (x *PbTraffic) String() string
- type PbTraffics
- type Traffic
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrorInvalidListener = errors.New("invalid port-reqiure")
)
View Source
var (
ErrorNotTcpListener = errors.New("not tcp port-reqiure")
)
View Source
var File_traffic_proto protoreflect.FileDescriptor
Functions ¶
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func (*Controller) All ¶
func (c *Controller) All() []*tListener
func (*Controller) Close ¶ added in v0.1.1
func (c *Controller) Close()
func (*Controller) Export ¶ added in v0.3.0
func (c *Controller) Export(startIndex int) ([]*PbTraffic, []*os.File)
func (*Controller) IsStop ¶ added in v0.5.0
func (c *Controller) IsStop() bool
type EmptyTraffic ¶ added in v0.5.0
type EmptyTraffic struct { }
func NewEmptyTraffic ¶ added in v0.5.0
func NewEmptyTraffic() *EmptyTraffic
func (*EmptyTraffic) Close ¶ added in v0.5.0
func (e *EmptyTraffic) Close()
func (*EmptyTraffic) IsStop ¶ added in v0.5.0
func (e *EmptyTraffic) IsStop() bool
type IController ¶
type IController interface { ITraffic Close() Reset(ports []int) (isCreate bool, err error) Export(int) ([]*PbTraffic, []*os.File) }
func NewController ¶
func NewController(r io.Reader) IController
type PbTraffic ¶
type PbTraffic struct { FD uint64 `protobuf:"varint,1,opt,name=FD,proto3" json:"FD,omitempty"` Addr string `protobuf:"bytes,2,opt,name=Addr,proto3" json:"Addr,omitempty"` Network string `protobuf:"bytes,3,opt,name=Network,proto3" json:"Network,omitempty"` // contains filtered or unexported fields }
func (*PbTraffic) Descriptor
deprecated
func (*PbTraffic) GetNetwork ¶
func (*PbTraffic) ProtoMessage ¶
func (*PbTraffic) ProtoMessage()
func (*PbTraffic) ProtoReflect ¶
func (x *PbTraffic) ProtoReflect() protoreflect.Message
type PbTraffics ¶
type PbTraffics struct { Traffic []*PbTraffic `protobuf:"bytes,1,rep,name=traffic,proto3" json:"traffic,omitempty"` // contains filtered or unexported fields }
func (*PbTraffics) Descriptor
deprecated
func (*PbTraffics) Descriptor() ([]byte, []int)
Deprecated: Use PbTraffics.ProtoReflect.Descriptor instead.
func (*PbTraffics) GetTraffic ¶
func (x *PbTraffics) GetTraffic() []*PbTraffic
func (*PbTraffics) ProtoMessage ¶
func (*PbTraffics) ProtoMessage()
func (*PbTraffics) ProtoReflect ¶
func (x *PbTraffics) ProtoReflect() protoreflect.Message
func (*PbTraffics) Reset ¶
func (x *PbTraffics) Reset()
func (*PbTraffics) String ¶
func (x *PbTraffics) String() string
type Traffic ¶
type Traffic struct {
// contains filtered or unexported fields
}
func NewTraffic ¶
func NewTraffic() *Traffic
Source Files
¶
Click to show internal directories.
Click to hide internal directories.