swiftgemini

[ACTIVE] gemini protocol in swift
git clone git://git.figbert.com/swiftgemini.git
Log | Files | Refs | README

StatusCode.swift (1830B)


      1 import Foundation
      2 
      3 public enum StatusCode: Int {
      4     case Input               = 10
      5     case SensitiveInput      = 11
      6     case Success             = 20
      7     case TemporaryRedirect   = 30
      8     case PermanentRedirect   = 31
      9     case TemporaryFailure    = 40
     10     case ServerUnavailable   = 41
     11     case CGIError            = 42
     12     case ProxyError          = 43
     13     case SlowDown            = 44
     14     case PermanentFailure    = 50
     15     case NotFound            = 51
     16     case Gone                = 52
     17     case ProxyRequestRefused = 53
     18     case BadRequest          = 59
     19     case ClientCertRequired  = 60
     20     case ClientCertNotAuth   = 61
     21     case ClientCertNotValid  = 62
     22 
     23     public var description: String {
     24         switch self {
     25         case .Input:               return "Input"
     26         case .SensitiveInput:      return "Sensitive Input"
     27         case .Success:             return "Success"
     28         case .TemporaryRedirect:   return "Redirect - Temporary"
     29         case .PermanentRedirect:   return "Redirect - Permanent"
     30         case .TemporaryFailure:    return "Temporary Failure"
     31         case .ServerUnavailable:   return "Server Unavailable"
     32         case .CGIError:            return "CGI Error"
     33         case .ProxyError:          return "Proxy Error"
     34         case .SlowDown:            return "Slow Down"
     35         case .PermanentFailure:    return "Permanent Failure"
     36         case .NotFound:            return "Not Found"
     37         case .Gone:                return "Gone"
     38         case .ProxyRequestRefused: return "Proxy Request Refused"
     39         case .BadRequest:          return "Bad Request"
     40         case .ClientCertRequired:  return "Client Certificate Required"
     41         case .ClientCertNotAuth:   return "Client Certificate Not Authorized"
     42         case .ClientCertNotValid:  return "Client Certificate Not Valid"
     43         }
     44     }
     45 }