api

package
v0.0.0-...-f0e4ce9 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2025 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthMiddlewareSelector

func AuthMiddlewareSelector(ctx context.Context, callMeta interceptors.CallMeta) bool

func NewConnectAuthInterceptor

func NewConnectAuthInterceptor(
	publicKey ed25519.PublicKey,
) connect.UnaryInterceptorFunc

func NewGrpcAuthInterceptor

func NewGrpcAuthInterceptor(
	jwtSecret ed25519.PublicKey,
) grpc.UnaryServerInterceptor

func NewGrpcServer

func NewGrpcServer(server *Server) *grpc.Server

func ParseHeaderJwt

func ParseHeaderJwt(
	authString string,
	claims jwt.Claims,
	jwtSecret ed25519.PublicKey,
	headerField string,
	withValdidation bool,
) (interface{}, error)

Types

type AuthClaims

type AuthClaims struct {
	AccountId int64
}

func ParseAuthToken

func ParseAuthToken(authString string, jwtSecret ed25519.PublicKey, withValidation bool) (*AuthClaims, error)

type Server

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

func NewServer

func NewServer(config config.Config, store store.Store) (*Server, error)

func (*Server) BatchMarkWithdraws

func (*Server) BuyToken

func (*Server) CreateWithdraw

func (*Server) Deposit

func (*Server) GetChallenge

func (*Server) GetConfig

func (s *Server) GetConfig() *config.Config

func (*Server) GetRedisClient

func (s *Server) GetRedisClient() *redis.Client

func (*Server) Login

func (*Server) Ping

type Token

type Token struct {
	*jwt.RegisteredClaims
	Quantity int64       `json:"quantity"`
	Usage    pb.JwtUsage `json:"usage"`
}

Jump to

Keyboard shortcuts

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