methodkind

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package methodkind classifies handler method names into HTTP method kinds (GET, POST, PUT, DELETE) or event handlers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Kind

type Kind int8

Kind represents the kind of handler method.

const (
	GETHandler Kind
	ActionPOSTHandler
	ActionPUTHandler
	ActionDELETEHandler
	EventHandler
)

func Classify

func Classify(name string) (kind Kind, suffix string)

Classify determines the handler kind and name suffix from a method name. Returns zero Kind for unrecognized names.

func (Kind) HTTPMethod

func (k Kind) HTTPMethod() string

HTTPMethod returns the HTTP method string for the kind.

func (Kind) IsAction

func (k Kind) IsAction() bool

IsAction reports whether the kind is an action (POST, PUT, or DELETE).

Jump to

Keyboard shortcuts

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