-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ulrich Lissé
committed
Apr 8, 2019
1 parent
08b7e2f
commit 3315050
Showing
10 changed files
with
163 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,24 @@ | ||
package domain | ||
|
||
import "strconv" | ||
|
||
type AccountId int | ||
|
||
func NewAccountId(i int) AccountId { | ||
return AccountId(i) | ||
} | ||
|
||
func ParseAccountId(s string) (AccountId, error) { | ||
i, err := strconv.Atoi(s) | ||
if err != nil { | ||
return 0, err | ||
} | ||
|
||
return NewAccountId(i), nil | ||
} | ||
|
||
func (i AccountId) String() string { | ||
return strconv.Itoa(int(i)) | ||
} | ||
|
||
type AccountApi interface{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,24 @@ | ||
package domain | ||
|
||
import "strconv" | ||
|
||
type CustomerId int | ||
|
||
func NewCustomerId(i int) CustomerId { | ||
return CustomerId(i) | ||
} | ||
|
||
func ParseCustomerId(s string) (CustomerId, error) { | ||
i, err := strconv.Atoi(s) | ||
if err != nil { | ||
return 0, err | ||
} | ||
|
||
return NewCustomerId(i), nil | ||
} | ||
|
||
func (i CustomerId) String() string { | ||
return strconv.Itoa(int(i)) | ||
} | ||
|
||
type CustomerApi interface{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,24 @@ | ||
package domain | ||
|
||
import "strconv" | ||
|
||
type UserId int | ||
|
||
func NewUserId(i int) UserId { | ||
return UserId(i) | ||
} | ||
|
||
func ParseUserId(s string) (UserId, error) { | ||
i, err := strconv.Atoi(s) | ||
if err != nil { | ||
return 0, err | ||
} | ||
|
||
return NewUserId(i), nil | ||
} | ||
|
||
func (i UserId) String() string { | ||
return strconv.Itoa(int(i)) | ||
} | ||
|
||
type UserApi interface{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters