apijson

package module
v0.2.0-beta9 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: MIT Imports: 5 Imported by: 0

README

apijson-go [摸石头阶段]

基于 go + goframe 实现的 apijson

暂仍处于前期开发探索中, 请仅使用在 个人探索项目

目前处于 【下水阶段】, 欢迎测试、issue、建议、pr

目前处于 【摸石头阶段】, 欢迎测试、issue、建议、pr, 请勿使用在非个人的线上项目

RoadMap 阶段规划

快速体验

创建后 执行 @demo/todo/tests 下的 *_test.go 访问测试

使用指南

暂参考demo目录下的todo

文档参考

  1. Get开放查询
  2. 非开放请求
  3. 权限控制

# 开发指南

  1. go >= 1.18
  2. 创建 mysql 数据库
  3. 导入 demo/todo/doc/todo.sql文件
  4. demo/todo/config.yaml.example 改成 demo/todo/config.yaml, 然后修改配置文件 config.yaml 中数据库连接
  5. 在demo/todo 目录运行 go run main.go 或者 查看测试 demo/todo/tests

感谢

参考链接

  1. 详细的说明文档.md
  2. 最新规范文档
  3. todo demo doc
  4. 如何实现其它语言的APIJSON?

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultApiJson = New()

Functions

This section is empty.

Types

type ApiJson

type ApiJson struct {
	Debug bool // 是否开启debug模式, 显示每步骤
	// contains filtered or unexported fields
}

func Load

func Load(apps ...func(ctx context.Context, a *ApiJson)) *ApiJson

Load load for defaultApiJson, 简化使用

func New

func New() *ApiJson

func (*ApiJson) Config

func (a *ApiJson) Config() *config.Config

func (*ApiJson) Load

func (a *ApiJson) Load()

func (*ApiJson) NewAction

func (a *ApiJson) NewAction(ctx context.Context, method string, req model.Map) *action.Action

func (*ApiJson) NewQuery

func (a *ApiJson) NewQuery(ctx context.Context, req model.Map) *query.Query

func (*ApiJson) Use

func (a *ApiJson) Use(p ...func(ctx context.Context, a *ApiJson)) *ApiJson

type Plugin

type Plugin interface {
	Install(ctx context.Context, a *ApiJson)
}

Directories

Path Synopsis
drivers

Jump to

Keyboard shortcuts

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