api

package
v0.0.0-...-9c393dc Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

处理Http报文的处理器 又这个handler类来负责实现具体的API 接口

func NewHandler

func NewHandler(svc blog.Service) *Handler

为啥要用一个函数来构造 初始化一些基础数据 具体传递实现,在什么时候决定 典型的面向接口编程

func (*Handler) CreateBlog

func (h *Handler) CreateBlog(c *gin.Context)

使用web框架: Gin

func (*Handler) Registry

func (h *Handler) Registry(r gin.IRouter)

把你的请求和Http 路由对应上 r 就是一个gin http 的路由器 URL: /vblog/api/v1/blogs ---> 那个Handler(处理函数)

Jump to

Keyboard shortcuts

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