Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var GetPartyIdFromIp = func(reqIpAddrAndPort string) (uint32, error) { arr := strings.Split(reqIpAddrAndPort, ":") if len(arr) != 2 { errText := fmt.Sprintf("requestのIpAddessの形式が異常: %s", reqIpAddrAndPort) logger.Error(errText) return 0, fmt.Errorf(errText) } reqIpAddr, _ := arr[0], arr[1] var partyId uint32 for _, party := range cs.Conf.RequestPartyList { if reqIpAddr == party.IpAddress { partyId = party.PartyId break } } if partyId == 0 { errText := fmt.Sprintf("PartyList[%s, %s, %s]に存在しないIPからのリクエスト: %s", cs.Conf.RequestPartyList[0].IpAddress, cs.Conf.RequestPartyList[1].IpAddress, cs.Conf.RequestPartyList[2].IpAddress, reqIpAddr) logger.Error(errText) return 0, fmt.Errorf(errText) } return partyId, nil }
モック時に置き換わる関数
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.