func (api *API) Call(service, endpoint string, params interface{}, timeout int) (*types.Response, error) {
	ctx, cancel := context.WithTimeout(context.Background(), time.Duration(timeout)*time.Second)
	defer cancel()
	return api.config.Transport.Call(ctx, api.config.Token, api.config.Project, service, endpoint, params, timeout)
}
Call invokes the specified function on the backend
package api
import (
	"context"
	"time"
	"github.com/spaceuptech/space-api-go/eventing"
	"github.com/spaceuptech/space-api-go/realtime"
	"github.com/spaceuptech/space-api-go/transport"
	"github.com/spaceuptech/space-api-go/transport/websocket"
	"github.com/spaceuptech/space-api-go/config"
	"github.com/spaceuptech/space-api-go/db"
	"github.com/spaceuptech/space-api-go/filestore"
	"github.com/spaceuptech/space-api-go/types"
)
type API struct {
	config   *config.Config
	socket   *websocket.Socket
	realtime *realtime.Realtime
}
func New(project, url string, sslEnabled bool) *API {
	c := &config.Config{Project: project, Transport: transport.New(url, sslEnabled)}
	w := websocket.Init(url, c)
	r := realtime.Init(project, w)
	return &API{config: c, socket: w, realtime: r}
}
func (api *API) Ping() error {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	return api.config.Transport.Ping(ctx, api.config.Token)
}
func (api *API) SetToken(token string) {
	api.config.Token = token
}
func (api *API) SetProjectID(project string) {
	api.config.Project = project
}
func (api *API) DB(dbAlias string) *db.DB {
	return db.New(dbAlias, api.config, api.realtime)
}