Documentation
¶
Index ¶
- func NewContextWithClient(ctx context.Context, c ClientV2) context.Context
- type Client
- func (c *Client) BaseURL() *url.URL
- func (c *Client) CreateAttachment(ctx context.Context, clusterId string, input CreateAttachmentInput) (CreateAttachmentResponse, error)
- func (c *Client) CreateCluster(ctx context.Context, input CreateClusterInput) (CreateClusterResponse, error)
- func (c *Client) CreateClusterBackup(ctx context.Context, clusterID string, input CreateClusterBackupInput) error
- func (c *Client) CreateDatabase(ctx context.Context, id string, input CreateDatabaseInput) error
- func (c *Client) CreateUserWithRole(ctx context.Context, id string, input CreateUserWithRoleInput) (CreateUserWithRoleResponse, error)
- func (c *Client) DeleteAttachment(ctx context.Context, clusterId string, appName string) (DeleteAttachmentResponse, error)
- func (c *Client) DeleteUser(ctx context.Context, id string, username string) error
- func (c *Client) DestroyCluster(ctx context.Context, orgSlug string, id string) error
- func (c *Client) DisableExtension(ctx context.Context, id, database, name string, force bool) error
- func (c *Client) EnableExtension(ctx context.Context, id, database string, input EnableExtensionInput) error
- func (c *Client) GetCluster(ctx context.Context, orgSlug string, id string) (GetClusterResponse, error)
- func (c *Client) GetClusterById(ctx context.Context, id string) (GetClusterResponse, error)
- func (c *Client) GetUserCredentials(ctx context.Context, id string, username string) (GetUserCredentialsResponse, error)
- func (c *Client) HTTPClient() *http.Client
- func (c *Client) ListClusterBackups(ctx context.Context, clusterID string) (ListClusterBackupsResponse, error)
- func (c *Client) ListDatabases(ctx context.Context, id string) (ListDatabasesResponse, error)
- func (c *Client) ListExtensions(ctx context.Context, id, database string) (ListExtensionsResponse, error)
- func (c *Client) ListRegions(ctx context.Context, orgSlug string) (ListRegionsResponse, error)
- func (c *Client) ListUsers(ctx context.Context, id string) (ListUsersResponse, error)
- func (c *Client) RestoreClusterBackup(ctx context.Context, clusterID string, input RestoreClusterBackupInput) (RestoreClusterBackupResponse, error)
- func (c *Client) UpdateUserRole(ctx context.Context, id string, username string, input UpdateUserRoleInput) error
- type ClientV2
- type ClusterBackup
- type CreateAttachmentInput
- type CreateAttachmentResponse
- type CreateClusterBackupInput
- type CreateClusterInput
- type CreateClusterResponse
- type CreateDatabaseInput
- type CreateUserWithRoleInput
- type CreateUserWithRoleResponse
- type Database
- type DeleteAttachmentResponse
- type EnableExtensionInput
- type Extension
- type GetClusterCredentialsResponse
- type GetClusterResponse
- type GetUserCredentialsResponse
- type InstalledExtension
- type ListClusterBackupsResponse
- type ListDatabasesResponse
- type ListExtensionsResponse
- type ListRegionsResponse
- type ListUsersResponse
- type ManagedCluster
- type Region
- type RestoreClusterBackupInput
- type RestoreClusterBackupResponse
- type UpdateUserRoleInput
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
func NewClientWithOptions ¶
func (*Client) CreateAttachment ¶
func (c *Client) CreateAttachment(ctx context.Context, clusterId string, input CreateAttachmentInput) (CreateAttachmentResponse, error)
func (*Client) CreateCluster ¶
func (c *Client) CreateCluster(ctx context.Context, input CreateClusterInput) (CreateClusterResponse, error)
func (*Client) CreateClusterBackup ¶
func (*Client) CreateDatabase ¶
func (*Client) CreateUserWithRole ¶
func (c *Client) CreateUserWithRole(ctx context.Context, id string, input CreateUserWithRoleInput) (CreateUserWithRoleResponse, error)
func (*Client) DeleteAttachment ¶
func (*Client) DeleteUser ¶
func (*Client) DestroyCluster ¶
func (*Client) DisableExtension ¶ added in v0.4.68
DisableExtension drops a Postgres extension from the given database.
func (*Client) EnableExtension ¶ added in v0.4.68
func (c *Client) EnableExtension(ctx context.Context, id, database string, input EnableExtensionInput) error
EnableExtension installs a Postgres extension in the given database.
func (*Client) GetCluster ¶
func (*Client) GetClusterById ¶
func (*Client) GetUserCredentials ¶
func (*Client) HTTPClient ¶
func (*Client) ListClusterBackups ¶
func (*Client) ListDatabases ¶
func (*Client) ListExtensions ¶ added in v0.4.68
func (c *Client) ListExtensions(ctx context.Context, id, database string) (ListExtensionsResponse, error)
ListExtensions returns the catalog of available Postgres extensions for the given database, along with whether each one is currently installed.
func (*Client) ListRegions ¶
func (*Client) RestoreClusterBackup ¶
func (c *Client) RestoreClusterBackup(ctx context.Context, clusterID string, input RestoreClusterBackupInput) (RestoreClusterBackupResponse, error)
func (*Client) UpdateUserRole ¶
type ClientV2 ¶
type ClientV2 interface {
GetCluster(ctx context.Context, orgSlug string, id string) (GetClusterResponse, error)
GetClusterById(ctx context.Context, id string) (GetClusterResponse, error)
ListRegions(ctx context.Context, orgSlug string) (ListRegionsResponse, error)
CreateUserWithRole(ctx context.Context, id string, input CreateUserWithRoleInput) (CreateUserWithRoleResponse, error)
UpdateUserRole(ctx context.Context, id string, username string, input UpdateUserRoleInput) error
DeleteUser(ctx context.Context, id string, username string) error
GetUserCredentials(ctx context.Context, id string, username string) (GetUserCredentialsResponse, error)
ListUsers(ctx context.Context, id string) (ListUsersResponse, error)
ListDatabases(ctx context.Context, id string) (ListDatabasesResponse, error)
CreateDatabase(ctx context.Context, id string, input CreateDatabaseInput) error
ListExtensions(ctx context.Context, id, database string) (ListExtensionsResponse, error)
EnableExtension(ctx context.Context, id, database string, input EnableExtensionInput) error
DisableExtension(ctx context.Context, id, database, name string, force bool) error
CreateCluster(ctx context.Context, input CreateClusterInput) (CreateClusterResponse, error)
DestroyCluster(ctx context.Context, orgSlug string, id string) error
ListClusterBackups(ctx context.Context, clusterID string) (ListClusterBackupsResponse, error)
CreateClusterBackup(ctx context.Context, clusterID string, input CreateClusterBackupInput) error
RestoreClusterBackup(ctx context.Context, clusterID string, input RestoreClusterBackupInput) (RestoreClusterBackupResponse, error)
CreateAttachment(ctx context.Context, clusterId string, input CreateAttachmentInput) (CreateAttachmentResponse, error)
DeleteAttachment(ctx context.Context, clusterId string, appName string) (DeleteAttachmentResponse, error)
}
func ClientFromContext ¶
ClientFromContext returns the ClientV2 ctx carries.
type ClusterBackup ¶
type CreateAttachmentInput ¶
type CreateAttachmentInput struct {
AppName string `json:"app_name"`
}
type CreateClusterBackupInput ¶
type CreateClusterBackupInput struct {
Type string `json:"type"`
}
type CreateClusterInput ¶
type CreateClusterResponse ¶
type CreateClusterResponse struct {
Ok bool `json:"ok"`
Errors uiex.DetailedErrors `json:"errors"`
Data struct {
Id string `json:"id"`
Name string `json:"name"`
Status *string `json:"status"`
Plan string `json:"plan"`
Environment *string `json:"environment"`
Region string `json:"region"`
Organization fly.Organization `json:"organization"`
Replicas int `json:"replicas"`
Disk int `json:"disk"`
IpAssignments mpg.ManagedClusterIpAssignments `json:"ip_assignments"`
PostGISEnabled bool `json:"postgis_enabled"`
} `json:"data"`
}
type CreateDatabaseInput ¶
type CreateDatabaseInput struct {
Name string `json:"name"`
}
type CreateUserWithRoleInput ¶
type CreateUserWithRoleResponse ¶
type CreateUserWithRoleResponse struct {
Data User `json:"data"`
}
type DeleteAttachmentResponse ¶
type DeleteAttachmentResponse struct {
Data struct {
Message string `json:"message"`
} `json:"data"`
}
type EnableExtensionInput ¶ added in v0.4.68
type GetClusterResponse ¶
type GetClusterResponse struct {
Data ManagedCluster `json:"data"`
Credentials GetClusterCredentialsResponse `json:"credentials"`
}
type InstalledExtension ¶ added in v0.4.68
type ListClusterBackupsResponse ¶
type ListClusterBackupsResponse struct {
Data []ClusterBackup `json:"data"`
}
type ListDatabasesResponse ¶
type ListDatabasesResponse struct {
Data []Database `json:"data"`
}
type ListExtensionsResponse ¶ added in v0.4.68
type ListExtensionsResponse struct {
Data []Extension `json:"data"`
}
type ListRegionsResponse ¶
type ListRegionsResponse struct {
Data []Region `json:"data"`
}
type ListUsersResponse ¶
type ListUsersResponse struct {
Data []User `json:"data"`
}
type ManagedCluster ¶
type ManagedCluster struct {
Id string `json:"id"`
Name string `json:"name"`
Status string `json:"status"`
Engine string `json:"engine"`
Plan string `json:"plan"`
Region string `json:"region"`
Organization fly.Organization `json:"organization"`
MpgdClusterId string `json:"mpgd_cluster_id"`
Disk int `json:"disk"`
Replicas int `json:"replicas"`
IpAssignments mpg.ManagedClusterIpAssignments `json:"ip_assignments"`
AttachedApps []mpg.AttachedApp `json:"attached_apps"`
}
type RestoreClusterBackupInput ¶
type RestoreClusterBackupInput struct {
BackupId string `json:"backup_id"`
}
type RestoreClusterBackupResponse ¶
type RestoreClusterBackupResponse struct {
Data ManagedCluster `json:"data"`
}
type UpdateUserRoleInput ¶
type UpdateUserRoleInput struct {
Role string `json:"role"` // 'schema_admin' | 'writer' | 'reader'
}
Click to show internal directories.
Click to hide internal directories.