From 6e8ffe718e2e2644519b05ad8f2ebd2dc9e90d3e Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Tue, 25 Oct 2022 17:22:33 +0200 Subject: [PATCH] src/api/interface.go: Adding Factory function type. --- src/api/interface.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/api/interface.go b/src/api/interface.go index e6233bc..dcb5760 100644 --- a/src/api/interface.go +++ b/src/api/interface.go @@ -15,6 +15,14 @@ type ApiArguments struct { NumBlocks int } +/** + * Factory function + * + * Each API must implement this function and process `args` + * returing a instance of it's implementation of the ApiInterface +*/ +type Factory func(args ApiArguments) ApiInterface + type ApiInterface interface { // Returns Logging information