added String()

This commit is contained in:
xdrm-brackets 2018-04-25 16:25:41 +02:00
parent 2e90ff9cae
commit 0792cfaa06
1 changed files with 12 additions and 9 deletions

View File

@ -10,6 +10,8 @@ import (
// from a reader (typically bufio.NewRead of the socket) // from a reader (typically bufio.NewRead of the socket)
func Build(r io.Reader) (request *T, err error) { func Build(r io.Reader) (request *T, err error) {
/* (1) Parse request
---------------------------------------------------------*/
/* (1) Get chunk reader */ /* (1) Get chunk reader */
cr := reader.NewReader(r) cr := reader.NewReader(r)
if err != nil { if err != nil {
@ -40,14 +42,15 @@ func Build(r io.Reader) (request *T, err error) {
} }
return req, nil
/* (2) GET {uri} HTTP/{version}
---------------------------------------------------------*/
/* (1) Break apart */
/* (1) Check method */
return nil, nil
} }
// String returns a textual representation of the upgrade request
func (r T) String() string{
return fmt.Sprintf("Upgrade Request\n - host: %s\n - port: %d\n", r.host, r.port)
}