go-data-access-example

module
v0.0.0-...-829c40f Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2020 License: MIT

README

go-data-access-example

This example takes a look at some common abstractions, DAL and DAO, and sees how it could be applied in a go project. This is an example and experiment with the goal of trying to make the project and code more readable. In a project where information is easy to find and said information is easy to read, the maintainablity of the project is high.

DAL

The data access layer is handled by a package dal. This package would contain all of the entities, in this case user, and provide all of the functionality needed to interface with the database.

DAO

The data access object are the interface use by packages that need to access the entity through the DAL. In go, it is encouraged for the customer to define the interfaces. This allows the package to define the data access functionality at the customer level. Here the user api defines the DAO interface that it needs to use. The DAL user is injected through that interface.

Collections

Contained in this example is a postman collection under the api/postman-collection directory.

Jump to

Keyboard shortcuts

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