Skip to content
Snippets Groups Projects
Select Git revision
  • f753a6bec57bb76f8cb2ba78ce3208c1b8fb6be3
  • main default protected
  • dev protected
  • hotfixes-oct-2022
  • refactor/avatar-cell
  • 1.1.5
  • 1.1.4
  • 1.1.3
  • 1.1
  • 1.0.8
  • 1.0.7
  • 1.0.6
12 results

readme.md

Blame
  • status.go 1003 B
    ////////////////////////////////////////////////////////////////////////////////
    // Copyright © 2020 xx network SEZC                                           //
    //                                                                            //
    // Use of this source code is governed by a license that can be found in the  //
    // LICENSE file                                                               //
    ////////////////////////////////////////////////////////////////////////////////
    
    package stoppable
    
    import (
    	"strconv"
    )
    
    const (
    	Running Status = iota
    	Stopping
    	Stopped
    )
    
    // Status holds the current status of a Stoppable.
    type Status uint32
    
    // String prints a string representation of the current Status. This functions
    // satisfies the fmt.Stringer interface.
    func (s Status) String() string {
    	switch s {
    	case Running:
    		return "running"
    	case Stopping:
    		return "stopping"
    	case Stopped:
    		return "stopped"
    	default:
    		return "INVALID STATUS: " + strconv.FormatUint(uint64(s), 10)
    	}
    }