nop_command.go 392 B

1234567891011121314151617181920212223242526
  1. package raft
  2. import (
  3. "io"
  4. )
  5. // NOP command
  6. type NOPCommand struct {
  7. }
  8. // The name of the NOP command in the log
  9. func (c NOPCommand) CommandName() string {
  10. return "raft:nop"
  11. }
  12. func (c NOPCommand) Apply(server *Server) (interface{}, error) {
  13. return nil, nil
  14. }
  15. func (c NOPCommand) Encode(w io.Writer) error {
  16. return nil
  17. }
  18. func (c NOPCommand) Decode(r io.Reader) error {
  19. return nil
  20. }