modulepackage
0.0.0-20220224111943-4c9cbb960a43
Repository: https://github.com/jerloo/pica.git
Documentation: pkg.go.dev
# README
pica
Pica is a restful automated testing tool and document generate tool written in golang.
It's inspired deeply by frank.
Features
- Basic api test (support POST, GET, PUT, DELETE, PATCH)
- Generate api document to markdown file.
- Benchmark webapi.(TODO)
- Serve api document as a website.(TODO)
- Custom theme or css for this website(TODO).
- Api version controls, automated version release note.
- Api version diff to show.(TODO)
Status
It's under development.
Install
go get github.com/jerloo/pica/cmd/pica
Usage
// It's a full demo for pica.
// Init vars
name = 'demo'
description = 'This is a demo for pica.'
version = '0.0.1'
author = '[email protected] jerloo'
baseUrl = 'http://localhost:8080'
headers = {
'Content-Type' = 'application/json'
}
// Apis format: [method] [path] [description]
// GET /api/users 获取用户列表
headers['Authorization'] = 'slfjaslkfjlasdjfjas=='
// POST /api/users 新建用户
post = {
// 用户名
'name' = 'test'
// 密码
'age' = 10
}
$ pica --help
usage: pica [<flags>] <command> [<args> ...]
A command line for api test and doc generate.
Flags:
--help Show context-sensitive help (also try --help-long and --help-man).
--debug Debug mode.
Commands:
help [<command>...]
Show help.
run [<flags>] [<filename>] [<apiNames>...]
Run api file.
format [<flags>] [<filename>]
Format api file.
serve [<flags>]
Run a document website.
init [<filename>] [<template>]
Init a new api file from template.
config [<flags>]
Config pica.
TODO
Document generation- Api document server
Api document version control- Add funny grammer provider
LICENSE
The MIT License (MIT)
Copyright (c) 2018 jerloo
# Functions
Address builtin function to fake an address.
No description provided by the author
字符首字母大写转换.
No description provided by the author
No description provided by the author
Domain builtin function to fake a domain.
Email builtin function to fake an email.
No description provided by the author
FullName builtin function to fake a fullname.
No description provided by the author
No description provided by the author
No description provided by the author
New returns a new Benchmark pointer with the default values set.
NewAPIRunnerFromContent create a runner from a pica content.
NewAPIRunnerFromFile create a runner from a pica file.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Phone builtin function to fake a phone no.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Words builtin function to fake words.
# Constants
No description provided by the author
# Variables
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
go:embed gen_template.funny.txt.
No description provided by the author
# Structs
No description provided by the author
No description provided by the author
No description provided by the author
APIRunner the runner.
No description provided by the author
Benchmark holds all the parameters required to run the benchmark and respective methods.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Interfaces
No description provided by the author
# Type aliases
No description provided by the author