grant

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package grant is used for interacting with the SiteHost `/cloud/db/grant` API endpoint.

Index

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 New

func New(c *api.Client) *Client

New is an initialisation function.

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.

Jump to

Keyboard shortcuts

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