Documentation
¶
Index ¶
- func Delete(db *model.Database, id uuid.UUID) (int, error)
- func Insert(db *model.Database, app *model.Application) (int, error)
- func MatchColumns(c *[]string) (msg string)
- func New(name string, columns []string) *model.Application
- func Overwrite(db *model.Database, id uuid.UUID, name string, columns []string) (*model.Application, string, int, error)
- func Retrieve(db *model.Database, id uuid.UUID) (*model.Application, int, error)
- func RetrieveAll(db *model.Database) ([]*model.Application, int, error)
- func Update(db *model.Database, id uuid.UUID, name string, columns []string) (*model.Application, string, int, error)
- func Validate(db *model.Database, id uuid.UUID) (*model.Application, int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
Deletes an application from the database id should be parsed to a UUID to ensure its validity. The 'int' return on this function is the HTTP status code which should be sent back to the user upon calling this function.
func Insert ¶
Insert an application into the database. Object(id) should not exist in the database already. The 'int' return of this function is the HTTP status code which should be send back to the client upon calling this function.
func MatchColumns ¶
Match an array of inputted data columns and updates inputted array to validated array of data columns which can be stored in the db. A message will be returned which tells the called which columns were invalid. Valid column names are below, case insensitive. Username, First, Last, Full, Email, Password, Data Does not allow for duplicate columns.
func New ¶
func New(name string, columns []string) *model.Application
Create an application using the provided input. The columns slice is not validated in this function.
func Overwrite ¶
func Overwrite(db *model.Database, id uuid.UUID, name string, columns []string) (*model.Application, string, int, error)
Overwrites an application in the database. The 'id' parameter should be parsed into a UUID to ensure validity. All parameters should be provided in the request body. Other they will be set to their default values. The 'int' return of this function is the HTTP status code that should be sent back to the user upon calling this function.
func Retrieve ¶
Retrieves an application from the database. 'id' parameter should be parsed into a UUID to ensure validity. The 'int' return of this function is the HTTP status code that should be sent back to the user upon calling this function.
func RetrieveAll ¶
Retrieves all applications from the database. The 'int' return of this function is the HTTP status code that should be sent back to the user upon requesting this data.
func Update ¶
func Update(db *model.Database, id uuid.UUID, name string, columns []string) (*model.Application, string, int, error)
Updates an application in the database. The 'id' parameter should be parsed into a UUID to ensure validity. Only provided parameters will be updated. The 'int' return of this function is the HTTP status code that should be sent back to the user upon calling this function.
Types ¶
This section is empty.