database

package
v0.0.0-...-a735c6b Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MysqlDatabaseController

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

A MysqlDatabaseController binds http requests to an api service and writes the service results to the http response

func (*MysqlDatabaseController) CreateDatabase

func (c *MysqlDatabaseController) CreateDatabase(w http.ResponseWriter, r *http.Request)

CreateDatabase - create an on-demand database

func (*MysqlDatabaseController) DeleteDatabase

func (c *MysqlDatabaseController) DeleteDatabase(w http.ResponseWriter, r *http.Request)

DeleteDatabase - Deletes a database

func (*MysqlDatabaseController) GetDatabaseByName

func (c *MysqlDatabaseController) GetDatabaseByName(w http.ResponseWriter, r *http.Request)

GetDatabaseByName - Get Database properties

func (*MysqlDatabaseController) GetDatabases

func (c *MysqlDatabaseController) GetDatabases(w http.ResponseWriter, r *http.Request)

GetDatabases - list all databases

func (*MysqlDatabaseController) Routes

Routes returns all of the api route for the MysqlDatabaseController

type MysqlDatabaseRouter

type MysqlDatabaseRouter interface {
	Routes() openapi.Routes
	CreateDatabase(http.ResponseWriter, *http.Request)
	DeleteDatabase(http.ResponseWriter, *http.Request)
	GetDatabaseByName(http.ResponseWriter, *http.Request)
	GetDatabases(http.ResponseWriter, *http.Request)
}

MysqlDatabaseRouter defines the required methods for binding the api requests to a responses for the MysqlDatabase The MysqlDatabaseRouter implementation should parse necessary information from the http request, pass the data to a MysqlDatabaseServicer to perform the required actions, then write the service results to the http response.

func NewMysqlDatabaseController

func NewMysqlDatabaseController(s MysqlDatabaseServicer) MysqlDatabaseRouter

NewMysqlDatabaseController creates a default api controller

type MysqlDatabaseService

type MysqlDatabaseService struct {
	DB *sql.DB
}

MysqlDatabaseService is a service that implents the logic for the MysqlDatabaseServicer This service should implement the business logic for every endpoint for the MysqlDatabase API. Include any external packages or services that will be required by this service.

func (*MysqlDatabaseService) CreateDatabase

func (s *MysqlDatabaseService) CreateDatabase(database openapi.Database, apiKey string) (interface{}, error)

CreateDatabase - create an on-demand database

func (*MysqlDatabaseService) DeleteDatabase

func (s *MysqlDatabaseService) DeleteDatabase(database string, apiKey string) (interface{}, error)

DeleteDatabase - Deletes a database

func (*MysqlDatabaseService) GetDatabaseByName

func (s *MysqlDatabaseService) GetDatabaseByName(database string, apiKey string) (interface{}, error)

GetDatabaseByName - Get Database properties

func (*MysqlDatabaseService) GetDatabases

func (s *MysqlDatabaseService) GetDatabases(apiKey string) (interface{}, error)

GetDatabases - list all databases

type MysqlDatabaseServicer

type MysqlDatabaseServicer interface {
	CreateDatabase(openapi.Database, string) (interface{}, error)
	DeleteDatabase(string, string) (interface{}, error)
	GetDatabaseByName(string, string) (interface{}, error)
	GetDatabases(string) (interface{}, error)
}

MysqlDatabaseServicer defines the api actions for the MysqlDatabase service This interface intended to stay up to date with the openapi yaml used to generate it, while the service implementation can ignored with the .openapi-generator-ignore file and updated with the logic required for the API.

func NewMysqlDatabaseService

func NewMysqlDatabaseService(db *sql.DB) MysqlDatabaseServicer

NewMysqlDatabaseService creates a default api service

Jump to

Keyboard shortcuts

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