Documentation ¶
Overview ¶
* Copyright 2018 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 2018 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 2018 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 2018 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 2018 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 2018 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 2018 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 2018 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 2018 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
- func NewAccountControllerTest() suite.TestingSuite
- func NewNodeControllerTest() suite.TestingSuite
- func NewPodControllerTest() suite.TestingSuite
- type AccountController
- type ApplicationDigest
- type ApplicationFilter
- type ContainerController
- type ContainerInfo
- type EventHandler
- type NodeController
- type NodeRecord
- type NodeState
- type PodController
- type SystemController
Constants ¶
const ( NODE_PUBLISH_INTERVAL = 30 * time.Second NODE_RECORD_LIFETIME = 90 * time.Second )
const ACCOUNT = "cat"
const ACCOUNT_LIFETIME = 600 * time.Second
const ACCOUNT_STATE_RESOURCE_LIFETIME = 180 * time.Second
const (
ContainerLabelPodUUID = "pod-uuid"
)
const NODE_ID = "012345678901234567890123456789ab"
const (
TEST_NID = ""
)
Variables ¶
This section is empty.
Functions ¶
func NewAccountControllerTest ¶
func NewAccountControllerTest() suite.TestingSuite
func NewNodeControllerTest ¶
func NewNodeControllerTest() suite.TestingSuite
func NewPodControllerTest ¶
func NewPodControllerTest() suite.TestingSuite
Types ¶
type AccountController ¶
type AccountController interface { DealLocalResource(raw []byte) (bool, error) GetAccountName() string GetPodState() (map[string]core.AccountPodState, error) GetNodeState() (map[string]core.AccountNodeState, error) UpdatePodAndNodeState(account string, pods map[string]core.AccountPodState, nodeID string, nodeState *core.AccountNodeState) error }
func NewAccountController ¶
func NewAccountController(account, localNid string, accountKvs kvs.AccountKvs) AccountController
type ApplicationDigest ¶
type ApplicationFilter ¶
type ApplicationFilter interface { SetAccount(account string) SetFilter(filter string) SetSamplePrefix(prefix string) IsAllowed(pod *coreAPI.Pod) bool }
func NewApplicationFilter ¶
func NewApplicationFilter() ApplicationFilter
type ContainerController ¶
type ContainerController interface { GetContainerInfos() []*ContainerInfo Reconcile(ctx context.Context, podUuid string) error }
func NewContainerController ¶
type ContainerInfo ¶
type EventHandler ¶
type NodeController ¶
type NodeController interface { GetNid() string GetNodeState() *coreAPI.AccountNodeState ReceivePublishingNode(state NodeState) error SetPosition(position *coreAPI.Vector3) error GetPosition() *coreAPI.Vector3 SetPublicity(r float64) error ListNode() ([]NodeState, error) }
func NewNodeController ¶
func NewNodeController(ctx context.Context, col colonio.Colonio, messaging driver.MessagingDriver, account, nodeName string, nodeType coreAPI.NodeType) NodeController
type NodeRecord ¶
type NodeRecord struct {
// contains filtered or unexported fields
}
type PodController ¶
type PodController interface { DealLocalResource(raw []byte) (bool, error) Create(name, owner, creatorNode string, spec *core.PodSpec) (*ApplicationDigest, error) GetPodData(uuid string) (*core.Pod, error) GetContainerStateMessage(pod *core.Pod) string Migrate(uuid string, targetNodeID string) error Delete(uuid string) error Cleanup(uuid string) error }
func NewPodController ¶
func NewPodController(podKvs kvs.PodKvs, messaging driver.MessagingDriver, localNid string) PodController
type SystemController ¶
type SystemController interface { Start(ctx context.Context) error Connect(url, account, token, nodeName, nodeType string) error Disconnect() error GetAccount() string GetNode() string }
func NewSystemController ¶
func NewSystemController(col colonio.Colonio, evh EventHandler, frontendDriver driver.FrontendDriver) SystemController
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
* Copyright 2018 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.
|
* Copyright 2018 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. |