Skip to content

Commit

Permalink
[INTERFACES] simplify example code
Browse files Browse the repository at this point in the history
  • Loading branch information
PatAkil committed Nov 1, 2024
1 parent b4d46c8 commit 2b4adff
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
16 changes: 0 additions & 16 deletions solutions/interfaces/api.go

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
package interfaces

type Patient struct {
UID string
Name string
}

type Datastorer interface {
Put(key string, patient any) error
Get(key string) (any, bool, error)
Remove(key string) error
}

type inMemoryPatientDatastore struct {
data map[string]Patient
}

func newInMemoryPatientDatastore() Datastorer {
func New() Datastorer {
return &inMemoryPatientDatastore{
data: map[string]Patient{},
}
Expand Down

0 comments on commit 2b4adff

Please sign in to comment.