MCPcopy
hub / github.com/connectrpc/connect-go / String

Method String

code.go:110–146  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

108)
109
110func (c Code) String() string {
111 switch c {
112 case CodeCanceled:
113 return "canceled"
114 case CodeUnknown:
115 return "unknown"
116 case CodeInvalidArgument:
117 return "invalid_argument"
118 case CodeDeadlineExceeded:
119 return "deadline_exceeded"
120 case CodeNotFound:
121 return "not_found"
122 case CodeAlreadyExists:
123 return "already_exists"
124 case CodePermissionDenied:
125 return "permission_denied"
126 case CodeResourceExhausted:
127 return "resource_exhausted"
128 case CodeFailedPrecondition:
129 return "failed_precondition"
130 case CodeAborted:
131 return "aborted"
132 case CodeOutOfRange:
133 return "out_of_range"
134 case CodeUnimplemented:
135 return "unimplemented"
136 case CodeInternal:
137 return "internal"
138 case CodeUnavailable:
139 return "unavailable"
140 case CodeDataLoss:
141 return "data_loss"
142 case CodeUnauthenticated:
143 return "unauthenticated"
144 }
145 return fmt.Sprintf("code_%d", c)
146}
147
148// MarshalText implements [encoding.TextMarshaler].
149func (c Code) MarshalText() ([]byte, error) {

Callers 12

MarshalTextMethod · 0.95
grpcPercentEncodeFunction · 0.45
grpcPercentDecodeFunction · 0.45
TestCodeFunction · 0.45
marshalWithGetMethod · 0.45
buildGetURLMethod · 0.45
ErrorMethod · 0.45
TestErrorNilUnderlyingFunction · 0.45
TestErrorFormattingFunction · 0.45
TestHandler_ServeHTTPFunction · 0.45

Calls

no outgoing calls

Tested by 6

TestCodeFunction · 0.36
TestErrorNilUnderlyingFunction · 0.36
TestErrorFormattingFunction · 0.36
TestHandler_ServeHTTPFunction · 0.36