1
0
Fork 0
mirror of https://github.com/eosswedenorg/antelope-api-healthcheck synced 2026-06-16 04:44:55 +02:00
antelope-api-healthcheck/internal/api/make.go

21 lines
420 B
Go

package api
import (
"fmt"
)
func Make(name string, args ApiArguments) (ApiInterface, error) {
factories := map[string]Factory{
"v1": EosioV1Factory,
"v2": EosioV2Factory,
"contract": AtomicAssetFactory,
"atomic": AtomicAssetFactory,
"debug": DebugApiFactory,
}
if factory, ok := factories[name]; ok {
return factory(args), nil
}
return nil, fmt.Errorf("invalid API '%s'", name)
}