tools

package
v1.2.9 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallAPI

func CallAPI(
	method, url string, headers map[string]string, reqBody interface{},
	cookies ...*http.Cookie,
) (
	*http.Response,
	error,
)

func Harness

func Harness(
	serviceRequests []gkBoot.ServiceRequest,
	bootOption []config.GkBootOption,
	runners TestRunners,
	t *testing.T,
)

func ReadResponseBody

func ReadResponseBody(response *http.Response, respObj interface{}) error

Types

type Cache

type Cache struct {
	sync.Map
}

func (*Cache) Get

func (c *Cache) Get(ctx context.Context, key string) (interface{}, error)

func (*Cache) Put

func (c *Cache) Put(ctx context.Context, key string, value interface{}, ttl time.Duration) (interface{}, error)

type TestRunners

type TestRunners map[string]func(t *testing.T)

func NewTestRunner

func NewTestRunner() TestRunners

func (TestRunners) Test

func (r TestRunners) Test(name string, test func(subT *testing.T)) TestRunners

Jump to

Keyboard shortcuts

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