Documentation ¶
Index ¶
Constants ¶
const ( HTTPMethodEnumGET _HTTPMethodEnum = "GET" HTTPMethodEnumPOST _HTTPMethodEnum = "POST" HTTPMethodEnumPUT _HTTPMethodEnum = "PUT" HTTPMethodEnumDELETE _HTTPMethodEnum = "DELETE" )
Variables ¶
This section is empty.
Functions ¶
func HTTPMethodEnumStrings ¶
func HTTPMethodEnumStrings() []string
HTTPMethodEnumStrings returns a slice of all enum values as strings. This could be useful for validation with something like slices.Contains or quickly seeing all values of an enum. Each string matches the index of HTTPMethodEnumValues.
Types ¶
type HTTPMethodEnum ¶
type HTTPMethodEnum interface { fmt.Stringer encoding.TextMarshaler // contains filtered or unexported methods }
HTTPMethodEnum is a true enum, i.e. using this as a parameter in a function declaration requires the use of one of the constants defined in this package.
func HTTPMethodEnumValues ¶
func HTTPMethodEnumValues() []HTTPMethodEnum
HTTPMethodEnumValues returns a slice of values of the HTTPMethodEnum enum. Each enum value matches the index of HTTPMethodEnumStrings.
func ToHTTPMethodEnum ¶
func ToHTTPMethodEnum(s string) (HTTPMethodEnum, error)
ToHTTPMethodEnum retrieves an enum value from the constants defined in this package. It tries it's best to find s in the enum by using the original-case, uppercase and lowercase.
type HTTPMethodEnumUnmarshaler ¶
type HTTPMethodEnumUnmarshaler string
func (HTTPMethodEnumUnmarshaler) Extract ¶
func (x HTTPMethodEnumUnmarshaler) Extract() HTTPMethodEnum
func (*HTTPMethodEnumUnmarshaler) UnmarshalText ¶
func (x *HTTPMethodEnumUnmarshaler) UnmarshalText(text []byte) error
type InvalidHTTPMethodEnumError ¶
type InvalidHTTPMethodEnumError struct {
// contains filtered or unexported fields
}
InvalidHTTPMethodEnumError is returned by ToHTTPMethodEnum if the passed in string isn't one of the enum values.
func (InvalidHTTPMethodEnumError) Error ¶
func (e InvalidHTTPMethodEnumError) Error() string
Error exposes the invalid string used and shows all the possible values.
func (InvalidHTTPMethodEnumError) Is ¶
func (e InvalidHTTPMethodEnumError) Is(err error) bool
Is tells you if target can be unwrapped to be an InvalidHTTPMethodEnumError.