refactor: move http api to a new transport layer
This commit is contained in:
parent
476c4b056f
commit
0448f66ab2
41 changed files with 822 additions and 390 deletions
9
internal/transport/helpers.go
Normal file
9
internal/transport/helpers.go
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
package transport
|
||||
|
||||
func WithoutInput[T any](f func() (T, error)) func(struct{}) (T, error) {
|
||||
return func(s struct{}) (T, error) { return f() }
|
||||
}
|
||||
|
||||
func WithoutOutput[T any](f func(T) error) func(T) (struct{}, error) {
|
||||
return func(t T) (struct{}, error) { return struct{}{}, f(t) }
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue