server

package
v0.0.0-...-6bcd878 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: MIT Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttachUserToCtx

func AttachUserToCtx(ctx context.Context, user *storage.UserAccount) context.Context

func GetContextUser

func GetContextUser(ctx context.Context) *storage.UserAccount

func RunHttpServer

func RunHttpServer(ctx context.Context, config cfg.Config) job.WithGracefulShutdown

func RunServer

func RunServer(ctx context.Context, config cfg.Config) job.WithGracefulShutdown

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 NewAuthServiceServer(
	tokenManager token.Manager,
	storage *storage.Storage,
	authTokenExpire int64,
	refreshTokenExpire int64,
) *AuthServiceServer

func (*AuthServiceServer) Login

func (*AuthServiceServer) Logout

func (*AuthServiceServer) RefreshToken

func (*AuthServiceServer) Register

func (*AuthServiceServer) UserInfo

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 (*FavoriteServiceServer) GetFavorites

func (*FavoriteServiceServer) RemoveItemFromFavorites

type SearchServiceServer

type SearchServiceServer struct {
	pb.UnimplementedSearchServiceServer
	// contains filtered or unexported fields
}

func NewSearchServiceServer

func NewSearchServiceServer(
	i2v img2vec.Img2Vec,
	searchHandler search.Handler,
	fetcher productmeta.Fetcher,
	rankers map[pb.Ranker]rank.Ranker,
	objectDetector od.ObjectDetector,
	s3Client s3.Client,
	store *storage.Storage,
) *SearchServiceServer

func (*SearchServiceServer) AsyncSearch

func (*SearchServiceServer) Crop

func (*SearchServiceServer) GetSearchHistories

func (*SearchServiceServer) Search

Jump to

Keyboard shortcuts

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