swag: github.com/swaggo/swag/example/markdown/api Index | Files

package api

import "github.com/swaggo/swag/example/markdown/api"

Index

Package Files

api.go

func AddUser Uses

func AddUser(w http.ResponseWriter, r *http.Request)

AddUser example @Summary Add a new user to the store @Tags admin @Accept json @Produce json @Param message body api.User true "User Data" @Success 200 {string} string "ok" @Failure 400 {object} api.APIError "We need ID!!" @Failure 404 {object} api.APIError "Can not find ID" @Router /admin/user/ [post]

func GetUser Uses

func GetUser(w http.ResponseWriter, r *http.Request)

GetUser example @Summary Read user from the store @Tags admin @Accept json @Produce json @Param id path int true "User Id" @Success 200 {object} api.User @Failure 400 {object} api.APIError "We need ID!!" @Failure 404 {object} api.APIError "Can not find ID" @Router /admin/user/{id} [get]

func ListUsers Uses

func ListUsers(w http.ResponseWriter, r *http.Request)

ListUsers example @Summary List users from the store @Tags admin @Accept json @Produce json @Success 200 {array} api.UsersCollection "ok" @Router /admin/user/ [get]

func UpdateUser Uses

func UpdateUser(w http.ResponseWriter, r *http.Request)

UpdateUser example @Summary Add a new user to the store @Tags admin @Accept json @Produce json @Param message body api.User true "User Data" @Success 200 {string} string "ok" @Failure 400 {object} api.APIError "We need ID!!" @Failure 404 {object} api.APIError "Can not find ID" @Router /admin/user/ [put]

type APIError Uses

type APIError struct {
    ErrorCode    int
    ErrorMessage string
    CreatedAt    time.Time
}

APIError example

type User Uses

type User struct {
    Id       int64
    Email    string
    Password string
}

User example

type UsersCollection Uses

type UsersCollection []User

UsersCollection example

Package api imports 2 packages (graph) and is imported by 1 packages. Updated 2019-11-26. Refresh now. Tools for package owners.