Documentation
¶
Overview ¶
Package grant is used for interacting with the SiteHost `/cloud/db/grant` API endpoint.
Index ¶
- type AddRequest
- type AddResponse
- type Client
- func (s *Client) Add(ctx context.Context, request AddRequest) (response AddResponse, err error)
- func (s *Client) Delete(ctx context.Context, request DeleteRequest) (response DeleteResponse, err error)
- func (s *Client) Update(ctx context.Context, request UpdateRequest) (response UpdateResponse, err error)
- type DeleteRequest
- type DeleteResponse
- type UpdateRequest
- type UpdateResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddRequest ¶
type AddRequest struct {
ServerName string `json:"server_name"`
MySQLHost string `json:"mysql_host"`
Username string `json:"username"`
Database string `json:"database"`
Grants []string `json:"grants"`
}
AddRequest is the request object for the `/cloud/db/grant/add.json` API endpoint.
type AddResponse ¶
type AddResponse struct {
Return struct {
models.Job `json:"job"`
} `json:"return"`
models.APIResponse
}
AddResponse represents a response from adding a database grant with the `/cloud/db/grant/add.json` endpoint.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a Service to work with API Jobs.
func (*Client) Add ¶
func (s *Client) Add(ctx context.Context, request AddRequest) (response AddResponse, err error)
Add creates a new grant for the given database/host/user.
func (*Client) Delete ¶
func (s *Client) Delete(ctx context.Context, request DeleteRequest) (response DeleteResponse, err error)
Delete deletes the grant from the specific database/host/user.
func (*Client) Update ¶
func (s *Client) Update(ctx context.Context, request UpdateRequest) (response UpdateResponse, err error)
Update updates the grants for a specific db/user/host.
type DeleteRequest ¶
type DeleteRequest struct {
ServerName string `json:"server_name"`
MySQLHost string `json:"mysql_host"`
Username string `json:"username"`
Database string `json:"database"`
}
DeleteRequest is the request object for the `/cloud/db/user/delete.json` API endpoint.
type DeleteResponse ¶
type DeleteResponse struct {
Return struct {
models.Job `json:"job"`
} `json:"return"`
models.APIResponse
}
DeleteResponse represents a response from deleting a database grant with the `/cloud/db/grant/delete.json` endpoint.
type UpdateRequest ¶
type UpdateRequest struct {
ServerName string `json:"server_name"`
MySQLHost string `json:"mysql_host"`
Username string `json:"username"`
Database string `json:"database"`
Grants []string `json:"grants"`
}
UpdateRequest is the request object for the `/cloud/db/user/update.json` API endpoint.
type UpdateResponse ¶
type UpdateResponse struct {
Return struct {
models.Job `json:"job"`
} `json:"return"`
models.APIResponse
}
UpdateResponse represents a response from updating a database grant with the `/cloud/db/grant/update.json` endpoint.