mirror of
https://github.com/Kugelschieber/marvinblum.git
synced 2026-01-18 14:50:27 +00:00
Finished blog.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
> _This post was originally published on Medium a while ago. I just added it to my blog for completeness._
|
||||
|
||||

|
||||

|
||||
|
||||
Most Golang web applications use persistency in some way or another. Usually, the connection between your application and the persistent layer is a technical identification value (ID), a number in most cases. IDs are useful to identify, connect and distinguish data records. Here is a typical example of a database model represented as a struct within Golang applications:
|
||||
|
||||
@@ -185,17 +185,3 @@ type Customer struct {
|
||||
|
||||
|
||||
And that’s it! If you want to know more about how to implement this or just use it right away, you can visit the GitHub project, which implements all of the functionality I’ve shown above. It uses HashIds, which I’ve mentioned earlier, to transform the IDs to a nice and short hash representation.
|
||||
|
||||
[
|
||||
|
||||

|
||||
|
||||
emvi/hide
|
||||
|
||||
ID type with marshalling to/from hash to prevent sending IDs to clients. - emvi/hide
|
||||
|
||||
https://github.com/emvi/hide
|
||||
|
||||
|
||||
|
||||
](https://github.com/emvi/hide)
|
||||
|
||||
Reference in New Issue
Block a user