gapi

package
v0.0.0-...-87de23a Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2025 License: GPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GrpcLogger

func GrpcLogger(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error)

func HttpLogger

func HttpLogger(handler http.Handler) http.Handler

Types

type AdminSession

type AdminSession struct {
	Payload      *token.AdminPayload
	RefreshToken string
	UserAgent    string
	ClientIp     string
	IsBlocked    bool
}

type Metadata

type Metadata struct {
	UserAgent string
	ClientIP  string
}

type ResponseRecorder

type ResponseRecorder struct {
	http.ResponseWriter
	StatusCode int
	Body       []byte
}

func (*ResponseRecorder) Write

func (rec *ResponseRecorder) Write(body []byte) (int, error)

func (*ResponseRecorder) WriteHeader

func (rec *ResponseRecorder) WriteHeader(statusCode int)

type Server

type Server struct {
	pb.UnimplementedNostalgiaServer
	// contains filtered or unexported fields
}

Server serves gPRC requests for our banking service.

func NewServer

func NewServer(config util.Config, store db.Store, taskDistributor worker.TaskDistributor, redisService service.Redis) (*Server, error)

NewServer creates a new gRPC server

func (*Server) AdminInfo

func (server *Server) AdminInfo(ctx context.Context, req *pb.AdminInfoRequest) (*pb.AdminInfoResponse, error)

func (*Server) CreateArticle

func (server *Server) CreateArticle(ctx context.Context, req *pb.CreateArticleRequest) (*pb.CreateArticleResponse, error)

func (*Server) DeleteArticle

func (server *Server) DeleteArticle(ctx context.Context, req *pb.DeleteArticleRequest) (*pb.DeleteArticleResponse, error)

func (*Server) GetArticle

func (server *Server) GetArticle(ctx context.Context, req *pb.GetArticleRequest) (*pb.GetArticleResponse, error)

func (*Server) InitSysMenu

func (server *Server) InitSysMenu(ctx context.Context, _ *pb.InitSysMenuRequest) (*pb.InitSysMenuResponse, error)

func (*Server) ListArticles

func (server *Server) ListArticles(ctx context.Context, req *pb.ListArticlesRequest) (*pb.ListArticlesResponse, error)

func (*Server) LoginAdmin

func (server *Server) LoginAdmin(ctx context.Context, req *pb.LoginAdminRequest) (*pb.LoginAdminResponse, error)

func (*Server) LogoutAdmin

func (server *Server) LogoutAdmin(ctx context.Context, req *pb.LogoutAdminRequest) (*pb.LogoutAdminResponse, error)

func (*Server) RenewAccessToken

func (server *Server) RenewAccessToken(ctx context.Context, req *pb.RenewAccessTokenRequest) (*pb.RenewAccessTokenResponse, error)

func (*Server) UpdateAdmin

func (server *Server) UpdateAdmin(ctx context.Context, req *pb.UpdateAdminRequest) (*pb.UpdateAdminResponse, error)

func (*Server) UpdateArticle

func (server *Server) UpdateArticle(ctx context.Context, req *pb.UpdateArticleRequest) (*pb.UpdateArticleResponse, error)

func (*Server) UploadFile

func (server *Server) UploadFile(ctx context.Context, req *pb.UploadFileRequest) (*pb.UploadFileResponse, error)

Jump to

Keyboard shortcuts

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