api

package
v0.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	// contains filtered or unexported fields
}

API is the main API object to communicate with space cloud

func Init

func Init(project, host, port string, sslEnabled bool) (*API, error)

Init initialised a new instance of the API object

func (*API) Call

func (api *API) Call(service, function string, params utils.M, timeout int) (*model.Response, error)

Call invokes the specified function on the backend

func (*API) Mongo

func (api *API) Mongo() *mgo.Mongo

Mongo returns a mongo db client instance

func (*API) MySQL

func (api *API) MySQL() *sql.SQL

MySQL returns a mysql client instance

func (*API) Postgres

func (api *API) Postgres() *sql.SQL

Postgres creates a postgres client instance

func (*API) Service

func (api *API) Service(serviceName string) *service.Service

Service creates a Service instance

func (*API) SetProjectID

func (api *API) SetProjectID(project string)

SetProjectID sets the project id to be used by the API

func (*API) SetToken

func (api *API) SetToken(token string)

SetToken sets the JWT token to be used in each request

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL