mirror of
https://github.com/eosswedenorg/antelope-api-healthcheck
synced 2026-06-16 04:44:55 +02:00
21 lines
420 B
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)
|
|
}
|