response_v1.go 666 B

1234567891011121314151617181920212223242526
  1. package store
  2. import (
  3. "time"
  4. )
  5. // The response from the store to the user who issue a command
  6. type Response struct {
  7. Action string `json:"action"`
  8. Key string `json:"key"`
  9. Dir bool `json:"dir,omitempty"`
  10. PrevValue *string `json:"prevValue,omitempty"`
  11. Value *string `json:"value,omitempty"`
  12. // If the key did not exist before the action,
  13. // this field should be set to true
  14. NewKey bool `json:"newKey,omitempty"`
  15. Expiration *time.Time `json:"expiration,omitempty"`
  16. // Time to live in second
  17. TTL int64 `json:"ttl,omitempty"`
  18. // The command index of the raft machine when the command is executed
  19. Index uint64 `json:"index"`
  20. }