mirror of
https://github.com/saymrwulf/swisspost-evoting-go-poc.git
synced 2026-09-10 21:20:53 +00:00
29 lines
1 KiB
Go
29 lines
1 KiB
Go
|
|
package party
|
||
|
|
|
||
|
|
import (
|
||
|
|
"fmt"
|
||
|
|
|
||
|
|
"github.com/user/evote/pkg/transport"
|
||
|
|
)
|
||
|
|
|
||
|
|
// Phase message handlers. These are filled in incrementally (setup, then
|
||
|
|
// voting, then tally). Until a phase is implemented its handler rejects unknown
|
||
|
|
// message types cleanly rather than panicking — the transport boundary must
|
||
|
|
// never crash on an unexpected message.
|
||
|
|
|
||
|
|
func (p *SetupComponent) handleSetupMsg(env *transport.Envelope) (*transport.Envelope, error) {
|
||
|
|
return nil, fmt.Errorf("%s: unhandled message type %q", p.id.Name, env.Type)
|
||
|
|
}
|
||
|
|
|
||
|
|
func (p *ControlComponent) handleCCMsg(env *transport.Envelope) (*transport.Envelope, error) {
|
||
|
|
return nil, fmt.Errorf("%s: unhandled message type %q", p.id.Name, env.Type)
|
||
|
|
}
|
||
|
|
|
||
|
|
func (p *ElectoralBoard) handleEBMsg(env *transport.Envelope) (*transport.Envelope, error) {
|
||
|
|
return nil, fmt.Errorf("%s: unhandled message type %q", p.id.Name, env.Type)
|
||
|
|
}
|
||
|
|
|
||
|
|
func (p *VotingServer) handleServerMsg(env *transport.Envelope) (*transport.Envelope, error) {
|
||
|
|
return nil, fmt.Errorf("%s: unhandled message type %q", p.id.Name, env.Type)
|
||
|
|
}
|