Documentation ¶
Index ¶
- func AttachUserToCtx(ctx context.Context, user *storage.UserAccount) context.Context
- func GetContextUser(ctx context.Context) *storage.UserAccount
- func RunHttpServer(ctx context.Context, config cfg.Config) job.WithGracefulShutdown
- func RunServer(ctx context.Context, config cfg.Config) job.WithGracefulShutdown
- type AuthInterceptor
- type AuthServiceServer
- func (s *AuthServiceServer) Login(ctx context.Context, req *pb.LoginRequest) (*pb.LoginResponse, error)
- func (s *AuthServiceServer) Logout(ctx context.Context, req *pb.LogoutRequest) (*emptypb.Empty, error)
- func (s *AuthServiceServer) RefreshToken(ctx context.Context, req *pb.RefreshTokenRequest) (*pb.RefreshTokenResponse, error)
- func (s *AuthServiceServer) Register(ctx context.Context, req *pb.RegisterRequest) (*pb.RegisterResponse, error)
- func (s *AuthServiceServer) UserInfo(ctx context.Context, req *pb.UserInfoRequest) (*pb.UserInfoResponse, error)
- type FavoriteServiceServer
- func (s *FavoriteServiceServer) AddItemToFavorites(ctx context.Context, req *pb.AddItemToFavoritesRequest) (*pb.AddItemToFavoritesResponse, error)
- func (s *FavoriteServiceServer) GetFavorites(ctx context.Context, req *pb.GetFavoritesRequest) (*pb.GetFavoritesResponse, error)
- func (s *FavoriteServiceServer) RemoveItemFromFavorites(ctx context.Context, req *pb.RemoveItemFromFavoritesRequest) (*pb.RemoveItemFromFavoritesResponse, error)
- type SearchServiceServer
- func (s *SearchServiceServer) AsyncSearch(req *pb.SearchRequest, stream pb.SearchService_AsyncSearchServer) error
- func (s *SearchServiceServer) Crop(ctx context.Context, req *pb.CropRequest) (*pb.CropResponse, error)
- func (s *SearchServiceServer) GetSearchHistories(ctx context.Context, req *pb.GetSearchHistoriesRequest) (*pb.GetSearchHistoriesResponse, error)
- func (s *SearchServiceServer) Search(ctx context.Context, req *pb.SearchRequest) (*pb.SearchResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttachUserToCtx ¶
func GetContextUser ¶
func GetContextUser(ctx context.Context) *storage.UserAccount
func RunHttpServer ¶
Types ¶
type AuthInterceptor ¶
type AuthInterceptor struct {
// contains filtered or unexported fields
}
func NewAuthInterceptor ¶
func NewAuthInterceptor(storage *storage.Storage, tokenManager token.Manager) *AuthInterceptor
func (*AuthInterceptor) InterceptServer ¶
func (i *AuthInterceptor) InterceptServer() grpc.UnaryServerInterceptor
type AuthServiceServer ¶
type AuthServiceServer struct { pb.UnimplementedAuthServiceServer AuthTokenExpire int64 RefreshTokenExpire int64 TokenManager token.Manager Storage *storage.Storage }
func NewAuthServiceServer ¶
func (*AuthServiceServer) Login ¶
func (s *AuthServiceServer) Login(ctx context.Context, req *pb.LoginRequest) (*pb.LoginResponse, error)
func (*AuthServiceServer) Logout ¶
func (s *AuthServiceServer) Logout(ctx context.Context, req *pb.LogoutRequest) (*emptypb.Empty, error)
func (*AuthServiceServer) RefreshToken ¶
func (s *AuthServiceServer) RefreshToken(ctx context.Context, req *pb.RefreshTokenRequest) (*pb.RefreshTokenResponse, error)
func (*AuthServiceServer) Register ¶
func (s *AuthServiceServer) Register(ctx context.Context, req *pb.RegisterRequest) (*pb.RegisterResponse, error)
func (*AuthServiceServer) UserInfo ¶
func (s *AuthServiceServer) UserInfo(ctx context.Context, req *pb.UserInfoRequest) (*pb.UserInfoResponse, error)
type FavoriteServiceServer ¶
type FavoriteServiceServer struct { pb.UnimplementedFavoriteServiceServer Storage *storage.Storage // contains filtered or unexported fields }
func NewFavoriteServiceServer ¶
func NewFavoriteServiceServer( storage *storage.Storage, fetcher productmeta.Fetcher, ) *FavoriteServiceServer
func (*FavoriteServiceServer) AddItemToFavorites ¶
func (s *FavoriteServiceServer) AddItemToFavorites( ctx context.Context, req *pb.AddItemToFavoritesRequest, ) (*pb.AddItemToFavoritesResponse, error)
func (*FavoriteServiceServer) GetFavorites ¶
func (s *FavoriteServiceServer) GetFavorites( ctx context.Context, req *pb.GetFavoritesRequest, ) (*pb.GetFavoritesResponse, error)
func (*FavoriteServiceServer) RemoveItemFromFavorites ¶
func (s *FavoriteServiceServer) RemoveItemFromFavorites( ctx context.Context, req *pb.RemoveItemFromFavoritesRequest, ) (*pb.RemoveItemFromFavoritesResponse, error)
type SearchServiceServer ¶
type SearchServiceServer struct { pb.UnimplementedSearchServiceServer // contains filtered or unexported fields }
func NewSearchServiceServer ¶
func (*SearchServiceServer) AsyncSearch ¶
func (s *SearchServiceServer) AsyncSearch(req *pb.SearchRequest, stream pb.SearchService_AsyncSearchServer) error
func (*SearchServiceServer) Crop ¶
func (s *SearchServiceServer) Crop(ctx context.Context, req *pb.CropRequest) (*pb.CropResponse, error)
func (*SearchServiceServer) GetSearchHistories ¶
func (s *SearchServiceServer) GetSearchHistories( ctx context.Context, req *pb.GetSearchHistoriesRequest, ) (*pb.GetSearchHistoriesResponse, error)
func (*SearchServiceServer) Search ¶
func (s *SearchServiceServer) Search(ctx context.Context, req *pb.SearchRequest) (*pb.SearchResponse, error)
Click to show internal directories.
Click to hide internal directories.