handlers

package
v1.23.3 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 18 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientError

type ClientError interface {
	Error() string
	Code() int
}

ClientError is an interface that can be used to retrieve the status code if a client has errored

type ClientErrorMock added in v1.8.0

type ClientErrorMock struct {
	// CodeFunc mocks the Code method.
	CodeFunc func() int

	// ErrorFunc mocks the Error method.
	ErrorFunc func() string
	// contains filtered or unexported fields
}

ClientErrorMock is a mock implementation of ClientError.

func TestSomethingThatUsesClientError(t *testing.T) {

	// make and configure a mocked ClientError
	mockedClientError := &ClientErrorMock{
		CodeFunc: func() int {
			panic("mock out the Code method")
		},
		ErrorFunc: func() string {
			panic("mock out the Error method")
		},
	}

	// use mockedClientError in code that requires ClientError
	// and then make assertions.

}

func (*ClientErrorMock) Code added in v1.8.0

func (mock *ClientErrorMock) Code() int

Code calls CodeFunc.

func (*ClientErrorMock) CodeCalls added in v1.8.0

func (mock *ClientErrorMock) CodeCalls() []struct {
}

CodeCalls gets all the calls that were made to Code. Check the length with:

len(mockedClientError.CodeCalls())

func (*ClientErrorMock) Error added in v1.8.0

func (mock *ClientErrorMock) Error() string

Error calls ErrorFunc.

func (*ClientErrorMock) ErrorCalls added in v1.8.0

func (mock *ClientErrorMock) ErrorCalls() []struct {
}

ErrorCalls gets all the calls that were made to Error. Check the length with:

len(mockedClientError.ErrorCalls())

type Feedback added in v0.2.0

type Feedback struct {
	Render       interfaces.Renderer
	CacheService *cacheHelper.Helper
	Config       *config.Config
}

Feedback represents the handlers required to provide feedback

func NewFeedback added in v1.0.0

func NewFeedback(rc interfaces.Renderer, c *cacheHelper.Helper, cfg *config.Config) *Feedback

NewFeedback creates a new instance of Feedback

func (*Feedback) AddFeedback added in v1.0.0

func (f *Feedback) AddFeedback() http.HandlerFunc

AddFeedback handles a users feedback request

func (*Feedback) FeedbackThanks added in v1.0.0

func (f *Feedback) FeedbackThanks() http.HandlerFunc

FeedbackThanks loads the Feedback Thank you page

func (*Feedback) GetFeedback added in v1.0.0

func (f *Feedback) GetFeedback() http.HandlerFunc

GetFeedback handles the loading of a feedback page

type RenderClient added in v1.8.0

type RenderClient interface {
	BuildPage(w io.Writer, pageModel interface{}, templateName string)
	NewBasePageModel() model.Page
}

RenderClient interface defines page rendering

type RenderClientMock added in v1.8.0

type RenderClientMock struct {
	// BuildPageFunc mocks the BuildPage method.
	BuildPageFunc func(w io.Writer, pageModel interface{}, templateName string)

	// NewBasePageModelFunc mocks the NewBasePageModel method.
	NewBasePageModelFunc func() core.Page
	// contains filtered or unexported fields
}

RenderClientMock is a mock implementation of RenderClient.

func TestSomethingThatUsesRenderClient(t *testing.T) {

	// make and configure a mocked RenderClient
	mockedRenderClient := &RenderClientMock{
		BuildPageFunc: func(w io.Writer, pageModel interface{}, templateName string)  {
			panic("mock out the BuildPage method")
		},
		NewBasePageModelFunc: func() core.Page {
			panic("mock out the NewBasePageModel method")
		},
	}

	// use mockedRenderClient in code that requires RenderClient
	// and then make assertions.

}

func (*RenderClientMock) BuildPage added in v1.8.0

func (mock *RenderClientMock) BuildPage(w io.Writer, pageModel interface{}, templateName string)

BuildPage calls BuildPageFunc.

func (*RenderClientMock) BuildPageCalls added in v1.8.0

func (mock *RenderClientMock) BuildPageCalls() []struct {
	W            io.Writer
	PageModel    interface{}
	TemplateName string
}

BuildPageCalls gets all the calls that were made to BuildPage. Check the length with:

len(mockedRenderClient.BuildPageCalls())

func (*RenderClientMock) NewBasePageModel added in v1.8.0

func (mock *RenderClientMock) NewBasePageModel() core.Page

NewBasePageModel calls NewBasePageModelFunc.

func (*RenderClientMock) NewBasePageModelCalls added in v1.8.0

func (mock *RenderClientMock) NewBasePageModelCalls() []struct {
}

NewBasePageModelCalls gets all the calls that were made to NewBasePageModel. Check the length with:

len(mockedRenderClient.NewBasePageModelCalls())

Jump to

Keyboard shortcuts

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