servertest

package
v0.75.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2023 License: MIT Imports: 3 Imported by: 1

Documentation

Overview

Package servertest 为 server 提供一些简便的测试方

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete added in v0.71.0

func Delete(a *assert.Assertion, path string) *rest.Request

func Get added in v0.71.0

func Get(a *assert.Assertion, path string) *rest.Request

func NewRequest added in v0.71.0

func NewRequest(a *assert.Assertion, method, path string) *rest.Request

NewRequest 发起测试请求

功能与 rest.NewRequest 相同,默认指定了 client 参数。

func Post added in v0.71.0

func Post(a *assert.Assertion, path string, body []byte) *rest.Request

func Run added in v0.71.0

func Run(a *assert.Assertion, s Server) func()

Run 运行服务内容并返回等待退出的方法

Types

type Server added in v0.71.0

type Server interface {
	Serve() error
}

Jump to

Keyboard shortcuts

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