github.com/machinefi/w3bstream@v1.6.5-rc9.0.20240426031326-b8c7c4876e72/pkg/depends/kit/statusxgen/__examples__/status_error.go (about)

     1  package examples
     2  
     3  import "net/http"
     4  
     5  type StatusError int
     6  
     7  func (StatusError) ServiceCode() int {
     8  	return 999 * 1e3
     9  }
    10  
    11  const (
    12  	// InternalServerError 内部错误
    13  	InternalServerError StatusError = http.StatusInternalServerError*1e6 + iota + 1
    14  )
    15  
    16  const (
    17  	// @errTalk Unauthorized
    18  	Unauthorized StatusError = http.StatusUnauthorized*1e6 + iota + 1
    19  )