kubernetes/vendor/google.golang.org/grpc/internal/status/status.go

type Status

// NewWithProto returns a new status including details from statusProto.  This
// is meant to be used by the gRPC library only.
func NewWithProto(code codes.Code, message string, statusProto []string) *Status {}

// New returns a Status representing c and msg.
func New(c codes.Code, msg string) *Status {}

// Newf returns New(c, fmt.Sprintf(format, a...)).
func Newf(c codes.Code, format string, a ...any) *Status {}

// FromProto returns a Status representing s.
func FromProto(s *spb.Status) *Status {}

// Err returns an error representing c and msg.  If c is OK, returns nil.
func Err(c codes.Code, msg string) error {}

// Errorf returns Error(c, fmt.Sprintf(format, a...)).
func Errorf(c codes.Code, format string, a ...any) error {}

// Code returns the status code contained in s.
func (s *Status) Code() codes.Code {}

// Message returns the message contained in s.
func (s *Status) Message() string {}

// Proto returns s's status as an spb.Status proto message.
func (s *Status) Proto() *spb.Status {}

// Err returns an immutable error representing s; returns nil if s.Code() is OK.
func (s *Status) Err() error {}

// WithDetails returns a new status with the provided details messages appended to the status.
// If any errors are encountered, it returns nil and the first error encountered.
func (s *Status) WithDetails(details ...protoadapt.MessageV1) (*Status, error) {}

// Details returns a slice of details messages attached to the status.
// If a detail cannot be decoded, the error is returned in place of the detail.
func (s *Status) Details() []any {}

func (s *Status) String() string {}

type Error

func (e *Error) Error() string {}

// GRPCStatus returns the Status represented by se.
func (e *Error) GRPCStatus() *Status {}

// Is implements future error.Is functionality.
// A Error is equivalent if the code and message are identical.
func (e *Error) Is(target error) bool {}

// IsRestrictedControlPlaneCode returns whether the status includes a code
// restricted for control plane usage as defined by gRFC A54.
func IsRestrictedControlPlaneCode(s *Status) bool {}