admin_gateway

package
v0.9.4-RC02 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MethodRequestOwnerAuth   = "/init-registration"
	MethodRequestOwnerInitTg = "/telegram/link-generation"
	MethodRequestUnlinkTg    = "/telegram/unlink-account"
	MethodRequestUnlinkCode  = "/telegram/unlink/code"
	MethodGetOwnerBalance    = "/owner-data"
)
View Source
const (
	MethodAccountConfirmation        = "/notify/account-confirmation"
	MethodAccountConfirmed           = "/notify/account-confirmed"
	MethodUserPasswordResetting      = "/notify/password-resetting"
	MethodUserPasswordReset          = "/notify/password-resetted"
	MethodClientTopUpWallets         = "/notify/client-top-up-wallets"
	MethodNotificationEmailResetting = "/notify/email-resetting"
	MethodRemindAccountConfirmation  = "/notify/remind-account-confirmation"
	MethodUpdateSettingsConfirmation = "/notify/update-settings-confirmation"
)
View Source
const (
	MethodHeartBeat = "/system/heartbeat"
	MethodCheckMyIP = "/check-my-ip"
)
View Source
const (
	MethodFetchRateBySource = "/rate/%s"
)

Variables

View Source
var ErrUnauthenticated = errors.New("unauthenticated")

Functions

func PrepareServiceContext

func PrepareServiceContext(ctx context.Context, adminSecret, clientID string) context.Context

func SHA256Signature

func SHA256Signature(data []byte, secretKey string) string

Types

type INotification

type INotification interface {
	SendUserVerification(ctx context.Context, notification admin_requests.VerifyNotification) error
	SendUserRegistration(ctx context.Context, notification admin_requests.VerifyNotification) error
	SendUserPasswordReset(ctx context.Context, notification admin_requests.VerifyNotification) error
	SendUserForgotPassword(ctx context.Context, notification admin_requests.VerifyNotification) error
	SendTwoFactorAuthentication(ctx context.Context, notification admin_requests.VerifyNotification) error
	SendExternalWalletRequested(ctx context.Context, notification admin_requests.WalletsRequestNotification) error
	SendUserInvite(ctx context.Context, notification admin_requests.VerifyNotification) error
	SendUserEmailReset(ctx context.Context, notification admin_requests.VerifyNotification) error
	SendUserRemindVerification(ctx context.Context, notification admin_requests.VerifyNotification) error
	SendUserUpdateSettingVerification(ctx context.Context, notification admin_requests.VerifyNotification) error
}

type IOwner

type IOwner interface {
	GetAuthCode(ctx context.Context, req admin_requests.InitAuthRequest) (*admin_responses.InitAuthResponse, error)
	GetOwnerData(ctx context.Context, token string) (*admin_responses.OwnerDataResponse, error)
	InitOwnerTg(ctx context.Context, ownerToken string) (*admin_responses.InitOwnerTgResponse, error)
	ConfirmUnlinkTg(ctx context.Context, code, ownerToken string) error
	UnlinkOwnerTg(ctx context.Context, ownerID uuid.UUID, ownerToken string) error
}

type IRates

type IRates interface {
	FetchRateBySource(ctx context.Context, source string) ([]admin_responses.RatesResponse, error)
	FetchAllRates(ctx context.Context) ([]admin_responses.RatesResponse, error)
}

type ISystem

type ISystem interface {
	HeartBeat(ctx context.Context, analyticsData *admin_requests.AnalyticsData) error
	CheckIP(ctx context.Context) (string, error)
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(baseURL string, appVersion string, log logger.Logger) *Service

func (*Service) CheckIP

func (s *Service) CheckIP(ctx context.Context) (string, error)

func (*Service) ConfirmUnlinkTg

func (s *Service) ConfirmUnlinkTg(ctx context.Context, code, ownerToken string) error

func (*Service) FetchAllRates

func (s *Service) FetchAllRates(ctx context.Context) ([]admin_responses.RatesResponse, error)

func (*Service) FetchRateBySource

func (s *Service) FetchRateBySource(ctx context.Context, source string) ([]admin_responses.RatesResponse, error)

func (*Service) GetOwnerData

func (s *Service) GetOwnerData(ctx context.Context, token string) (*admin_responses.OwnerDataResponse, error)

func (*Service) HeartBeat

func (s *Service) HeartBeat(ctx context.Context, analyticsData *admin_requests.AnalyticsData) error

func (*Service) InitOwnerTg

func (s *Service) InitOwnerTg(ctx context.Context, ownerToken string) (*admin_responses.InitOwnerTgResponse, error)

func (*Service) SendExternalWalletRequested

func (s *Service) SendExternalWalletRequested(ctx context.Context, notification admin_requests.WalletsRequestNotification) error

func (*Service) SendTwoFactorAuthentication

func (s *Service) SendTwoFactorAuthentication(_ context.Context, _ admin_requests.VerifyNotification) error

func (*Service) SendUserEmailReset

func (s *Service) SendUserEmailReset(ctx context.Context, notification admin_requests.VerifyNotification) error

func (*Service) SendUserForgotPassword

func (s *Service) SendUserForgotPassword(ctx context.Context, notification admin_requests.VerifyNotification) error

func (*Service) SendUserInvite

func (*Service) SendUserPasswordReset

func (s *Service) SendUserPasswordReset(ctx context.Context, notification admin_requests.VerifyNotification) error

func (*Service) SendUserRegistration

func (s *Service) SendUserRegistration(ctx context.Context, notification admin_requests.VerifyNotification) error

func (*Service) SendUserRemindVerification

func (s *Service) SendUserRemindVerification(_ context.Context, _ admin_requests.VerifyNotification) error

func (*Service) SendUserUpdateSettingVerification

func (s *Service) SendUserUpdateSettingVerification(_ context.Context, _ admin_requests.VerifyNotification) error

func (*Service) SendUserVerification

func (s *Service) SendUserVerification(ctx context.Context, notification admin_requests.VerifyNotification) error

func (*Service) UnlinkOwnerTg

func (s *Service) UnlinkOwnerTg(ctx context.Context, ownerID uuid.UUID, ownerToken string) error

type ServiceContextKey

type ServiceContextKey string
const (
	ServiceContextKeyIdentity ServiceContextKey = "user"
)

type ServiceIdentity

type ServiceIdentity struct {
	ClientID  string
	SecretKey string
}

func IdentityFromContext

func IdentityFromContext(ctx context.Context) *ServiceIdentity

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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