mock

package
v0.0.0-...-4e8b2ad Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

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.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Colonio

type Colonio struct {
	PositionX float64
	PositionY float64
	// contains filtered or unexported fields
}

func NewColonioMock

func NewColonioMock() *Colonio

mimic Colonio for testings

func (*Colonio) Connect

func (impl *Colonio) Connect(url, token string) error

func (*Colonio) DeleteKVSAll

func (impl *Colonio) DeleteKVSAll()

func (*Colonio) Disconnect

func (impl *Colonio) Disconnect() error

func (*Colonio) GetLastPosition

func (impl *Colonio) GetLastPosition() (float64, float64)

func (*Colonio) GetLocalNid

func (impl *Colonio) GetLocalNid() string

func (*Colonio) IsConnected

func (impl *Colonio) IsConnected() bool

func (*Colonio) KvsGet

func (impl *Colonio) KvsGet(key string) (colonio.Value, error)

func (*Colonio) KvsGetLocalData

func (impl *Colonio) KvsGetLocalData() colonio.KvsLocalData

func (*Colonio) KvsSet

func (impl *Colonio) KvsSet(key string, val interface{}, opt uint32) error

func (*Colonio) MessagingPost

func (impl *Colonio) MessagingPost(dst, name string, val interface{}, opt uint32) (colonio.Value, error)

func (*Colonio) MessagingSetHandler

func (impl *Colonio) MessagingSetHandler(name string, handler func(*colonio.MessagingRequest, colonio.MessagingResponseWriter))

func (*Colonio) MessagingUnsetHandler

func (impl *Colonio) MessagingUnsetHandler(name string)

func (*Colonio) SetPosition

func (impl *Colonio) SetPosition(x, y float64) (float64, float64, error)

func (*Colonio) SpreadPost

func (impl *Colonio) SpreadPost(x, y, r float64, name string, message interface{}, opt uint32) error

func (*Colonio) SpreadSetHandler

func (impl *Colonio) SpreadSetHandler(name string, handler func(*colonio.SpreadRequest))

func (*Colonio) SpreadUnsetHandler

func (impl *Colonio) SpreadUnsetHandler(name string)

type MessagingDriver

type MessagingDriver struct {
	Records []*MessagingRecord
	// contains filtered or unexported fields
}

func NewMessagingDriverMock

func NewMessagingDriverMock() *MessagingDriver

func (*MessagingDriver) PublishNode

func (md *MessagingDriver) PublishNode(r float64, nid, name, account string, nodeType core.NodeType, position *core.Vector3) error

func (*MessagingDriver) ReconcileContainer

func (md *MessagingDriver) ReconcileContainer(nid, podUuid string) error

func (*MessagingDriver) ResetRecord

func (md *MessagingDriver) ResetRecord()

type MessagingRecord

type MessagingRecord struct {
	DestNodeID         string
	DestR              float64
	DestPosition       core.Vector3
	PublishNode        *messaging.PublishNode
	ReconcileContainer *messaging.ReconcileContainer
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL