status

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ERR_CLIENT_IS_NIL client is nil object, before use provider need initiate client
	ERR_CLIENT_IS_NIL = New(-1, http.StatusInternalServerError, codes.Internal, "client is nil")
)

Functions

This section is empty.

Types

type Status

type Status struct {
	ProviderStatusCode any        `json:"provider_status_code" xml:"provider_status_code"`
	GrpcStatusCode     codes.Code `json:"grpc_status_code" xml:"grpc_status_code"`
	HttpStatusCode     int        `json:"http_status_code" xml:"http_status_code"`
	Message            string     `json:"message" xml:"message"`
}

func New

func New(providerStatusCode any, httpStatusCode int, grpcCode codes.Code, message string, params ...interface{}) *Status

New create new pgp status

func (*Status) Error

func (e *Status) Error() string

Status return type status

func (*Status) GrpcStatus

func (e *Status) GrpcStatus() *status.Status

GrpcStatus create grpc status

func (*Status) HttpError

func (e *Status) HttpError(w http.ResponseWriter)

HttpError create http status

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL