cloudsql

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const CacheTTL = 60 * time.Second

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client wraps the Cloud SQL Admin API

func NewClient

func NewClient(ctx context.Context) (*Client, error)

NewClient creates a new Cloud SQL client

func (*Client) ListInstances

func (c *Client) ListInstances(projectID string) ([]Instance, error)

ListInstances fetches all Cloud SQL instances in the project

func (*Client) StartInstance

func (c *Client) StartInstance(projectID, name string) error

StartInstance starts a Cloud SQL instance by setting activation policy to ALWAYS

func (*Client) StopInstance

func (c *Client) StopInstance(projectID, name string) error

StopInstance stops a Cloud SQL instance by setting activation policy to NEVER

type Instance

type Instance struct {
	Name            string
	ProjectID       string
	Region          string
	DatabaseVersion string
	State           InstanceState
	Tier            string
	PrimaryIP       string
	ConnectionName  string

	// Details
	StorageGB  int64
	AutoBackup bool
	Activation string // ALWAYS or NEVER
}

Instance represents a simplified Cloud SQL instance

type InstanceState

type InstanceState string

InstanceState represents the status of a Cloud SQL instance

const (
	StateRunnable    InstanceState = "RUNNABLE"
	StateSuspended   InstanceState = "SUSPENDED"
	StatePending     InstanceState = "PENDING_CREATE"
	StateMaintenance InstanceState = "MAINTENANCE"
	StateFailed      InstanceState = "FAILED"
	StateUnknown     InstanceState = "UNKNOWN"
)

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service implements the generic Service interface

func NewService

func NewService(cache *core.Cache) *Service

func (*Service) Blur

func (s *Service) Blur()

func (*Service) Focus

func (s *Service) Focus()

func (*Service) HelpText

func (s *Service) HelpText() string

func (*Service) Init

func (s *Service) Init() tea.Cmd

func (*Service) InitService

func (s *Service) InitService(ctx context.Context, projectID string) error

func (*Service) IsRootView

func (s *Service) IsRootView() bool

func (*Service) Name

func (s *Service) Name() string

func (*Service) Refresh

func (s *Service) Refresh() tea.Cmd

func (*Service) Reinit

func (s *Service) Reinit(ctx context.Context, projectID string) error

Reinit reinitializes the service with a new project ID

func (*Service) Reset

func (s *Service) Reset()

func (*Service) ShortName

func (s *Service) ShortName() string

func (*Service) Update

func (s *Service) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*Service) View

func (s *Service) View() string

type ViewState

type ViewState int

ViewState defines whether we are listing or viewing details

const (
	ViewList ViewState = iota
	ViewDetail
	ViewConfirmation
)

Jump to

Keyboard shortcuts

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