Skip to content

Instantly share code, notes, and snippets.

@anatoliyfedorenko
Created July 13, 2020 06:03
Show Gist options
  • Select an option

  • Save anatoliyfedorenko/b386a2e7939e6706f573679d46b46fa5 to your computer and use it in GitHub Desktop.

Select an option

Save anatoliyfedorenko/b386a2e7939e6706f573679d46b46fa5 to your computer and use it in GitHub Desktop.
Changes to Interface
// IStorage represents database methods
type IStorage interface {
Feedback() Feedback
// this is just a temporary change not to break all the functionality. Will reimplment this
// for the version mentioned above as a next step with just a small chucks under improvements
User
Profile
Agreement
AgreementChange
Milestone
Contact
Notification
Payout
WebhookEvent
Referral
VerificationCode
PlatformTransfer
}
func (s *Storage) Feedback() Feedback {
return &FeedbackClient{cfg: s.cfg, logger: s.logger, pool: s.pool}
}
// Feedback inferface contains methods for feedback manipulation
type Feedback interface {
Create(ctx context.Context, f *feedback.Feedback) (*feedback.Feedback, error)
}
type FeedbackClient struct {
cfg config.Config
logger *logrus.Entry
pool *pgxpool.Pool
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment