func SetDeleted(ctx context.Context, msg string) error {
	return SetStatus(ctx, status.New(Deleted, msg))
}
SetDeleted is a shortcut for SetStatus(ctx, status.New(Deleted, msg))
package gateway
import (
	"context"
	"net/http"
	"google.golang.org/genproto/googleapis/rpc/code"
	"google.golang.org/grpc"
	"google.golang.org/grpc/codes"
	"google.golang.org/grpc/grpclog"
	"google.golang.org/grpc/metadata"
	"google.golang.org/grpc/status"
	"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
)
var OldStatusCreatedOnUpdate = false
const (
	Created codes.Code = 10000 + iota  
	Updated
	Deleted
	LongRunning
	PartialContent
)
func SetStatus(ctx context.Context, st *status.Status) error {
	if st == nil {
		return nil
	}
	md := metadata.Pairs(
		runtime.MetadataPrefix+"status-code", CodeName(st.Code()),
	)
	return grpc.SetHeader(ctx, md)
}
func SetCreated(ctx context.Context, msg string) error {
	WithSuccess(ctx, NewWithFields(msg))
	return SetStatus(ctx, status.New(Created, msg))
}
func SetUpdated(ctx context.Context, msg string) error {
	return SetStatus(ctx, status.New(Updated, msg))
}