Documentation ¶
Index ¶
- Constants
- Variables
- func GetOutboundIP() net.IP
- func RegisterHippoAddress(svc HippoAddressServiceInterface) error
- type Addresses
- type Client
- func (client *Client) Addresses(number int, reply *[]byte) error
- func (client *Client) AddressesRefresh(refresh RefreshStruct, reply *[]byte) error
- func (client *Client) Close()
- func (client *Client) Ping(request string, reply *string) error
- func (client *Client) Register(address string, reply *string) error
- type HippoAddressServiceInterface
- type RefreshStruct
- type ServiceStruct
Constants ¶
View Source
const ( // HippoAddressServiceName ... HippoAddressServiceName = "github.com/XieGuochao/HippoCoinRegister" // TTL ... // The TTL is 60 seconds TTL = 60 // MaxQuery ... MaxQuery = 30 // MaxCycle ... MaxCycle = 5 // NumPerCycle ... NumPerCycle = 20 // Threshold ... Threshold = 0.2 )
Variables ¶
View Source
var Cache sync.Map
Cache ...
Functions ¶
func GetOutboundIP ¶
GetOutboundIP ... Get preferred outbound ip of this machine
func RegisterHippoAddress ¶
func RegisterHippoAddress(svc HippoAddressServiceInterface) error
RegisterHippoAddress ...
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client ...
func CreateClient ¶
CreateClient ...
func (*Client) AddressesRefresh ¶
func (client *Client) AddressesRefresh(refresh RefreshStruct, reply *[]byte) error
AddressesRefresh ... Get up to 30 addresses.
type HippoAddressServiceInterface ¶
type HippoAddressServiceInterface = interface { Ping(request string, reply *string) error Register(address string, reply *string) error Addresses(number int, reply *[]byte) error AddressesRefresh(refresh RefreshStruct, reply *[]byte) error }
HippoAddressServiceInterface ...
type ServiceStruct ¶
type ServiceStruct struct { }
ServiceStruct ...
func (*ServiceStruct) Addresses ¶
func (s *ServiceStruct) Addresses(number int, reply *[]byte) error
Addresses ...
func (*ServiceStruct) AddressesRefresh ¶
func (s *ServiceStruct) AddressesRefresh(refresh RefreshStruct, reply *[]byte) error
AddressesRefresh ... Get the addresses and refresh expiration
Click to show internal directories.
Click to hide internal directories.