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 = "A2" // Node ID. NidStrNone = "" NidStrThis = "." NidStrSeed = "seed" NidStrNext = "next" NidTypeNone = 0 NidTypeNormal = 1 NidTypeThis = 2 NidTypeSeed = 3 NidTypeNext = 4 // Packet mode. ModeNone = 0x0000 ModeResponse = 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 = uint32(0x01) HintRequireRandom = uint32(0x02) // Key of routineLocal GroupMutex = 1 LinkMutex = 2 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { SessionTimeout int64 `json:"sessionTimeout"` PollingTimeout int64 `json:"pollingTimeout"` Node *ConfigNode `json:"node,omitempty"` }
type ConfigCoordSystem2D ¶
type ConfigIceServer ¶
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"` Kvs *ConfigKvs `json:"kvs,omitempty"` Spread *ConfigSpread `json:"spread,omitempty"` }
type ConfigNodeAccessor ¶
type ConfigRouting ¶
type ConfigRouting struct { ForceUpdateCount *uint32 `json:"forceUpdateCount,omitempty"` SeedConnectInterval *uint32 `json:"seedConnectInterval,omitempty"` SeedConnectRate *uint32 `json:"seedConnectRate,omitempty"` SeedDisconnectThreshold *uint32 `json:"seedDisconnectThreshold,omitempty"` SeedInfoKeepThreshold *uint32 `json:"seedInfoKeepThreshold,omitempty"` SeedInfoNidsCount *uint32 `json:"seedInfoNidsCount,omitempty"` SeedNextPosition *float64 `json:"seedNextPosition,omitempty"` UpdatePeriod *uint32 `json:"updatePeriod,omitempty"` }
type ConfigSpread ¶
type ConfigSpread struct {
CacheTime *uint32 `json:"cacheTime,omitempty"`
}
type ContextKeyType ¶
type ContextKeyType string
const CONTEXT_REQUEST_KEY ContextKeyType = "requestID"
*
- CONTEXT_REQUEST_KEY is used to describe the request id for logs.
- caller module can set the request id for the value to `http.Request.ctx` using this key.
type Seed ¶
type TokenVerifier ¶
*
- TokenVerifier is an interface to implement the function of verifying the token received from the node.