httputil

package
v2.0.0-rc2+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2018 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NewName      = "newName"
	Dashboard    = "dashboard"
	NewAccount   = "newAccount"
	SignedInUser = "signedInUser"
)

The parameter keys of the header

View Source
const (
	// User
	Identifier  = "inputIdentifier"
	Password    = "inputPassword"
	DisplayName = "inputDisplayName"
	UserName    = "inputUserName"
	Email       = "inputEmail"
	IsAdmin     = "inputIsAdmin"

	// Project
	ProjectName        = "inputProjectName"
	ProjectDescription = "inputProjectDesc"
	ProjectImage       = "inputProjectLogo"
	ProjectVisibility  = "optionsProjectVisibility"
	ProjectRoles       = "inputProjectRoles"

	Version = "version"

	// TestCases
	TestCaseName = "inputTestCaseName"
	TestVersion  = "testVersion"

	// TestSequences
	TestSequenceName          = "inputTestSequenceName"
	TestSequenceDescription   = "inputTestSequenceDescription"
	TestSequencePreconditions = "inputTestSequencePreconditions"
	TestSequenceTestCase      = "inputTestSequenceTestCase"
	NewTestCases              = "newTestcases"
	CommitMessage             = "inputCommitMessage"
	IsMinor                   = "isMinor"
	TestSequenceLabels        = "inputLabels"

	// Members
	Members = "members"
	Roles   = "roles"

	Member = "member"
	Role   = "role"

	// Assignment
	NewTesters  = "newtesters"
	Versions    = "versions"
	Variants    = "variants"
	DeleteTasks = "doneTasks" // The tasks to delete

	// Protocols
	ProtocolType        = "type"
	SelectedProtocol    = "selected"
	PreconditionResults = "preconditions"
	ProtocolNr          = "protocolNr"

	// Group
	GroupName        = "inputGroupName"
	GroupDescription = "inputGroupDesc"
	GroupVisibility  = "inputGroupVisibility"

	OffsetCount = "offsetCount"

	// Comment
	CommentId   = "commentId"
	CommentText = "commentText"
	Fragment    = "fragment"

	// Settings
	IsAccessAllowed                 = "isAccessAllowed"
	IsRegistrationAllowed           = "isRegistrationAllowed"
	IsEmailVerification             = "isEmailVerification"
	IsDisplayMessage                = "isDisplayMessage"
	IsGlobalMessageExpirationDate   = "isGlobalMessageExpirationDate"
	GlobalMessage                   = "globalMessage"
	GlobalMessageType               = "globalMessageType"
	GlobalMessageTimeStamp          = "globalMessageTimeStamp"
	GlobalMessageExpirationDate     = "globalMessageExpirationDate"
	GlobalMessageExpirationDateUnix = "globalMessageExpirationDateUnix"
	ImprintMessage                  = "imprintMessage"
	PrivacyMessage                  = "privacyMessage"

	//Uploads
	UploadSource = "uploadSrc"
	UploadName   = "uploadName"

	//Import
	Import = "inputImport"

	//Label
	LabelId        = "labelId"
	LabelDesc      = "labelDesc"
	LabelColor     = "labelColor"
	LabelTextColor = "labelTextColor"
	LabelName      = "labelName"

	// Integrations in gitlab etc
	GitlabIsActive     = "inputIsActive"
	GitlabProjectID    = "inputProjectID"
	GitlabProjectToken = "inputProjectToken"
)

The parameter keys of a request

Variables

This section is empty.

Functions

func DumpRequest

func DumpRequest(r *http.Request) string

DumpRequest dumps given request into printable string.

func DumpResponse added in v1.0.0

func DumpResponse(r *http.Response) string

DumpResponse is like DumpRequest but for responses.

func GetLanguageFromRequest

func GetLanguageFromRequest(r *http.Request) string

GetLanguageFromRequest reads the Accept-Language header from a request. If the language is not supported, the default en-US will be returned.

func IsFragmentRequest

func IsFragmentRequest(r *http.Request) bool

IsFragmentRequest checks if the request contains a parameter "fragment". If the parameter is one of 1, t, T, TRUE, true or True the function returns true, else it returns false

func SetHeaderValue added in v1.0.0

func SetHeaderValue(w http.ResponseWriter, key, value string)

SetHeaderValue is a helper function for setting a value in the header. The value will be URL-Encoded.

Types

This section is empty.

Jump to

Keyboard shortcuts

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