Help us shape the future of Go! Take the 2026 Go Developer Survey

test

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoLogin

func AutoLogin(id int) (map[string]interface{}, error)

AutoLogin auto login

func GuardBearerJWT

func GuardBearerJWT(c *gin.Context)

GuardBearerJWT test guard

func LoadEngine

func LoadEngine(language ...string) error

LoadEngine load engine

func Start

func Start(t *testing.T, guards map[string]gin.HandlerFunc, port int) error

Start the api server

func Stop

func Stop(onComplete func())

Stop the api server

Types

type Request

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

Request request

func NewRequest

func NewRequest(port int) *Request

NewRequest create a new request

func (*Request) Data

func (r *Request) Data(data map[string]interface{}) *Request

Data set data

func (*Request) Get

func (r *Request) Get() (*Response, error)

Get request

func (*Request) Header

func (r *Request) Header(key string, value string) *Request

Header set header

func (*Request) Param

func (r *Request) Param(key string, value string) *Request

Param set saram

func (*Request) Post

func (r *Request) Post() (*Response, error)

Post request

func (*Request) Route

func (r *Request) Route(route string) *Request

Route set the route

func (*Request) Send

func (r *Request) Send() (*Response, error)

Send request

func (*Request) Token

func (r *Request) Token(token string) *Request

Token set token

type Response

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

Response response

func (*Response) Body

func (p *Response) Body() string

Body get the reaponse body

func (*Response) Int

func (p *Response) Int() (int, error)

Int to int

func (*Response) Map

func (p *Response) Map() (map[string]interface{}, error)

Map to map

func (*Response) Status

func (p *Response) Status() int

Status get the reaponse status

func (*Response) To

func (p *Response) To(v interface{}) error

To cast to custom sturct

Jump to

Keyboard shortcuts

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