Documentation
¶
Index ¶
- func MapApiPosToModelPos(apiPos SwitchMachinePosition) switchmachine.Position
- type Error
- type GPIOState
- type SwitchMachine
- func (this *SwitchMachine) GPIO0State() switchmachine.GPIOState
- func (this *SwitchMachine) GPIO1State() switchmachine.GPIOState
- func (this *SwitchMachine) Id() switchmachine.Id
- func (this *SwitchMachine) MotorState() switchmachine.MotorState
- func (this *SwitchMachine) Position() switchmachine.Position
- func (this *SwitchMachine) UpdateTime() time.Time
- type SwitchMachineEvent
- type SwitchMachineEventType
- type SwitchMachineId
- type SwitchMachineMotorState
- type SwitchMachinePosition
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MapApiPosToModelPos ¶
func MapApiPosToModelPos(apiPos SwitchMachinePosition) switchmachine.Position
Types ¶
type GPIOState ¶
type GPIOState string
func MapModelGPIOToAPI ¶
func MapModelGPIOToAPI(modelGPIO switchmachine.GPIOState) GPIOState
type SwitchMachine ¶
type SwitchMachine struct { SMId SwitchMachineId `json:"id"` Pos SwitchMachinePosition `json:"position"` Motor SwitchMachineMotorState `json:"motorState"` Gpio0 GPIOState `json:"gpio0"` Gpio1 GPIOState `json:"gpio1"` UpdTimeMillis int64 `json:"updateTimeMillis"` OriginServerId uuid.UUID `json:"originServerId"` }
func NewAPISwitchMachineFromModel ¶
func NewAPISwitchMachineFromModel(modelSM switchmachine.State) *SwitchMachine
func (*SwitchMachine) GPIO0State ¶
func (this *SwitchMachine) GPIO0State() switchmachine.GPIOState
func (*SwitchMachine) GPIO1State ¶
func (this *SwitchMachine) GPIO1State() switchmachine.GPIOState
func (*SwitchMachine) Id ¶
func (this *SwitchMachine) Id() switchmachine.Id
func (*SwitchMachine) MotorState ¶
func (this *SwitchMachine) MotorState() switchmachine.MotorState
func (*SwitchMachine) Position ¶
func (this *SwitchMachine) Position() switchmachine.Position
func (*SwitchMachine) UpdateTime ¶
func (this *SwitchMachine) UpdateTime() time.Time
type SwitchMachineEvent ¶
type SwitchMachineEvent struct { EventType SwitchMachineEventType `json:"eventType"` SwitchMachineState *SwitchMachine `json:"switchMachineState"` }
type SwitchMachineEventType ¶
type SwitchMachineEventType string
const ( SMAdded SwitchMachineEventType = "SwitchMachineAdded" SMRemoved SwitchMachineEventType = "SwitchMachineRemoved" SMUpdated SwitchMachineEventType = "SwitchMachineUpdated" )
func MapSMEventToAPISMEventType ¶
func MapSMEventToAPISMEventType(e event.SwitchMachineEvent) SwitchMachineEventType
type SwitchMachineId ¶
type SwitchMachineId int
type SwitchMachineMotorState ¶
type SwitchMachineMotorState string
const ( IDLE SwitchMachineMotorState = "idle" TO_POSITION_0 SwitchMachineMotorState = "to position 0" TO_POSITION_1 SwitchMachineMotorState = "to position 1" BRAKE SwitchMachineMotorState = "brake" )
List of SwitchMachineMotorState
func MapModelMStateToAPIMState ¶
func MapModelMStateToAPIMState(mS switchmachine.MotorState) SwitchMachineMotorState
type SwitchMachinePosition ¶
type SwitchMachinePosition string
const ( Position0 SwitchMachinePosition = "position 0" Position1 SwitchMachinePosition = "position 1" Unknown SwitchMachinePosition = "unknown" )
List of SwitchMachinePosition
func MapModelPosToApiPos ¶
func MapModelPosToApiPos(modelPos switchmachine.Position) SwitchMachinePosition
Click to show internal directories.
Click to hide internal directories.