Container
Extends:
Container provides configuration for connecting to Skygear server, and accessors to other containers, providing various functionalities:
skygear.auth
- AuthContainer: User authentications and user roles API.skygear.relation
- RelationContainer: User relation API, like add and query Friends.skygear.privateDB
- Database: Private database of the current user, with record API, like query, save and delete.skygear.publicDB
- PublicDatabase: Public database, providing the same record API as Database, but with additional record role API.skygear.pubsub
- PubsubContainer: A publish-subscribe interface, providing real-time message-based communication with other users.skygear.push
- PushContainer: Push Notifications.
Constructor Summary
Public Constructor | ||
public |
|
Member Summary
Public Members | ||
public get |
|
|
public get |
|
|
public get |
|
|
public get |
|
|
public get |
|
|
public get |
|
|
public |
timeoutOptions: Object Options for how much time to wait for client request to complete. |
Method Summary
Public Methods | ||
public |
Sets a new end point and new API key to the container. |
Inherited Summary
From class BaseContainer | ||
public static get |
VERSION: String The version of Skygear. |
|
public get |
|
|
public get |
|
|
public get |
|
|
public get |
|
|
public get |
|
|
public get |
|
|
public get |
|
|
public get |
|
|
public get |
|
|
public get |
|
|
public get |
|
|
public get |
|
|
public get |
|
|
public get |
|
|
public get |
|
|
public get |
|
|
public get |
|
|
public get |
|
|
public get |
|
|
public get |
|
|
public get |
VERSION: String The version of Skygear. |
|
public get |
endPoint: String Endpoint of the skygear container |
|
public set |
endPoint: String Endpoint of the skygear container |
|
public |
apiKey: String API key of the skygear container |
|
public |
async clearCache(): Promise Clears all cache in skygear container store. |
|
public |
async config(options: Object): Promise<BaseContainer> Sets a new end point and new API key to the container. |
|
public |
configApiKey(apiKey: String) Sets a new API key to the container. |
|
public |
configEndPoint(endPoint: String) Sets a new end point to the container. |
|
public |
async lambda(name: String, data: Object): Promise<Object> Calls a registered lambda function without arguments. |
Public Constructors
Public Members
public get auth: AuthContainer source
public get publicDB: PublicDatabase source
public get pubsub: PubsubContainer source
public get push: PushContainer source
public get relation: RelationContainer source
public timeoutOptions: Object source
Options for how much time to wait for client request to complete.
Properties:
Name | Type | Attribute | Description |
timeoutOptions.deadline | number |
|
deadline for the request and response to complete (in milliseconds) |
timeoutOptions.response | number |
|
maximum time to wait for an response (in milliseconds) |
Public Methods
public async config(options: Object): Promise<Container> source
Sets a new end point and new API key to the container.
After configuration,
- it tries to restore the user, access token and device id, and,
- the pubsub client connects to skygear server if a user is restored.
Override:
BaseContainer#configParams:
Name | Type | Attribute | Description |
options | Object | configuration options of the skygear container |
|
options.apiKey | String | api key |
|
options.endPoint | String | end point |