controller

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockController

type MockController struct {
	HasRun bool
}

MockController Mock the controller interface

func (*MockController) Init

func (m *MockController) Init(app interface{}, params []string, request *http.Request)

Init Mock the init method

func (*MockController) Run

func (m *MockController) Run(response http.ResponseWriter, request *http.Request)

Run Mock the run method

type MockResponse

type MockResponse struct {
	Content    string
	Headers    http.Header
	StatusCode int
}

MockResponse Mock for http.ResponseWriter

func NewMockResponse

func NewMockResponse() *MockResponse

NewMockResponse Make a mock response

func (*MockResponse) Header

func (m *MockResponse) Header() http.Header

Header Return Headers map

func (*MockResponse) Reset

func (m *MockResponse) Reset()

Reset Reset the struct

func (*MockResponse) Write

func (m *MockResponse) Write(b []byte) (int, error)

Write Write the response

func (*MockResponse) WriteHeader

func (m *MockResponse) WriteHeader(statusCode int)

WriteHeader Write the status code

Jump to

Keyboard shortcuts

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