controllers

package
v0.0.0-...-3338c34 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(err error)

Types

type Controllersdb

type Controllersdb models.DBData

func (*Controllersdb) Add

func (db *Controllersdb) Add(w http.ResponseWriter, req *http.Request)

swagger:route PUT /api/contacts controllers update adds new contacts to a phoneBook responses: 200: updateResponse 401: updateUnauthorized 409: updateConflictError 500: updateInternalError

func (*Controllersdb) CloseDB

func (db *Controllersdb) CloseDB() string

func (*Controllersdb) DbExists

func (db *Controllersdb) DbExists() bool

func (*Controllersdb) Delete

func (db *Controllersdb) Delete(writer http.ResponseWriter, req *http.Request)

swagger:route DELETE /api/contacts controllers delete delete contact from phone book responses: 200: deleteResponse 400: deleteUnauthorized 500: deleteInternalError

func (*Controllersdb) Fetch

func (db *Controllersdb) Fetch(w http.ResponseWriter, req *http.Request)

swagger:route GET /api/contacts controllers fetch returns all phonebook contacts responses: 200: fetchResponse 401: fetchUnauthorized 500: fetchInternalError

func (*Controllersdb) OpenDB

func (db *Controllersdb) OpenDB() (*sql.DB, error)

type MyStdResp

type MyStdResp struct {
	// successful / not successful
	Status bool `json:"status"`
	// delete message / error message when delete is unsuccessful
	Message string `json:"message"`
}

swagger:model

Jump to

Keyboard shortcuts

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