Documentation
¶
Index ¶
- type Request
- func (r *Request) Arg(index int) string
- func (r *Request) Args() []string
- func (r *Request) Bind(i any) error
- func (*Request) Context() context.Context
- func (*Request) HostName() (hostname string)
- func (r *Request) Param(key string) string
- func (r *Request) Params(key string) []string
- func (r *Request) PathParam(key string) string
- type Responder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
Request is an abstraction over the actual command with flags. This abstraction is useful because it allows us to create cmd applications in same way we would create a HTTP server application. Kite's http.Request is another such abstraction.
func NewRequest ¶
NewRequest creates a Request from a list of arguments. This way we can simulate running a command without actually doing it. It makes the code more testable this way.
func (*Request) Arg ¶ added in v0.1.1
Arg returns the positional argument at the given index (0-based, after command words). Returns empty string if index is out of range.
Click to show internal directories.
Click to hide internal directories.