utils

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRequestWithMultipartForm added in v0.5.6

func NewRequestWithMultipartForm(form MultipartForm) (*http.Request, error)

NewRequestWithMultipartForm creates a mock gin.Context populated with the provided multipart form data. It constructs the multipart form, attaches it to a mock request, and creates a gin.Context using that request. Returns the created context and any error.

The request is a POST request to "/" with the provided form data.

func NewRequestWithQueryParameters added in v0.5.6

func NewRequestWithQueryParameters(parameters []QueryParameter) *http.Request

NewRequestWithQueryParameters creates a mock echo.Context with the provided query parameters set. It is intended for use in tests.

It returns a GET request for the path "/"

Types

type Field

type Field struct {
	Name  string `yaml:"name"`
	Value string `yaml:"value"`
}

Field holds a key-value pair for a form field.

type File

type File struct {
	Name    string `yaml:"name"`
	Content string `yaml:"content"`
}

File contains metadata and content for a file in a multipart form.

type H added in v0.5.6

type H map[string]interface{}

type MultipartForm

type MultipartForm struct {
	Fields []Field           `yaml:"fields"` // Regular form fields
	Files  map[string][]File `yaml:"files"`  // File fields with file content
}

MultipartForm holds form fields and files for a multipart form.

type NoPageFoundError added in v0.5.6

type NoPageFoundError struct {
	Page string
}

NoPageFoundError is returned by Render if no template was found, in which case the Render is skipped and moves on to the next middleware.

func (*NoPageFoundError) Error added in v0.5.6

func (e *NoPageFoundError) Error() string

type QueryParameter

type QueryParameter struct {
	Name  string `yaml:"name"`
	Value string `yaml:"value"`
}

QueryParameter holds a key-value pair for a query parameter.

type TestGlazedCommand

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

func NewTestGlazedCommand

func NewTestGlazedCommand(options ...cmds.CommandDescriptionOption) (*TestGlazedCommand, error)

func (*TestGlazedCommand) Description

func (t *TestGlazedCommand) Description() *cmds.CommandDescription

func (*TestGlazedCommand) RunIntoGlazeProcessor

func (t *TestGlazedCommand) RunIntoGlazeProcessor(
	ctx context.Context,
	parsedLayers *layers.ParsedLayers,
	gp middlewares.Processor,
) error

func (*TestGlazedCommand) ToYAML

func (t *TestGlazedCommand) ToYAML(w io.Writer) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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