String is a string variable of ServerRole.
()
| 232 | |
| 233 | // String is a string variable of ServerRole. |
| 234 | func (s ServerRole) String() string { |
| 235 | switch s { |
| 236 | case Leader: |
| 237 | return "Leader" |
| 238 | case Follower: |
| 239 | return "Follower" |
| 240 | case Miner: |
| 241 | return "Miner" |
| 242 | case Client: |
| 243 | return "Client" |
| 244 | } |
| 245 | return "Unknown" |
| 246 | } |
| 247 | |
| 248 | // MarshalYAML implements the yaml.Marshaler interface. |
| 249 | func (s ServerRole) MarshalYAML() (interface{}, error) { |
no outgoing calls