Documentation
¶
Index ¶
- func ActiveQuotaCheckTokenMiddleware(jwtSecret ed25519.PublicKey) grpc.UnaryServerInterceptor
- func AdminAuthMiddleware(adminIds []int64, jwtSecret ed25519.PublicKey) grpcauth.AuthFunc
- func AdminAuthMiddlewareSelector(ctx context.Context, callMeta interceptors.CallMeta) bool
- func AuthMiddleware(jwtSecret ed25519.PublicKey) grpc.UnaryServerInterceptor
- func AuthMiddlewareSelector(ctx context.Context, callMeta interceptors.CallMeta) bool
- func FreeQuotaRedisRateLimiterSelector(ctx context.Context, callMeta interceptors.CallMeta) bool
- func IsReadOnlyMethod(methodName string) bool
- func NewGrpcServer(server *Server) *grpc.Server
- func ParseHeaderJwt(ctx context.Context, claims jwt.Claims, jwtSecret ed25519.PublicKey, ...) (interface{}, error)
- func QuotaTokenValidityMiddleware(jwtSecret ed25519.PublicKey) grpc.UnaryServerInterceptor
- func ServiceRegisterAuthMiddlewareSelector(ctx context.Context, callMeta interceptors.CallMeta) bool
- func SoldQuotaRedisLimiterSelector(ctx context.Context, callMeta interceptors.CallMeta) bool
- func TokenFromMD(ctx context.Context, headerField string) (string, error)
- type AuthClaims
- type DbState
- type FreeQuotaRedisRateLimiter
- type QuotaRedisLimiter
- type QuotaTokenClaims
- type RemoveServiceRequest
- type RequestWithAccount
- type Resource
- type ResourceParent
- type Server
- func (s *Server) ActivateQuotaToken(ctx context.Context, req *pb.ActivateQuotaTokenRequest) (*pb.ActivateQuotaTokenResponse, error)
- func (s *Server) BatchMarkWithdraws(ctx context.Context, req *pb.BatchMarkWithdrawsRequest) (*pb.BatchMarkWithdrawsResponse, error)
- func (s *Server) BatchProcessWithdraws(ctx context.Context, req *pb.BatchProcessWithdrawsRequest) (*pb.BatchProcessWithdrawsResponse, error)
- func (s *Server) BatchPruneFulfilledOrders(ctx context.Context, req *pb.BatchPruneFulfilledOrdersRequest) (*pb.BatchPruneFulfilledOrdersResponse, error)
- func (s *Server) ClaimFreeToken(ctx context.Context, req *pb.ClaimTokenRequest) (*pb.ClaimTokenResponse, error)
- func (s *Server) ClaimToken(ctx context.Context, req *pb.ClaimTokenRequest) (*pb.ClaimTokenResponse, error)
- func (s *Server) CreateSellOrder(ctx context.Context, req *pb.CreateSellOrderRequest) (*pb.CreateSellOrderResponse, error)
- func (s *Server) CreateService(ctx context.Context, req *pb.CreateServiceRequest) (*pb.CreateServiceResponse, error)
- func (s *Server) CreateServicesFromDb(ctx context.Context) error
- func (s *Server) CreateWithdraw(ctx context.Context, req *pb.CreateWithdrawRequest) (*pb.Withdrawal, error)
- func (s *Server) DeleteSellOrder(ctx context.Context, req *pb.DeleteSellOrderRequest) (*emptypb.Empty, error)
- func (s *Server) DeleteService(ctx context.Context, req *pb.DeleteServiceRequest) (*emptypb.Empty, error)
- func (s *Server) Deposit(ctx context.Context, req *pb.DepositRequest) (*pb.DepositResponse, error)
- func (s *Server) GetChallenge(ctx context.Context, req *pb.GetChallengeRequest) (*pb.GetChallengeResponse, error)
- func (s *Server) GetConfig() *config.Config
- func (s *Server) GetRedisClient() *redis.Client
- func (s *Server) InitDb(ctx context.Context) DbState
- func (s *Server) ListFulfilledOrders(ctx context.Context, req *pb.ListFulfilledOrdersRequest) (*pb.ListFulfilledOrdersResponse, error)
- func (s *Server) ListPaymentMethods(ctx context.Context, req *pb.ListPaymentMethodsRequest) (*pb.ListPaymentMethodsResponse, error)
- func (s *Server) ListServices(ctx context.Context, req *pb.ListServicesRequest) (*pb.ListServicesResponse, error)
- func (s *Server) Login(ctx context.Context, req *pb.LoginRequest) (*pb.LoginResponse, error)
- func (s *Server) MatchOrder(ctx context.Context, req *pb.MatchOrderRequest) (*pb.MatchOrderResponse, error)
- func (s *Server) Ping(ctx context.Context, _ *emptypb.Empty) (*pb.PingResponse, error)
- func (s *Server) PruneAccounts(ctx context.Context, req *pb.PruneAccountsRequest) (*pb.PruneAccountsResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActiveQuotaCheckTokenMiddleware ¶
func ActiveQuotaCheckTokenMiddleware( jwtSecret ed25519.PublicKey, ) grpc.UnaryServerInterceptor
func AdminAuthMiddleware ¶
func AdminAuthMiddlewareSelector ¶
func AdminAuthMiddlewareSelector(ctx context.Context, callMeta interceptors.CallMeta) bool
func AuthMiddleware ¶
func AuthMiddleware( jwtSecret ed25519.PublicKey, ) grpc.UnaryServerInterceptor
func AuthMiddlewareSelector ¶
func AuthMiddlewareSelector(ctx context.Context, callMeta interceptors.CallMeta) bool
func FreeQuotaRedisRateLimiterSelector ¶
func FreeQuotaRedisRateLimiterSelector(ctx context.Context, callMeta interceptors.CallMeta) bool
func IsReadOnlyMethod ¶
func NewGrpcServer ¶
func ParseHeaderJwt ¶
func QuotaTokenValidityMiddleware ¶
func QuotaTokenValidityMiddleware( jwtSecret ed25519.PublicKey, ) grpc.UnaryServerInterceptor
func ServiceRegisterAuthMiddlewareSelector ¶
func ServiceRegisterAuthMiddlewareSelector(ctx context.Context, callMeta interceptors.CallMeta) bool
func SoldQuotaRedisLimiterSelector ¶
func SoldQuotaRedisLimiterSelector(ctx context.Context, callMeta interceptors.CallMeta) bool
Types ¶
type FreeQuotaRedisRateLimiter ¶
type QuotaRedisLimiter ¶
type QuotaRedisLimiter struct { Rdb *redis.Client // contains filtered or unexported fields }
type QuotaTokenClaims ¶
type QuotaTokenClaims struct { ServiceID int64 `json:"service_id"` QuotaQuantity int64 `json:"quota_quantity"` *jwt.RegisteredClaims }
func ParseQuotaToken ¶
type RemoveServiceRequest ¶
type RemoveServiceRequest struct {
ServiceId int64 `json:"service_id" binding:"required"`
}
type RequestWithAccount ¶
type RequestWithAccount interface {
GetAccountId() int64
}
type ResourceParent ¶
type ResourceParent interface {
GetParent() string
}
type Server ¶
type Server struct { pb.ExchangeServer // contains filtered or unexported fields }
func (*Server) ActivateQuotaToken ¶
func (s *Server) ActivateQuotaToken( ctx context.Context, req *pb.ActivateQuotaTokenRequest, ) (*pb.ActivateQuotaTokenResponse, error)
func (*Server) BatchMarkWithdraws ¶
func (s *Server) BatchMarkWithdraws( ctx context.Context, req *pb.BatchMarkWithdrawsRequest, ) (*pb.BatchMarkWithdrawsResponse, error)
func (*Server) BatchProcessWithdraws ¶
func (s *Server) BatchProcessWithdraws( ctx context.Context, req *pb.BatchProcessWithdrawsRequest, ) (*pb.BatchProcessWithdrawsResponse, error)
func (*Server) BatchPruneFulfilledOrders ¶
func (s *Server) BatchPruneFulfilledOrders( ctx context.Context, req *pb.BatchPruneFulfilledOrdersRequest, ) (*pb.BatchPruneFulfilledOrdersResponse, error)
func (*Server) ClaimFreeToken ¶
func (s *Server) ClaimFreeToken( ctx context.Context, req *pb.ClaimTokenRequest, ) (*pb.ClaimTokenResponse, error)
func (*Server) ClaimToken ¶
func (s *Server) ClaimToken( ctx context.Context, req *pb.ClaimTokenRequest, ) (*pb.ClaimTokenResponse, error)
func (*Server) CreateSellOrder ¶
func (s *Server) CreateSellOrder( ctx context.Context, req *pb.CreateSellOrderRequest, ) (*pb.CreateSellOrderResponse, error)
func (*Server) CreateService ¶
func (s *Server) CreateService( ctx context.Context, req *pb.CreateServiceRequest, ) (*pb.CreateServiceResponse, error)
func (*Server) CreateServicesFromDb ¶
func (*Server) CreateWithdraw ¶
func (s *Server) CreateWithdraw(ctx context.Context, req *pb.CreateWithdrawRequest) (*pb.Withdrawal, error)
func (*Server) DeleteSellOrder ¶
func (*Server) DeleteService ¶
func (*Server) Deposit ¶
func (s *Server) Deposit(ctx context.Context, req *pb.DepositRequest) (*pb.DepositResponse, error)
func (*Server) GetChallenge ¶
func (s *Server) GetChallenge(ctx context.Context, req *pb.GetChallengeRequest) (*pb.GetChallengeResponse, error)
func (*Server) GetRedisClient ¶
func (s *Server) GetRedisClient() *redis.Client
func (*Server) ListFulfilledOrders ¶
func (s *Server) ListFulfilledOrders( ctx context.Context, req *pb.ListFulfilledOrdersRequest, ) (*pb.ListFulfilledOrdersResponse, error)
func (*Server) ListPaymentMethods ¶
func (s *Server) ListPaymentMethods( ctx context.Context, req *pb.ListPaymentMethodsRequest, ) (*pb.ListPaymentMethodsResponse, error)
func (*Server) ListServices ¶
func (s *Server) ListServices( ctx context.Context, req *pb.ListServicesRequest, ) (*pb.ListServicesResponse, error)
func (*Server) Login ¶
func (s *Server) Login(ctx context.Context, req *pb.LoginRequest) (*pb.LoginResponse, error)
func (*Server) MatchOrder ¶
func (s *Server) MatchOrder( ctx context.Context, req *pb.MatchOrderRequest, ) (*pb.MatchOrderResponse, error)
func (*Server) PruneAccounts ¶
func (s *Server) PruneAccounts( ctx context.Context, req *pb.PruneAccountsRequest, ) (*pb.PruneAccountsResponse, error)
Click to show internal directories.
Click to hide internal directories.