fakegodo

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CreatingStatus is the status when a database is created.
	CreatingStatus = "creating"
	// OnlineStatus is the status when a database is fetched after creation.
	OnlineStatus = "online"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeDatabasesService

type FakeDatabasesService struct {
	Options *godo.DatabaseOptions

	// satisfy interface for unimplemented methods
	godo.DatabasesService
	// contains filtered or unexported fields
}

FakeDatabasesService is a fake godo DatabasesService with limited functionality: * Create creates and returns a new database object with the status "creating". * Get returns a previously-created database object with the status "online". * Delete deletes a previously-created database object. * Resize updates a previously-created object with the provided parameters.

func (*FakeDatabasesService) Create

Create ...

func (*FakeDatabasesService) CreateUser

CreateUser ...

func (*FakeDatabasesService) Delete

func (f *FakeDatabasesService) Delete(_ context.Context, dbUUID string) (*godo.Response, error)

Delete ...

func (*FakeDatabasesService) DeleteUser

func (f *FakeDatabasesService) DeleteUser(_ context.Context, dbUUID string, username string) (*godo.Response, error)

DeleteUser ...

func (*FakeDatabasesService) Get

Get ...

func (*FakeDatabasesService) GetUser

func (f *FakeDatabasesService) GetUser(_ context.Context, dbUUID string, username string) (*godo.DatabaseUser, *godo.Response, error)

GetUser ...

func (*FakeDatabasesService) ListOptions

ListOptions ...

func (*FakeDatabasesService) Resize

Resize ...

type Handler

type Handler struct{}

Handler is an HTTP handler that can handle requests we need to make that are not yet supported in godo proper. This is for use with the httptest package in unit/integration tests.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(rw http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler.

Jump to

Keyboard shortcuts

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