Documentation ¶
Index ¶
- func IsError(data map[string]interface{}) bool
- type Container
- func (c *Container) GetAssetRequest(assetURL string) (response []byte, err error)
- func (c *Container) MakeRequest(action string, request SkygearRequest) (response *SkygearResponse, err error)
- func (c *Container) PrivateDatabaseID() string
- func (c *Container) PublicDatabaseID() string
- func (c *Container) PutAssetRequest(filename, contentType string, body io.Reader) (response *SkygearResponse, err error)
- type Database
- func (d *Database) CreateColumn(recordType, columnName, columnDef string) error
- func (d *Database) DeleteColumn(recordType, columnName string) error
- func (d *Database) DeleteRecord(recordIDList []string) error
- func (d *Database) FetchAsset(assetURL string) (assetData []byte, err error)
- func (d *Database) FetchRecord(recordID string) (record *skyrecord.Record, err error)
- func (d *Database) FetchSchema() (map[string]interface{}, error)
- func (d *Database) QueryRecord(recordType string) ([]*skyrecord.Record, error)
- func (d *Database) RenameColumn(recordType, oldName, newName string) error
- func (d *Database) SaveAsset(path string) (assetID string, err error)
- func (d *Database) SaveRecord(record *skyrecord.Record) (err error)
- type GenericRequest
- type SkyDB
- type SkygearError
- type SkygearRequest
- type SkygearResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Container ¶
Container is a client-side view of remote Skygear functionality
func (*Container) GetAssetRequest ¶
GetAssetRequest sends GET request to Skygear and get the corresponding asset.
func (*Container) MakeRequest ¶
func (c *Container) MakeRequest(action string, request SkygearRequest) (response *SkygearResponse, err error)
MakeRequest sends request to Skygear
func (*Container) PrivateDatabaseID ¶
PrivateDatabaseID returns ID of the current user's private database
func (*Container) PublicDatabaseID ¶
PublicDatabaseID returns ID of the public database
func (*Container) PutAssetRequest ¶
func (c *Container) PutAssetRequest(filename, contentType string, body io.Reader) (response *SkygearResponse, err error)
PutAssetRequest sends asset PUT request to Skygear.
type Database ¶
func (*Database) CreateColumn ¶
func (*Database) DeleteColumn ¶
func (*Database) DeleteRecord ¶
func (*Database) FetchAsset ¶
func (*Database) FetchRecord ¶
func (*Database) FetchSchema ¶
func (*Database) QueryRecord ¶
func (*Database) RenameColumn ¶
type GenericRequest ¶
type GenericRequest struct {
Payload map[string]interface{}
}
GenericRequest implements payload for a generic request
func (*GenericRequest) MakePayload ¶
func (r *GenericRequest) MakePayload() map[string]interface{}
MakePayload creates request payload for a generic request
type SkyDB ¶
type SkyDB interface { FetchRecord(string) (*skyrecord.Record, error) QueryRecord(string) ([]*skyrecord.Record, error) SaveRecord(*skyrecord.Record) error DeleteRecord([]string) error FetchAsset(string) ([]byte, error) SaveAsset(string) (string, error) RenameColumn(string, string, string) error DeleteColumn(string, string) error CreateColumn(string, string, string) error FetchSchema() (map[string]interface{}, error) }
type SkygearError ¶
SkygearError encapsulates data of an Skygear response
func MakeError ¶
func MakeError(data map[string]interface{}) SkygearError
MakeError creates an SkygearError
func (SkygearError) Error ¶
func (e SkygearError) Error() string
type SkygearRequest ¶
type SkygearRequest interface { // MakePayload creates map structure of the payload for sending // to remove server MakePayload() map[string]interface{} }
SkygearRequest encapsulates payload for making Skygear requests
type SkygearResponse ¶
type SkygearResponse struct {
Payload map[string]interface{}
}
SkygearResponse encapsulates payload received from Skygear
func (*SkygearResponse) Error ¶
func (r *SkygearResponse) Error() *SkygearError
Error returns error in the response if any
func (*SkygearResponse) IsError ¶
func (r *SkygearResponse) IsError() bool
IsError returns if response is an error