Documentation
¶
Index ¶
- Constants
- Variables
- func PrepareServiceContext(ctx context.Context, adminSecret, clientID string) context.Context
- func SHA256Signature(data []byte, secretKey string) string
- type INotification
- type IOwner
- type IRates
- type ISystem
- type Service
- func (s *Service) CheckIP(ctx context.Context) (string, error)
- func (s *Service) ConfirmUnlinkTg(ctx context.Context, code, ownerToken string) error
- func (s *Service) FetchAllRates(ctx context.Context) ([]admin_responses.RatesResponse, error)
- func (s *Service) FetchRateBySource(ctx context.Context, source string) ([]admin_responses.RatesResponse, error)
- func (s *Service) GetAuthCode(ctx context.Context, req admin_requests.InitAuthRequest) (*admin_responses.InitAuthResponse, error)
- func (s *Service) GetOwnerData(ctx context.Context, token string) (*admin_responses.OwnerDataResponse, error)
- func (s *Service) HeartBeat(ctx context.Context, analyticsData *admin_requests.AnalyticsData) error
- func (s *Service) InitOwnerTg(ctx context.Context, ownerToken string) (*admin_responses.InitOwnerTgResponse, error)
- func (s *Service) SendExternalWalletRequested(ctx context.Context, notification admin_requests.WalletsRequestNotification) error
- func (s *Service) SendTwoFactorAuthentication(_ context.Context, _ admin_requests.VerifyNotification) error
- func (s *Service) SendUserEmailReset(ctx context.Context, notification admin_requests.VerifyNotification) error
- func (s *Service) SendUserForgotPassword(ctx context.Context, notification admin_requests.VerifyNotification) error
- func (s *Service) SendUserInvite(_ context.Context, _ admin_requests.VerifyNotification) error
- func (s *Service) SendUserPasswordReset(ctx context.Context, notification admin_requests.VerifyNotification) error
- func (s *Service) SendUserRegistration(ctx context.Context, notification admin_requests.VerifyNotification) error
- func (s *Service) SendUserRemindVerification(_ context.Context, _ admin_requests.VerifyNotification) error
- func (s *Service) SendUserUpdateSettingVerification(_ context.Context, _ admin_requests.VerifyNotification) error
- func (s *Service) SendUserVerification(ctx context.Context, notification admin_requests.VerifyNotification) error
- func (s *Service) UnlinkOwnerTg(ctx context.Context, ownerID uuid.UUID, ownerToken string) error
- type ServiceContextKey
- type ServiceIdentity
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 SHA256Signature ¶
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 (*Service) ConfirmUnlinkTg ¶
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) GetAuthCode ¶
func (s *Service) GetAuthCode(ctx context.Context, req admin_requests.InitAuthRequest) (*admin_responses.InitAuthResponse, 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 (s *Service) SendUserInvite(_ context.Context, _ admin_requests.VerifyNotification) error
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
type ServiceContextKey ¶
type ServiceContextKey string
const (
ServiceContextKeyIdentity ServiceContextKey = "user"
)
type ServiceIdentity ¶
func IdentityFromContext ¶
func IdentityFromContext(ctx context.Context) *ServiceIdentity
Click to show internal directories.
Click to hide internal directories.