Documentation
¶
Index ¶
- type Builder
- func (b *Builder) AddHeader(name, value string, line, col int)
- func (b *Builder) AppendBodyLine(no int, text, term string)
- func (b *Builder) BodyFromFile() string
- func (b *Builder) BodyLines() []int
- func (b *Builder) BodyText() string
- func (b *Builder) HasMethod() bool
- func (b *Builder) HeaderDone() bool
- func (b *Builder) HeaderLines() []restfile.HeaderLine
- func (b *Builder) HeaderMap() stdhttp.Header
- func (b *Builder) Headers() stdhttp.Header
- func (b *Builder) MarkHeadersDone()
- func (b *Builder) Method() string
- func (b *Builder) MimeType() string
- func (b *Builder) SetBodyFromFile(path string)
- func (b *Builder) SetMethodAndURL(method, url string)
- func (b *Builder) SetURLPos(line, col int)
- func (b *Builder) URL() string
- func (b *Builder) URLPos() (line, col int)
- type MethodLine
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func (*Builder) AppendBodyLine ¶
func (*Builder) BodyFromFile ¶
func (*Builder) BodyText ¶
BodyText rebuilds the body with its original line endings. The final line ending is not part of the body.
func (*Builder) HeaderDone ¶
func (*Builder) HeaderLines ¶ added in v1.7.0
func (b *Builder) HeaderLines() []restfile.HeaderLine
func (*Builder) MarkHeadersDone ¶
func (b *Builder) MarkHeadersDone()
func (*Builder) SetBodyFromFile ¶
func (*Builder) SetMethodAndURL ¶
type MethodLine ¶ added in v1.2.4
MethodLine contains the parsed parts of a request line.
func ParseMethodLine ¶
func ParseMethodLine(line string) (ml MethodLine, ok bool, err error)
ParseMethodLine parses an HTTP request line.
func ParseRequestLine ¶ added in v1.2.4
func ParseRequestLine(line string) (MethodLine, bool, error)
ParseRequestLine parses a method request or a bare HTTP/WebSocket URL.
func ParseWebSocketURLLine ¶
func ParseWebSocketURLLine(line string) (MethodLine, bool, error)
ParseWebSocketURLLine parses a bare WebSocket request line.
Click to show internal directories.
Click to hide internal directories.