Documentation ¶
Index ¶
- Constants
- func CallAllClient[T MergeResult](r *RpcManager, ctx context.Context, method string, req any, res T) error
- func GetSelfAddress(info []*config.Address) *config.Address
- type AddressManager
- func (a *AddressManager) GeneratorConnectionAddress() *event.Address
- func (a *AddressManager) GeneratorLocalID() string
- func (a *AddressManager) GeneratorRoomAddress() *event.Address
- func (a *AddressManager) GetMachineIpInfo() map[string]*config.Address
- func (a *AddressManager) GetSelfAddress() *config.Address
- func (a *AddressManager) GetSelfMachineID() string
- func (a *AddressManager) IsSelfMachineAddress(address *event.Address) bool
- type MergeResult
- type Result
- type RpcClient
- type RpcManager
Constants ¶
View Source
const LOCAL_NAME = "local"
Variables ¶
This section is empty.
Functions ¶
func CallAllClient ¶
func CallAllClient[T MergeResult](r *RpcManager, ctx context.Context, method string, req any, res T) error
Types ¶
type AddressManager ¶
type AddressManager struct {
// contains filtered or unexported fields
}
func NewAddressManager ¶
func NewAddressManager(c *config.Config) (*AddressManager, error)
func (*AddressManager) GeneratorConnectionAddress ¶
func (a *AddressManager) GeneratorConnectionAddress() *event.Address
func (*AddressManager) GeneratorLocalID ¶
func (a *AddressManager) GeneratorLocalID() string
func (*AddressManager) GeneratorRoomAddress ¶
func (a *AddressManager) GeneratorRoomAddress() *event.Address
func (*AddressManager) GetMachineIpInfo ¶
func (a *AddressManager) GetMachineIpInfo() map[string]*config.Address
func (*AddressManager) GetSelfAddress ¶
func (a *AddressManager) GetSelfAddress() *config.Address
func (*AddressManager) GetSelfMachineID ¶
func (a *AddressManager) GetSelfMachineID() string
func (*AddressManager) IsSelfMachineAddress ¶
func (a *AddressManager) IsSelfMachineAddress(address *event.Address) bool
type MergeResult ¶
type MergeResult interface { Merge(result MergeResult) error New() MergeResult }
type RpcClient ¶
type RpcClient struct { state.StatusMachine // contains filtered or unexported fields }
func NewRpcClient ¶
type RpcManager ¶
type RpcManager struct {
// contains filtered or unexported fields
}
func NewRpcManager ¶
func NewRpcManager(addressManager *AddressManager) *RpcManager
func (*RpcManager) GetRpcByAddress ¶
func (r *RpcManager) GetRpcByAddress(address *event.Address) *RpcClient
func (*RpcManager) GetRpcList ¶
func (r *RpcManager) GetRpcList() []*RpcClient
func (*RpcManager) Regist ¶
func (r *RpcManager) Regist(name string, api interface{}) error
func (*RpcManager) Run ¶
func (r *RpcManager) Run()
Click to show internal directories.
Click to hide internal directories.