Documentation ¶
Index ¶
Constants ¶
const ( // NoneAccessMode the user does not have access to the database NoneAccessMode = "none" // ReadWriteAccessMode the user does not have readWrite access to the database ReadWriteAccessMode = "readWrite" // ReadOnlyAccessMode the user does not have readOnly access to the database ReadOnlyAccessMode = "readOnly" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MysqlGrantController ¶
type MysqlGrantController struct {
// contains filtered or unexported fields
}
A MysqlGrantController binds http requests to an api service and writes the service results to the http response
func (*MysqlGrantController) CreateGrantByUserDatabase ¶
func (c *MysqlGrantController) CreateGrantByUserDatabase(w http.ResponseWriter, r *http.Request)
CreateGrantByUserDatabase - create an on-demand grant
func (*MysqlGrantController) GetGrantByUserDatabase ¶
func (c *MysqlGrantController) GetGrantByUserDatabase(w http.ResponseWriter, r *http.Request)
GetGrantByUserDatabase - Get grant properties
func (*MysqlGrantController) Routes ¶
func (c *MysqlGrantController) Routes() openapi.Routes
Routes returns all of the api route for the MysqlUserController
type MysqlGrantRouter ¶
type MysqlGrantRouter interface { Routes() openapi.Routes CreateGrantByUserDatabase(http.ResponseWriter, *http.Request) GetGrantByUserDatabase(http.ResponseWriter, *http.Request) }
MysqlGrantRouter defines the required methods for binding the api requests to a responses for the MysqlApi The MysqlGrantRouter implementation should parse necessary information from the http request, pass the data to a MysqlGrantServicer to perform the required actions, then write the service results to the http response.
func NewMysqlGrantController ¶
func NewMysqlGrantController(s MysqlGrantServicer) MysqlGrantRouter
NewMysqlGrantController creates a default api controller
type MysqlGrantService ¶
MysqlGrantService is a service that implements the logic for the MysqlGrantServicer This service should implement the business logic for every endpoint for the MysqlGrant API. Include any external packages or services that will be required by this service.
func (*MysqlGrantService) CreateGrantByUserDatabase ¶
func (s *MysqlGrantService) CreateGrantByUserDatabase(grant openapi.Grant, user, database, apiKey string) (interface{}, error)
CreateGrantByUserDatabase - create an on-demand user
func (*MysqlGrantService) GetGrantByUserDatabase ¶
func (s *MysqlGrantService) GetGrantByUserDatabase(user, database, apiKey string) (interface{}, error)
GetGrantByUserDatabase - Get user properties
type MysqlGrantServicer ¶
type MysqlGrantServicer interface { CreateGrantByUserDatabase(openapi.Grant, string, string, string) (interface{}, error) GetGrantByUserDatabase(string, string, string) (interface{}, error) }
MysqlGrantServicer defines the api actions for the MysqlApi 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 NewMysqlGrantService ¶
func NewMysqlGrantService(db *sql.DB) MysqlGrantServicer
NewMysqlGrantService creates a default api service