Documentation ¶
Index ¶
- Variables
- func CacheExpires(r *http.Response) time.Time
- type APIClient
- type APIKey
- type APIResponse
- type Backup
- type BackupList
- type BackupRequest
- type BasicAuth
- type Configuration
- type CreateBackupOpts
- type CreateDatabaseOpts
- type CreateGrantForUserDatabaseOpts
- type CreateUserOpts
- type Database
- type DeleteDatabaseOpts
- type DeleteUserOpts
- type EnvVar
- type GenericOpenAPIError
- type GetBackupByIDOpts
- type GetDatabaseByNameOpts
- type GetDatabasesOpts
- type GetGrantByUserDatabaseOpts
- type GetUserByNameOpts
- type GetUsersOpts
- type Grant
- type ListDatabases
- type ListUsers
- type Message
- type MysqlApiService
- func (a *MysqlApiService) CreateBackup(ctx _context.Context, backupRequest BackupRequest, ...) (Backup, *_nethttp.Response, error)
- func (a *MysqlApiService) CreateDatabase(ctx _context.Context, database Database, localVarOptionals *CreateDatabaseOpts) (Database, *_nethttp.Response, error)
- func (a *MysqlApiService) CreateGrantForUserDatabase(ctx _context.Context, database string, user string, grant Grant, ...) (Grant, *_nethttp.Response, error)
- func (a *MysqlApiService) CreateUser(ctx _context.Context, user User, localVarOptionals *CreateUserOpts) (User, *_nethttp.Response, error)
- func (a *MysqlApiService) DeleteDatabase(ctx _context.Context, database string, localVarOptionals *DeleteDatabaseOpts) (*_nethttp.Response, error)
- func (a *MysqlApiService) DeleteUser(ctx _context.Context, user string, localVarOptionals *DeleteUserOpts) (*_nethttp.Response, error)
- func (a *MysqlApiService) GetBackupByID(ctx _context.Context, uuid string, localVarOptionals *GetBackupByIDOpts) (Backup, *_nethttp.Response, error)
- func (a *MysqlApiService) GetDatabaseByName(ctx _context.Context, database string, ...) (Database, *_nethttp.Response, error)
- func (a *MysqlApiService) GetDatabases(ctx _context.Context, localVarOptionals *GetDatabasesOpts) (ListDatabases, *_nethttp.Response, error)
- func (a *MysqlApiService) GetGrantByUserDatabase(ctx _context.Context, user string, database string, ...) (Grant, *_nethttp.Response, error)
- func (a *MysqlApiService) GetUserByName(ctx _context.Context, user string, localVarOptionals *GetUserByNameOpts) (User, *_nethttp.Response, error)
- func (a *MysqlApiService) GetUsers(ctx _context.Context, localVarOptionals *GetUsersOpts) (ListUsers, *_nethttp.Response, error)
- type ServerConfiguration
- type ServerVariable
- type User
Constants ¶
This section is empty.
Variables ¶
var ( // ContextOAuth2 takes an oauth2.TokenSource as authentication for the request. ContextOAuth2 = contextKey("token") // ContextBasicAuth takes BasicAuth as authentication for the request. ContextBasicAuth = contextKey("basic") // ContextAccessToken takes a string oauth2 access token as authentication for the request. ContextAccessToken = contextKey("accesstoken") // ContextAPIKey takes an APIKey as authentication for the request ContextAPIKey = contextKey("apikey") )
Functions ¶
Types ¶
type APIClient ¶
type APIClient struct { MysqlApi *MysqlApiService // contains filtered or unexported fields }
APIClient manages communication with the blaqkube MySQL agent API v0.0.1 In most cases there should be only one, shared, APIClient.
func NewAPIClient ¶
func NewAPIClient(cfg *Configuration) *APIClient
NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.
func (*APIClient) ChangeBasePath ¶
ChangeBasePath changes base path to allow switching to mocks
func (*APIClient) GetConfig ¶
func (c *APIClient) GetConfig() *Configuration
Allow modification of underlying config for alternate implementations and testing Caution: modifying the configuration while live can cause data races and potentially unwanted behavior
type APIKey ¶
APIKey provides API key based authentication to a request passed via context using ContextAPIKey
type APIResponse ¶
type APIResponse struct { *http.Response `json:"-"` Message string `json:"message,omitempty"` // Operation is the name of the OpenAPI operation. Operation string `json:"operation,omitempty"` // RequestURL is the request URL. This value is always available, even if the // embedded *http.Response is nil. RequestURL string `json:"url,omitempty"` // Method is the HTTP method used for the request. This value is always // available, even if the embedded *http.Response is nil. Method string `json:"method,omitempty"` // Payload holds the contents of the response body (which may be nil or empty). // This is provided here as the raw response.Body() reader will have already // been drained. Payload []byte `json:"-"` }
APIResponse stores the API response returned by the server.
func NewAPIResponse ¶
func NewAPIResponse(r *http.Response) *APIResponse
NewAPIResponse returns a new APIResonse object.
func NewAPIResponseWithError ¶
func NewAPIResponseWithError(errorMessage string) *APIResponse
NewAPIResponseWithError returns a new APIResponse object with the provided error message.
type Backup ¶
type Backup struct { Identifier string `json:"identifier"` Bucket string `json:"bucket"` Location string `json:"location"` StartTime time.Time `json:"start_time"` EndTime *time.Time `json:"end_time,omitempty"` // backup status Status string `json:"status"` }
Backup output for a backup request
type BackupList ¶
type BackupList struct { Size int32 `json:"size,omitempty"` Items []Backup `json:"items,omitempty"` }
BackupList The List of backups
type BackupRequest ¶
type BackupRequest struct { Backend string `json:"backend"` Bucket string `json:"bucket"` Location string `json:"location"` Envs []EnvVar `json:"envs,omitempty"` }
BackupRequest struct for BackupRequest
type BasicAuth ¶
type BasicAuth struct { UserName string `json:"userName,omitempty"` Password string `json:"password,omitempty"` }
BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth
type Configuration ¶
type Configuration struct { BasePath string `json:"basePath,omitempty"` Host string `json:"host,omitempty"` Scheme string `json:"scheme,omitempty"` DefaultHeader map[string]string `json:"defaultHeader,omitempty"` UserAgent string `json:"userAgent,omitempty"` Debug bool `json:"debug,omitempty"` Servers []ServerConfiguration HTTPClient *http.Client }
Configuration stores the configuration of the API client
func NewConfiguration ¶
func NewConfiguration() *Configuration
NewConfiguration returns a new Configuration object
func (*Configuration) AddDefaultHeader ¶
func (c *Configuration) AddDefaultHeader(key string, value string)
AddDefaultHeader adds a new HTTP header to the default header in the request
type CreateBackupOpts ¶
CreateBackupOpts Optional parameters for the method 'CreateBackup'
type CreateDatabaseOpts ¶
CreateDatabaseOpts Optional parameters for the method 'CreateDatabase'
type CreateGrantForUserDatabaseOpts ¶
CreateGrantForUserDatabaseOpts Optional parameters for the method 'CreateGrantForUserDatabase'
type CreateUserOpts ¶
CreateUserOpts Optional parameters for the method 'CreateUser'
type DeleteDatabaseOpts ¶
DeleteDatabaseOpts Optional parameters for the method 'DeleteDatabase'
type DeleteUserOpts ¶
DeleteUserOpts Optional parameters for the method 'DeleteUser'
type GenericOpenAPIError ¶
type GenericOpenAPIError struct {
// contains filtered or unexported fields
}
GenericOpenAPIError Provides access to the body, error and model on returned errors.
func (GenericOpenAPIError) Body ¶
func (e GenericOpenAPIError) Body() []byte
Body returns the raw bytes of the response
func (GenericOpenAPIError) Error ¶
func (e GenericOpenAPIError) Error() string
Error returns non-empty string if there was an error.
func (GenericOpenAPIError) Model ¶
func (e GenericOpenAPIError) Model() interface{}
Model returns the unpacked model of the error
type GetBackupByIDOpts ¶
GetBackupByIDOpts Optional parameters for the method 'GetBackupByID'
type GetDatabaseByNameOpts ¶
GetDatabaseByNameOpts Optional parameters for the method 'GetDatabaseByName'
type GetDatabasesOpts ¶
GetDatabasesOpts Optional parameters for the method 'GetDatabases'
type GetGrantByUserDatabaseOpts ¶
GetGrantByUserDatabaseOpts Optional parameters for the method 'GetGrantByUserDatabase'
type GetUserByNameOpts ¶
GetUserByNameOpts Optional parameters for the method 'GetUserByName'
type GetUsersOpts ¶
GetUsersOpts Optional parameters for the method 'GetUsers'
type ListDatabases ¶
type ListDatabases struct { Size int32 `json:"size,omitempty"` Items []Database `json:"items,omitempty"` }
ListDatabases struct for ListDatabases
type MysqlApiService ¶
type MysqlApiService service
MysqlApiService MysqlApi service
func (*MysqlApiService) CreateBackup ¶
func (a *MysqlApiService) CreateBackup(ctx _context.Context, backupRequest BackupRequest, localVarOptionals *CreateBackupOpts) (Backup, *_nethttp.Response, error)
CreateBackup create an on-demand backup
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param backupRequest Create a backup
- @param optional nil or *CreateBackupOpts - Optional Parameters:
- @param "ApiKey" (optional.String) -
@return Backup
func (*MysqlApiService) CreateDatabase ¶
func (a *MysqlApiService) CreateDatabase(ctx _context.Context, database Database, localVarOptionals *CreateDatabaseOpts) (Database, *_nethttp.Response, error)
CreateDatabase create an on-demand database
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param database Create a Database
- @param optional nil or *CreateDatabaseOpts - Optional Parameters:
- @param "ApiKey" (optional.String) -
@return Database
func (*MysqlApiService) CreateGrantForUserDatabase ¶
func (a *MysqlApiService) CreateGrantForUserDatabase(ctx _context.Context, database string, user string, grant Grant, localVarOptionals *CreateGrantForUserDatabaseOpts) (Grant, *_nethttp.Response, error)
CreateGrantForUserDatabase Grant access to user and database Create a Grant for a User and Database
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param database Name of the database to return the grant from
- @param user Name of the user to return the grant from
- @param grant Create a user
- @param optional nil or *CreateGrantForUserDatabaseOpts - Optional Parameters:
- @param "ApiKey" (optional.String) -
@return Grant
func (*MysqlApiService) CreateUser ¶
func (a *MysqlApiService) CreateUser(ctx _context.Context, user User, localVarOptionals *CreateUserOpts) (User, *_nethttp.Response, error)
CreateUser create an on-demand user
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param user Create a user
- @param optional nil or *CreateUserOpts - Optional Parameters:
- @param "ApiKey" (optional.String) -
@return User
func (*MysqlApiService) DeleteDatabase ¶
func (a *MysqlApiService) DeleteDatabase(ctx _context.Context, database string, localVarOptionals *DeleteDatabaseOpts) (*_nethttp.Response, error)
DeleteDatabase Deletes a database
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param database Database to delete
- @param optional nil or *DeleteDatabaseOpts - Optional Parameters:
- @param "ApiKey" (optional.String) -
func (*MysqlApiService) DeleteUser ¶
func (a *MysqlApiService) DeleteUser(ctx _context.Context, user string, localVarOptionals *DeleteUserOpts) (*_nethttp.Response, error)
DeleteUser Deletes a user
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param user User to delete
- @param optional nil or *DeleteUserOpts - Optional Parameters:
- @param "ApiKey" (optional.String) -
func (*MysqlApiService) GetBackupByID ¶
func (a *MysqlApiService) GetBackupByID(ctx _context.Context, uuid string, localVarOptionals *GetBackupByIDOpts) (Backup, *_nethttp.Response, error)
GetBackupByID Get a backup on demand
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param uuid Backup Internal ID
- @param optional nil or *GetBackupByIDOpts - Optional Parameters:
- @param "ApiKey" (optional.String) -
@return Backup
func (*MysqlApiService) GetDatabaseByName ¶
func (a *MysqlApiService) GetDatabaseByName(ctx _context.Context, database string, localVarOptionals *GetDatabaseByNameOpts) (Database, *_nethttp.Response, error)
GetDatabaseByName Get Database properties Returns the database properties
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param database Name of the database to return
- @param optional nil or *GetDatabaseByNameOpts - Optional Parameters:
- @param "ApiKey" (optional.String) -
@return Database
func (*MysqlApiService) GetDatabases ¶
func (a *MysqlApiService) GetDatabases(ctx _context.Context, localVarOptionals *GetDatabasesOpts) (ListDatabases, *_nethttp.Response, error)
GetDatabases list all databases
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param optional nil or *GetDatabasesOpts - Optional Parameters:
- @param "ApiKey" (optional.String) -
@return ListDatabases
func (*MysqlApiService) GetGrantByUserDatabase ¶
func (a *MysqlApiService) GetGrantByUserDatabase(ctx _context.Context, user string, database string, localVarOptionals *GetGrantByUserDatabaseOpts) (Grant, *_nethttp.Response, error)
GetGrantByUserDatabase Get Database properties Returns the grant for a User and a Database
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param user Name of the user to return the grant from
- @param database Name of the database to return the grant from
- @param optional nil or *GetGrantByUserDatabaseOpts - Optional Parameters:
- @param "ApiKey" (optional.String) -
@return Grant
func (*MysqlApiService) GetUserByName ¶
func (a *MysqlApiService) GetUserByName(ctx _context.Context, user string, localVarOptionals *GetUserByNameOpts) (User, *_nethttp.Response, error)
GetUserByName Get user properties Returns the user properties
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param user Name of the user to return
- @param optional nil or *GetUserByNameOpts - Optional Parameters:
- @param "ApiKey" (optional.String) -
@return User
func (*MysqlApiService) GetUsers ¶
func (a *MysqlApiService) GetUsers(ctx _context.Context, localVarOptionals *GetUsersOpts) (ListUsers, *_nethttp.Response, error)
GetUsers list all users
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param optional nil or *GetUsersOpts - Optional Parameters:
- @param "ApiKey" (optional.String) -
@return ListUsers
type ServerConfiguration ¶
type ServerConfiguration struct { Url string Description string Variables map[string]ServerVariable }
ServerConfiguration stores the information about a server
type ServerVariable ¶
ServerVariable stores the information about a server variable