service

package
v1.4.8 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package service contains business logic of application.

Index

Constants

This section is empty.

Variables

View Source
var ErrAlreadyConfirmed = fmt.Errorf("already confirmed")

ErrAlreadyConfirmed is returned when request is already confirmed.

View Source
var ErrAlreadyExists = fmt.Errorf("email or address is already taken")

ErrAlreadyExists is returned when request is already created for requested email or address.

View Source
var ErrRecaptcha = fmt.Errorf("recaptcha error")

ErrRecaptcha is returned when captcha isn't passed.

View Source
var ErrReferralCodeNotFound = fmt.Errorf("referral code not found")

ErrReferralCodeNotFound ...

View Source
var ErrReferralTrackingInvalidStatus = fmt.Errorf("referral tracking has invalid status")

ErrReferralTrackingInvalidStatus ...

View Source
var ErrReferralTrackingNotFound = fmt.Errorf("referral tracking not found")

ErrReferralTrackingNotFound ...

View Source
var ErrRequestNotFound = fmt.Errorf("request not found")

ErrRequestNotFound is returned when request not found for owner/code pair.

View Source
var ErrTooManyAttempts = fmt.Errorf("too many attempts")

ErrTooManyAttempts is returned when throttling interval didn't pass.

Functions

This section is empty.

Types

type Service

type Service interface {
	Register(ctx context.Context, email, address string, referralCode *string) error
	Confirm(ctx context.Context, owner, code string) error
	GetRegisterStats(ctx context.Context) ([]*storage.RegisterStats, int, error)
	GetOwnReferralCode(ctx context.Context, address string) (string, error)
	GetReferralConfig() referral.Config
	GetRegistrationReferralCode(ctx context.Context, address string) (string, error)
	TrackReferralBrowserInstallation(ctx context.Context, address string) error
	GetReferralTrackingStats(ctx context.Context, address string) ([]*storage.ReferralTrackingStats, error)

	RegisterTestnetAccount(ctx context.Context, address string) error

	CheckRecaptcha(ctx context.Context, action, recaptchaResponse string) error
}

Service ...

func New

func New(
	storage storage.Storage,
	sender mail.Sender,
	bc blockchain.Blockchain,
	initialStakes sdk.Int,
	initialMemo string,
	rc referral.Config,
	recaptchaSecret string,
) Service

New creates new instance of service.

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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