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
- type Controller
- type EmptyTraffic
- type IController
- type ITraffic
- type Matcher
- type MatcherData
- 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
- type TrafficType
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrorInvalidListener = errors.New("invalid port-reqiure")
)
View Source
var File_traffic_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
*Traffic
}
func (*Controller) Export ¶ added in v0.3.0
func (c *Controller) Export(startIndex int) ([]*PbTraffic, []*os.File)
func (*Controller) Shutdown ¶ added in v0.7.0
func (c *Controller) Shutdown()
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
func (*EmptyTraffic) ListenTcp ¶ added in v0.5.0
func (e *EmptyTraffic) ListenTcp(port int, trafficType TrafficType) net.Listener
type IController ¶
type IController interface { ITraffic Shutdown() //Reset(ports []int) (isCreate bool, err error) Export(int) ([]*PbTraffic, []*os.File) }
func ReadController ¶ added in v0.7.0
type ITraffic ¶
type ITraffic interface { ListenTcp(port int, trafficType TrafficType) net.Listener IsStop() bool Close() }
type Matcher ¶ added in v0.7.0
func NewMatcher ¶ added in v0.7.0
func NewMatcher(port int, ls ...*net.TCPListener) *Matcher
func (*Matcher) Listeners ¶ added in v0.7.0
func (m *Matcher) Listeners() []*net.TCPListener
type MatcherData ¶ added in v0.7.0
type MatcherData struct {
// contains filtered or unexported fields
}
func NewMatcherData ¶ added in v0.7.0
func NewMatcherData(tfConf ...*PbTraffic) *MatcherData
func (*MatcherData) All ¶ added in v0.7.0
func (m *MatcherData) All() map[int]*Matcher
func (*MatcherData) Clone ¶ added in v0.7.0
func (m *MatcherData) Clone() *MatcherData
func (*MatcherData) Get ¶ added in v0.7.0
func (m *MatcherData) Get(port int) *Matcher
func (*MatcherData) Set ¶ added in v0.7.0
func (m *MatcherData) Set(port int, mux *Matcher)
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 TrafficType ¶ added in v0.7.0
const ( Any TrafficType = iota Http1 Https Http2 Websocket GRPC )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.