Documentation ¶
Overview ¶
Package quicmemberlist is transport layer of memberlist, based on quic stream.
Index ¶
- Variables
- func BasicMemberlistConfig(name string, bind, advertise *net.UDPAddr) *memberlist.Config
- type AliveDelegate
- type BaseNode
- func (n BaseNode) Address() base.Address
- func (n *BaseNode) DecodeJSON(b []byte, enc *jsonenc.Encoder) error
- func (n BaseNode) HashBytes() []byte
- func (n BaseNode) IsValid([]byte) error
- func (n BaseNode) JoinedAt() time.Time
- func (n BaseNode) MarshalJSON() ([]byte, error)
- func (n BaseNode) MarshalZerologObject(e *zerolog.Event)
- func (n BaseNode) MetaBytes() []byte
- func (n BaseNode) Name() string
- func (n BaseNode) Publickey() base.Publickey
- func (n BaseNode) Publish() NamedConnInfo
- func (n BaseNode) String() string
- func (n BaseNode) TLSInsecure() bool
- func (n BaseNode) UDPAddr() *net.UDPAddr
- func (n BaseNode) UDPConnInfo() quicstream.UDPConnInfo
- type Broadcast
- type Delegate
- type DelegateJoinedFunc
- type DelegateLeftFunc
- type DelegateNodeFunc
- type DelegateStoreConnInfo
- type EventsDelegate
- type Memberlist
- func (srv *Memberlist) Broadcast(b memberlist.Broadcast)
- func (srv *Memberlist) IsJoined() bool
- func (srv *Memberlist) Join(cis []quicstream.UDPConnInfo) error
- func (srv *Memberlist) Leave(timeout time.Duration) error
- func (srv *Memberlist) Members(f func(node Node) bool)
- func (srv *Memberlist) MembersLen() int
- func (srv *Memberlist) Remotes(f func(node Node) bool)
- func (srv *Memberlist) SetLogging(l *logging.Logging) *logging.Logging
- func (srv *Memberlist) SetNotifyMsg(f func([]byte))
- func (srv *Memberlist) SetWhenLeftFunc(f func(Node))
- func (srv *Memberlist) Start(ctx context.Context) error
- type NamedAddr
- type NamedConnInfo
- func (c NamedConnInfo) Addr() net.Addr
- func (c NamedConnInfo) IsValid([]byte) error
- func (c NamedConnInfo) MarshalText() ([]byte, error)
- func (c NamedConnInfo) String() string
- func (c NamedConnInfo) TLSInsecure() bool
- func (c NamedConnInfo) UDPConnInfo() (ci quicstream.UDPConnInfo, _ error)
- func (c *NamedConnInfo) UnmarshalText(b []byte) error
- type Node
- type Transport
- func (t *Transport) DialAddressTimeout(addr memberlist.Address, timeout time.Duration) (net.Conn, error)
- func (t *Transport) DialTimeout(addr string, timeout time.Duration) (net.Conn, error)
- func (t *Transport) FinalAdvertiseAddr(ip string, port int) (net.IP, int, error)
- func (t *Transport) PacketCh() <-chan *memberlist.Packet
- func (t *Transport) ReceiveRaw(b []byte, addr net.Addr) error
- func (t *Transport) Shutdown() error
- func (t *Transport) Start(context.Context) error
- func (t *Transport) StreamCh() <-chan net.Conn
- func (t *Transport) WriteTo(b []byte, addr string) (time.Time, error)
- func (t *Transport) WriteToAddress(b []byte, addr memberlist.Address) (time.Time, error)
- type TransportDialFunc
- type TransportGetConnInfo
- type TransportWriteFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var NodeHint = hint.MustNewHint("memberlist-node-v0.0.1")
Functions ¶
func BasicMemberlistConfig ¶
func BasicMemberlistConfig(name string, bind, advertise *net.UDPAddr) *memberlist.Config
Types ¶
type AliveDelegate ¶
func NewAliveDelegate ¶
func NewAliveDelegate( enc *jsonenc.Encoder, laddr *net.UDPAddr, challengef DelegateNodeFunc, allowf DelegateNodeFunc, ) *AliveDelegate
func (*AliveDelegate) NotifyAlive ¶
func (d *AliveDelegate) NotifyAlive(peer *memberlist.Node) error
type BaseNode ¶
type BaseNode struct { hint.BaseHinter // contains filtered or unexported fields }
func (BaseNode) MarshalJSON ¶
func (BaseNode) MarshalZerologObject ¶
func (BaseNode) Publish ¶
func (n BaseNode) Publish() NamedConnInfo
func (BaseNode) TLSInsecure ¶
func (BaseNode) UDPConnInfo ¶
func (n BaseNode) UDPConnInfo() quicstream.UDPConnInfo
type Broadcast ¶
type Broadcast struct {
// contains filtered or unexported fields
}
func NewBroadcast ¶
func (*Broadcast) Invalidates ¶
func (b *Broadcast) Invalidates(o memberlist.Broadcast) bool
func (*Broadcast) MarshalZerologObject ¶
func (*Broadcast) UniqueBroadcast ¶
func (*Broadcast) UniqueBroadcast()
type Delegate ¶
func NewDelegate ¶
func (*Delegate) GetBroadcasts ¶
func (*Delegate) LocalState ¶
func (*Delegate) MergeRemoteState ¶
func (*Delegate) QueueBroadcast ¶
func (d *Delegate) QueueBroadcast(b memberlist.Broadcast)
type DelegateJoinedFunc ¶
type DelegateJoinedFunc func(Node)
type DelegateLeftFunc ¶
type DelegateLeftFunc func(Node)
type DelegateNodeFunc ¶
type DelegateStoreConnInfo ¶
type DelegateStoreConnInfo func(quicstream.UDPConnInfo)
type EventsDelegate ¶
func NewEventsDelegate ¶
func NewEventsDelegate( enc *jsonenc.Encoder, joinedf DelegateJoinedFunc, leftf DelegateLeftFunc, ) *EventsDelegate
func (*EventsDelegate) NotifyJoin ¶
func (d *EventsDelegate) NotifyJoin(peer *memberlist.Node)
func (*EventsDelegate) NotifyLeave ¶
func (d *EventsDelegate) NotifyLeave(peer *memberlist.Node)
func (*EventsDelegate) NotifyUpdate ¶
func (d *EventsDelegate) NotifyUpdate(peer *memberlist.Node)
type Memberlist ¶
type Memberlist struct { *logging.Logging *util.ContextDaemon // contains filtered or unexported fields }
func NewMemberlist ¶
func NewMemberlist( local Node, enc *jsonenc.Encoder, config *memberlist.Config, sameMemberLimit uint64, ) (*Memberlist, error)
func (*Memberlist) Broadcast ¶
func (srv *Memberlist) Broadcast(b memberlist.Broadcast)
func (*Memberlist) IsJoined ¶
func (srv *Memberlist) IsJoined() bool
IsJoined indicates whether local is joined in remote network. If no other remote nodes, IsJoined will be false.
func (*Memberlist) Join ¶
func (srv *Memberlist) Join(cis []quicstream.UDPConnInfo) error
func (*Memberlist) Members ¶
func (srv *Memberlist) Members(f func(node Node) bool)
func (*Memberlist) MembersLen ¶
func (srv *Memberlist) MembersLen() int
func (*Memberlist) Remotes ¶
func (srv *Memberlist) Remotes(f func(node Node) bool)
func (*Memberlist) SetLogging ¶
func (srv *Memberlist) SetLogging(l *logging.Logging) *logging.Logging
func (*Memberlist) SetNotifyMsg ¶
func (srv *Memberlist) SetNotifyMsg(f func([]byte))
func (*Memberlist) SetWhenLeftFunc ¶
func (srv *Memberlist) SetWhenLeftFunc(f func(Node))
type NamedConnInfo ¶
type NamedConnInfo struct {
// contains filtered or unexported fields
}
func NewNamedConnInfo ¶
func NewNamedConnInfo(addr string, tlsinsecure bool) NamedConnInfo
func (NamedConnInfo) Addr ¶
func (c NamedConnInfo) Addr() net.Addr
func (NamedConnInfo) IsValid ¶
func (c NamedConnInfo) IsValid([]byte) error
func (NamedConnInfo) MarshalText ¶
func (c NamedConnInfo) MarshalText() ([]byte, error)
func (NamedConnInfo) String ¶
func (c NamedConnInfo) String() string
func (NamedConnInfo) TLSInsecure ¶
func (c NamedConnInfo) TLSInsecure() bool
func (NamedConnInfo) UDPConnInfo ¶
func (c NamedConnInfo) UDPConnInfo() (ci quicstream.UDPConnInfo, _ error)
func (*NamedConnInfo) UnmarshalText ¶
func (c *NamedConnInfo) UnmarshalText(b []byte) error
type Transport ¶
func NewTransport ¶
func NewTransport( laddr *net.UDPAddr, dialf TransportDialFunc, writef TransportWriteFunc, notallowf func(string) bool, ) *Transport
func NewTransportWithQuicstream ¶
func NewTransportWithQuicstream( laddr *net.UDPAddr, handlerPrefix string, poolclient *quicstream.PoolClient, newClient func(quicstream.UDPConnInfo) func(*net.UDPAddr) *quicstream.Client, notallowf func(string) bool, ) *Transport
func (*Transport) DialAddressTimeout ¶
func (*Transport) DialTimeout ¶
func (*Transport) FinalAdvertiseAddr ¶
func (*Transport) PacketCh ¶
func (t *Transport) PacketCh() <-chan *memberlist.Packet
func (*Transport) WriteToAddress ¶
type TransportDialFunc ¶
type TransportDialFunc func(context.Context, quicstream.UDPConnInfo) (quic.EarlyConnection, error)
type TransportGetConnInfo ¶
type TransportGetConnInfo func(*net.UDPAddr) quicstream.UDPConnInfo
type TransportWriteFunc ¶
type TransportWriteFunc func(context.Context, quicstream.UDPConnInfo, []byte) error
Click to show internal directories.
Click to hide internal directories.