Home / Function/ TestRunTLS() — gin Function Reference

TestRunTLS() — gin Function Reference

Architecture documentation for the TestRunTLS() function in gin_integration_test.go from the gin codebase.

Entity Profile

Dependency Diagram

graph TD
  807dbf1a_5da2_d76d_edab_06d7b1a182a8["TestRunTLS()"]
  0cb54875_e9be_d799_8e29_6666cf3d9cd7["testRequest()"]
  807dbf1a_5da2_d76d_edab_06d7b1a182a8 -->|calls| 0cb54875_e9be_d799_8e29_6666cf3d9cd7
  style 807dbf1a_5da2_d76d_edab_06d7b1a182a8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

gin_integration_test.go lines 157–171

func TestRunTLS(t *testing.T) {
	router := New()
	go func() {
		router.GET("/example", func(c *Context) { c.String(http.StatusOK, "it worked") })

		assert.NoError(t, router.RunTLS(":8443", "./testdata/certificate/cert.pem", "./testdata/certificate/key.pem"))
	}()

	// have to wait for the goroutine to start and run the server
	// otherwise the main thread will complete
	time.Sleep(5 * time.Millisecond)

	require.Error(t, router.RunTLS(":8443", "./testdata/certificate/cert.pem", "./testdata/certificate/key.pem"))
	testRequest(t, "https://localhost:8443/example")
}

Domain

Subdomains

Frequently Asked Questions

What does TestRunTLS() do?
TestRunTLS() is a function in the gin codebase.
What does TestRunTLS() call?
TestRunTLS() calls 1 function(s): testRequest.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free