Documentation ¶
Overview ¶
* Copyright 2019-2021 Yuji Ito <llamerada.jp@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Copyright 2019-2021 Yuji Ito <llamerada.jp@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Copyright 2019-2021 Yuji Ito <llamerada.jp@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Copyright 2019-2021 Yuji Ito <llamerada.jp@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
Index ¶
Constants ¶
const ( // version ProtocolVersion = "A1" // Node ID. NidStrNone = "" NidStrThis = "." NidStrSeed = "seed" NidStrNext = "next" NidTypeNone = 0 NidTypeNormal = 1 NidTypeThis = 2 NidTypeSeed = 3 NidTypeNext = 4 // Packet mode. ModeNone = 0x0000 ModeReply = 0x0001 ModeExplicit = 0x0002 ModeOneWay = 0x0004 ModeRelaySeed = 0x0008 ModeNoRetry = 0x0010 ChannelNone = 0 ChannelMain = 1 ChannelSeedAccessor = 2 ChannelNodeAccessor = 3 // Commonly packet method. MethodError = 0xffff MethodFailure = 0xfffe MethodSuccess = 0xfffd MethodSeedAuth = 1 MethodSeedHint = 2 MethodSeedPing = 3 MethodSeedRequireRandom = 4 MethodWebrtcConnectOffer = 1 // Offer type of WebRTC connect. OfferTypeFirst = 0 // Hint HintOnlyone = 0x0001 HintAssigned = 0x0002 // Key of routineLocal GroupMutex = 1 LinkMutex = 2 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Revision float64 `json:"revision,omitempty"` PingInterval int64 `json:"pingInterval"` Timeout int64 `json:"timeout"` Node *ConfigNode `json:"node,omitempty"` }
type ConfigCoordSystem2D ¶
type ConfigIceServer ¶
type ConfigModule ¶
type ConfigModule struct { Type string `json:"type"` Channel uint32 `json:"channel"` RetryMax *uint32 `json:"retryMax,omitempty"` // for map RetryIntervalMin *uint32 `json:"retryIntervalMin,omitempty"` // for map RetryIntervalMax *uint32 `json:"retryIntervalMax,omitempty"` // for map CacheTime *uint32 `json:"cacheTime,omitempty"` // for pubsub_2d }
type ConfigNode ¶
type ConfigNode struct { Revision float64 `json:"revision"` NodeAccessor *ConfigNodeAccessor `json:"nodeAccessor,omitempty"` CoordSystem2d *ConfigCoordSystem2D `json:"coordSystem2D,omitempty"` IceServers []ConfigIceServer `json:"iceServers,omitempty"` Routing *ConfigRouting `json:"routing,omitempty"` Modules map[string]ConfigModule `json:"modules,omitempty"` }
type ConfigNodeAccessor ¶
type ConfigRouting ¶
type ConfigRouting struct { ForceUpdateCount *uint32 `json:"forceUpdateCount,omitempty"` SeedConnectInterval *uint32 `json:"seedConnectInterval,omitempty"` SeedConnectRate *uint32 `json:"seedConnectRate,omitempty"` SeedDisconnectThreathold *uint32 `json:"seedDisconnectThreathold,omitempty"` SeedInfoKeepThreathold *uint32 `json:"seedInfoKeepThreathold,omitempty"` SeedInfoNidsCount *uint32 `json:"seedInfoNidsCount,omitempty"` SeedNextPosition *float64 `json:"seedNextPosition,omitempty"` UpdatePeriod *uint32 `json:"updatePeriod,omitempty"` }