repository

package
v0.0.0-...-9417b64 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2023 License: MIT Imports: 7 Imported by: 0

README

  • Repository is a place where you communicate with the real external data resource, like database, cloud service, external service, etc.
  • It's always better to keep your repository as simple as possible, don't add too much logic here
  • If you have to, you can separate the operations into smaller methods
  • You should always call your repository methods inside the use case package
  • You may use your src/library functions directly in this package
  • Any changes outside this package should not affect your repositories (except changes for business entity)
  • If you need config variables, database frameworks, or external clients, pass/inject them as dependency
  • You can use your own style as long as it doesn't break the main idea

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository struct {
	FindUserByUsernameAndPassword findUserByUsernameAndPassword.Contract
	FindUserByUsernameOrEmail     findUserByUsernameOrEmail.Contract
	FindUserProfileByUserID       findUserProfileByUserID.Contract
	InsertUser                    insertUser.Contract
	InsertUserProfile             insertUserProfile.Contract
}

func InitRepository

func InitRepository(cfg *config.Config, adapterClient *adapter.Adapter) (*Repository, error)

Jump to

Keyboard shortcuts

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